Closed SzymonLisowiec closed 6 years ago
Server list is outdated. Here is my solution to fix it (ty scholtzm)
async function loadServerList() {
let response = await $.httpGetJson("https://api.steampowered.com/ISteamDirectory/GetCMList/v1/?format=json&cellid=0");
Steam.servers = [];
for (const server of response.response.serverlist) {
let _server = server.split(":");
Steam.servers.push({ "host": _server[0], "port": _server[1] });
}
}
where exactly should I put this code? I have no idea
can someone please help :p
const Steam = require('steam');
const Request = require('request-promise-native');
(async _ => {
await loadServerList();
// Your script
})();
async function loadServerList() {
let response = await Request('https://api.steampowered.com/ISteamDirectory/GetCMList/v1/?format=json&cellid=0');
response = JSON.parse(response);
Steam.servers = [];
for (const server of response.response.serverlist) {
let _server = server.split(":");
Steam.servers.push({ "host": _server[0], "port": _server[1] });
}
}
thanks!
My script and your
node_modules/steam/example.js
not working. Library don't receiving any messages from Steam.