Comments (10)
At first there was no real documentation about connecting to private servers, so i checked versions and the code to find out how to configure that, but I also saw this in the latest version:
(d6411b2#diff-c172382433adc1be8436b11321190519L125 (commit to v1.5.0)
which removes the server url parameter (as part of the api update)
@@ -122,7 +122,7 @@ module.exports = class Multimeter extends EventEmitter {
run() {
this.api = new ScreepsAPI({
- serverUrl: this.config.serverUrl,
+ token: this.config.token,
});
this.screen = blessed.screen({
I will soon have a look and see about making a PR
from screeps-multimeter.
Hey, thanks for filing an issue! Unfortunately, I haven't been playing Screeps in a while and as such haven't bene doing development on this. I do accept pull requests and will happily push a new release once fixed.
Do you have an error message or stack trace when connecting to private servers?
Also CCing @SystemParadox since he made the API upgrades.
from screeps-multimeter.
Yes I removed the serverUrl option because it no longer works in the newer version of screeps-api. However, it has been replaced with protocol
, hostname
and port
, so it should be pretty simple to add it back in.
I don't think private servers have the API enabled by default, although I do remember seeing a mod to enable it.
from screeps-multimeter.
I have just created a pr, looked at the screeps-api package for how it handles the connection, I am also thinking about writing a little doc for how it works, is the docs folder okay for the documentation?
I had a little issue myself when testing in that the url needs a / at the end otherwise the url.resolve returns nothing for some reason (has nothing to do with this but the screeps api)
(pr: #10)
from screeps-multimeter.
Also yes, for the api to work, you need to generate a api token with ether a steam token (/api/auth/signin), with a password (and screepsmod-auth) or a other mod (none that i know of) that would add static tokens, also the tokens will invalidate after a hour if I'm correct (first 2 methods), so it might be nice to add optional password auth
from screeps-multimeter.
@topjor How were you able to get an api token for your private server? I get a cannot GET error when trying to access my.server/api/auth/signin. Using an api token from the main server also doesnt work. I am able to create a password using screepsmod-auth, but this doesn't support providing a password.
from screeps-multimeter.
@osum4est It's a POST that you need to do with a json body containing i believe a email field with your username or email (if I'm correct it picked both in that field for me), and a password (or steam api token as per default in the official screeps client)
you will get a json body back with your api key (by default it will only be valid for n hours, so you will need to renew it unfortunatly without a mod that adds permanent api keys)
(I am currently at work so I cannot verify but I believe thats how it worked)
from screeps-multimeter.
I was just about to edit that I was dumb and didn't realize it was a POST instead of GET haha. That worked, however now I'm getting a "Error: getaddrinfo ENOTFOUND socket socket:80". I'm sure that is completely unrelated to this though, so thats a separate issue. I might take a look into that, as well as adding user/pass support to this in the next few days.
from screeps-multimeter.
by default screeps does not run on port 80 but 21025, if you get this error in your screeps logs, it cant contact steamapi domain (had that myself because of a wrong default route)
i wanted to try and implement it myself some time back but never came around to do so, so feel free, it would be great to have the option to use both methods
edit: i also have not come around and writing proper documentation for using this on a private servers
from screeps-multimeter.
Okay! I have improved the support for private servers and even adding setup for them to the start up menu. Submitted a PR!
from screeps-multimeter.
Related Issues (18)
- Cannot start HOT 3
- Multiline input HOT 1
- Multiple servers in config HOT 2
- Watch plugin appears to not be working HOT 5
- UTF-8 Encoding HOT 2
- Strip HTML tags from output HOT 1
- Logging module not found. Release 1.8.3. HOT 2
- Cannot watch TypeError HOT 4
- Watch plugin only works with shard0
- Cannot npm install, native deps failing to build HOT 6
- Allow use on private servers HOT 2
- App crashes when logging "<==" in console HOT 5
- Cannot login to private server, throws Error: Not Authorized HOT 2
- Secure is ignored in config HOT 1
- HTML plugin can not handle function return string
- The app fails soon after start HOT 2
- How to use with authentication tokens? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from screeps-multimeter.