adds common protocols to the end of game types list

This commit is contained in:
Smith
2024-01-13 15:11:14 +01:00
parent 96614348f1
commit 8197f27491
2 changed files with 6 additions and 3 deletions

2
package-lock.json generated
View File

@@ -6,7 +6,7 @@
"packages": {
"": {
"name": "game-server-watcher",
"version": "2.5.0",
"version": "2.5.1",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@commonify/lowdb": "^3.0.0",

View File

@@ -85,10 +85,13 @@ createServer(async (req, res) => {
'Cache-Control': 'max-age=0'
});
const gdProtocols = ['protocol-ase', 'protocol-battlefield', 'protocol-doom3', 'protocol-epic', 'protocol-gamespy1', 'protocol-gamespy2', 'protocol-gamespy3', 'protocol-goldsrc', 'protocol-nadeo', 'protocol-quake2', 'protocol-quake3', 'protocol-unreal2', 'protocol-valve'];
const types = Array.from(games.keys());
const names = Array.from(games.values()).map(g=>g.pretty);
res.end(JSON.stringify({
enum: Array.from(games.keys()),
enum: [...types, ...gdProtocols],
options: {
enum_titles: Array.from(games.values()).map(g=>g.pretty)
enum_titles: [...names, ...gdProtocols]
}
} as SelectOptionsResponse, null, DBG ? 2 : 0));
} else if (SECRET !== '' && req.headers['x-btoken']) {