Okay yeah that was weird

This commit is contained in:
Christopher Cookman 2023-01-06 11:09:51 -07:00
parent 2865f7af72
commit f7d330cde5
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -386,10 +386,13 @@ app.get('/check', (req, res) => {
console.log(`${colors.cyan(`[INFO ${new Date()}]`)} Checking server ${req.query.address}`); console.log(`${colors.cyan(`[INFO ${new Date()}]`)} Checking server ${req.query.address}`);
Steam.queryGameServerInfo(req.query.address).then(data => { Steam.queryGameServerInfo(req.query.address).then(data => {
// Check if server is not running Stormworks, in which case, someone is trying to be funny // Check if server is not running Stormworks, in which case, someone is trying to be funny
if (data.appid != 573090) { if (data.gameId != "573090") {
res.status(418).send({ res.status(418).send({
"error": "A server was found, but it is not running Stormworks" "error": "A server was found, but it is not running Stormworks"
}); });
console.log(`${colors.red(`[ERROR ${new Date()}]`)} Server ${req.query.address} is not running Stormworks! (AppID: ${data.appid})`);
// debug log all data
console.log(`${colors.cyan(`[INFO ${new Date()}]`)} Server data: ${JSON.stringify(data)}`);
return; return;
} }
data.keywords.split("-") data.keywords.split("-")
@ -411,11 +414,11 @@ app.get('/check', (req, res) => {
"lastUpdated": new Date() "lastUpdated": new Date()
} }
// Check if server is in errored list or offline list, if so, remove it // Check if server is in errored list or offline list, if so, remove it
if (serverList.errored[address]) { if (serverList.errored[req.query.address]) {
delete serverList.errored[address]; delete erroredServers.servers[req.query.address];
} }
if (serverList.offline[address]) { if (serverList.offline[req.query.address]) {
delete serverList.offline[address]; delete offlineServers.servers[req.query.address];
} }
// Add server to server list // Add server to server list
serverList.servers[req.query.address] = output; serverList.servers[req.query.address] = output;