|
|
@ -274,8 +274,13 @@ class Monitor extends BeanModel {
|
|
|
|
|
|
|
|
|
|
|
|
} else if (this.type === "steam") {
|
|
|
|
} else if (this.type === "steam") {
|
|
|
|
const steamApiUrl = "https://api.steampowered.com/IGameServersService/GetServerList/v1/";
|
|
|
|
const steamApiUrl = "https://api.steampowered.com/IGameServersService/GetServerList/v1/";
|
|
|
|
|
|
|
|
const steamAPIKey = await setting("steamAPIKey");
|
|
|
|
const filter = `addr\\${this.hostname}:${this.port}`;
|
|
|
|
const filter = `addr\\${this.hostname}:${this.port}`;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!steamAPIKey) {
|
|
|
|
|
|
|
|
throw new Error("Steam API Key not found");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let res = await axios.get(steamApiUrl, {
|
|
|
|
let res = await axios.get(steamApiUrl, {
|
|
|
|
timeout: this.interval * 1000 * 0.8,
|
|
|
|
timeout: this.interval * 1000 * 0.8,
|
|
|
|
headers: {
|
|
|
|
headers: {
|
|
|
@ -292,7 +297,7 @@ class Monitor extends BeanModel {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
filter: filter,
|
|
|
|
filter: filter,
|
|
|
|
key: await setting("steamAPIKey"),
|
|
|
|
key: steamAPIKey,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
@ -303,7 +308,6 @@ class Monitor extends BeanModel {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
bean.ping = await ping(this.hostname);
|
|
|
|
bean.ping = await ping(this.hostname);
|
|
|
|
} catch (_) { }
|
|
|
|
} catch (_) { }
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
throw new Error("Server not found on Steam");
|
|
|
|
throw new Error("Server not found on Steam");
|
|
|
|
}
|
|
|
|
}
|
|
|
|