Enhancement: add optional token parameter for gamedig (#5245)

Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
InsertDisc
2025-05-05 12:02:47 -04:00
committed by GitHub
parent 7e8752243c
commit 2509d8c235
3 changed files with 15 additions and 2 deletions

View File

@@ -12,13 +12,19 @@ export default async function gamedigProxyHandler(req, res) {
const url = new URL(serviceWidget.url);
try {
const serverData = await GameDig.query({
const gamedigOptions = {
type: serviceWidget.serverType,
host: url.hostname,
port: url.port,
givenPortOnly: true,
checkOldIDs: true,
});
};
if (serviceWidget.gameToken) {
gamedigOptions.token = serviceWidget.gameToken;
}
const serverData = await GameDig.query(gamedigOptions);
res.status(200).send({
online: true,