Closed AlinaNova21 closed 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.
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 themultimeter
section from thescreeps.yml
and effectively replaces this entire block https://github.com/screepers/screeps-multimeter/blob/ef0062f58df3b87a6ebd97eb61b4dbbcb271dbda/src/multimeter.js#L223-L230