From e8edcf11370612e7f99c54e25f103a3930340080 Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Wed, 31 Jan 2024 21:11:31 -0700 Subject: [PATCH] Been a while, but they added a new DLC, fuck you geometa --- .gitignore | 0 config.json.default | 0 index.js | 20 +++++++++++++++++--- package-lock.json | 0 package.json | 0 5 files changed, 17 insertions(+), 3 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 config.json.default mode change 100644 => 100755 index.js mode change 100644 => 100755 package-lock.json mode change 100644 => 100755 package.json diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/config.json.default b/config.json.default old mode 100644 new mode 100755 diff --git a/index.js b/index.js old mode 100644 new mode 100755 index 93f728b..99a2a81 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ const childProcess = require('child_process'); const app = express(); const port = 3004; const config = require("./config.json"); - +const fs = require("fs") // Define objects (Need to finish moving objects up here) var masterList = { @@ -74,7 +74,19 @@ function splitKeyword(keyword) { dlcString = "Arid" break; case "3": - dlcString = "Both" + dlcString = "Weapons + Arid" + break; + case "4": + dlcString = "Arid + Space" + break; + case "5": + dlcString = "Weapons + Space" + break; + case "6": + dlcString = "Space" + break; + case "7": + dlcString = "Weapons + Arid + Space" break; default: break; @@ -157,6 +169,8 @@ function objectLength(object) { // checkServer function function checkServer(address) { Steam.queryGameServerInfo(address).then(data => { + // Write data to file name as server name + //fs.writeFileSync(`./servers/srv_${data.name}.json`, JSON.stringify(data, null, 2)); data.keywords.split("-") data.address = address.split(":"); data.serverInfo = splitKeyword(data.keywords); @@ -193,7 +207,7 @@ function checkServer(address) { "address": address.split(":")[0], "port": address.split(":")[1], "version": "Unknown", - "dlc": null, + "dlc": 0, "dlcString": "Unknown", "tps": 0, "players": 0, diff --git a/package-lock.json b/package-lock.json old mode 100644 new mode 100755 diff --git a/package.json b/package.json old mode 100644 new mode 100755