screepers / screeps-multimeter

The most useful tool on your screeps workbench.
MIT License
89 stars 28 forks source link

Secure is ignored in config #46

Closed AlinaNova21 closed 3 years ago

AlinaNova21 commented 3 years ago

The connection code is ignoring the secure property in the config. This makes UCF compliant configs not work for servers with https such as the screepspl.us servers.

As an aside, why not use await ScreepsAPI.fromConfig(serverName, 'multimeter')? That will return an API instance + api.appConfig will contain the multimeter section from the screeps.yml and effectively replaces this entire block https://github.com/screepers/screeps-multimeter/blob/ef0062f58df3b87a6ebd97eb61b4dbbcb271dbda/src/multimeter.js#L223-L230

SystemParadox commented 3 years ago

Thanks for the report! This confused me initially as I've been using it with the screepspl.us servers just fine, but I've been using port 21025 which is http not https.

It's partly a hangover from when I initially supported both legacy and UCF configs, and also because multimeter was originally going to need to add non-standard shards and defaultShard properties for each server, until I discovered I could get the CPU allocations from the API and do it automatically. Since both of these are moot I might be able to tidy this up now.