From 9a2cfc8ecf5f8fd32c299b63c801e6dcb068ae20 Mon Sep 17 00:00:00 2001 From: KarateSnoopy Date: Wed, 25 Jul 2018 20:35:21 -0700 Subject: [PATCH 1/2] Updating readme with more detail --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 6673cfa..38e0d9a 100644 --- a/README.md +++ b/README.md @@ -8,19 +8,50 @@ # Installation -1. `npm install screepsmod-auth` in your server folder. -2. Thats it! +1. Either run `npm install screepsmod-auth` in your screeps private server folder or subscribe the Steam workshop https://steamcommunity.com/sharedfiles/filedetails/?id=800390576 if your using the in-game private server. -# Usage +2. Modify mods.json and add a new line in your mods list pointing to this mod like so: -## Steam Console method -1. Open the steam screeps client -2. In console, run `setPassword('YourDesiredPassword')` -3. Now you should be able to login via API +``` + "mods": [ + "node_modules\\screepsmod-auth\\index.js" + ], +``` +3. Relaunch your screeps private server. +3. Follow the +[CLI steps](#screeps-server-command-line-interface-cli-method) below to setup your username and password + +# Setup + +## Screeps Server Command Line Interface (CLI) method +1. Connect to your screeps private server once to create your account. You don't need to set an email as that won't be used. Just username and password is important. + +2. Run the server's command line interface (CLI) either in Steam, or if your running a standalone server as described here https://github.com/screeps/screeps#command-line-interface-cli + +3. In server's CLI, run + +``` +setPassword('yourUserName', 'yourPassword') +``` +Note: that setPassword says to pass in the email. Don't do this. Instead give it your username. + +4. If you get back an error that setPassword isn't defined, then its likely your mod isn't installed. See the mod.json set above to fix it. If setPassword returns {} then that's also a failure as your user name wasn't found. If setPassword returns { modified: 1 }, then it succceded. + +5. Now you should be able to login ## Web Form Method -1. Open the steam client at least once (Required to create initial account) -2. Goto http://yourServerHostOrIP:21025/authmod/password/ +1. Connect to your screeps private server once to create your account. You don't need to set an email as that won't be used. Just username and password is important. + +2. Send a POST call to http://yourServerHostOrIP:21025/authmod/password/ with this header: +``` +Content-Type: application/json +``` +and the body of + +``` +{ "email":"yourUserName", "password": "yourPassword" } +``` + 3. Enter your desired password 4. Click Signin with steam 5. Your password should be set and you be able to login via API @@ -54,4 +85,4 @@ or manual approval to control spawning. [auth] cpu = 100 preventSpawning = false -``` \ No newline at end of file +``` From 241a764fdd2dfd144fc20c9443904daac555992a Mon Sep 17 00:00:00 2001 From: KarateSnoopy Date: Fri, 27 Jul 2018 22:18:45 -0700 Subject: [PATCH 2/2] Update based on feedback --- README.md | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 38e0d9a..7e7280f 100644 --- a/README.md +++ b/README.md @@ -8,23 +8,25 @@ # Installation -1. Either run `npm install screepsmod-auth` in your screeps private server folder or subscribe the Steam workshop https://steamcommunity.com/sharedfiles/filedetails/?id=800390576 if your using the in-game private server. +1a. If you are using the in-game private server from Steam, then subscribe the Steam workshop https://steamcommunity.com/sharedfiles/filedetails/?id=800390576 -2. Modify mods.json and add a new line in your mods list pointing to this mod like so: +1b. If you are using the screeps standalone private server, run `npm install screepsmod-auth` folder, and modify mods.json and add a new line in your mods list pointing to this mod like so: ``` "mods": [ "node_modules\\screepsmod-auth\\index.js" ], ``` -3. Relaunch your screeps private server. + +2. Relaunch your screeps private server. + 3. Follow the [CLI steps](#screeps-server-command-line-interface-cli-method) below to setup your username and password # Setup ## Screeps Server Command Line Interface (CLI) method -1. Connect to your screeps private server once to create your account. You don't need to set an email as that won't be used. Just username and password is important. +1. Connect to your screeps private server once to create your account. You don't need to set an email. Just username and password is important. 2. Run the server's command line interface (CLI) either in Steam, or if your running a standalone server as described here https://github.com/screeps/screeps#command-line-interface-cli @@ -39,19 +41,9 @@ Note: that setPassword says to pass in the email. Don't do this. Instead give 5. Now you should be able to login -## Web Form Method -1. Connect to your screeps private server once to create your account. You don't need to set an email as that won't be used. Just username and password is important. - -2. Send a POST call to http://yourServerHostOrIP:21025/authmod/password/ with this header: -``` -Content-Type: application/json -``` -and the body of - -``` -{ "email":"yourUserName", "password": "yourPassword" } -``` - +## Web Form Method +1. Connect to your screeps private server once to create your account. +2. Send a POST call to http://yourServerHostOrIP:21025/authmod/password/ 3. Enter your desired password 4. Click Signin with steam 5. Your password should be set and you be able to login via API