From 87152ff4c97f441d6c468ef9ff61b606ca67832b Mon Sep 17 00:00:00 2001 From: Smith Date: Mon, 22 Jan 2024 11:33:38 +0100 Subject: [PATCH] upd. gamedig types to v5 --- src/game-server.ts | 7 ++----- src/server.ts | 1 - src/watcher.ts | 3 +-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/game-server.ts b/src/game-server.ts index 57f8f3d..17ea558 100644 --- a/src/game-server.ts +++ b/src/game-server.ts @@ -1,7 +1,5 @@ import axios from 'axios'; -import { Player, QueryResult, Type } from 'gamedig'; -// @ts-ignore -import { GameDig } from 'gamedig'; +import { GameDig, Player, QueryResult } from 'gamedig'; import { Low, JSONFile } from '@commonify/lowdb'; import ipRegex from './lib/ipregex.js'; import getIP from './lib/getip.js'; @@ -47,11 +45,10 @@ export interface Info { interface qRes extends QueryResult { game: string; - numplayers: number; } export interface QueryOptions { - type: Type; + type: string; host: string; port: number; maxRetries?: number; diff --git a/src/server.ts b/src/server.ts index f536ce0..406b9a8 100644 --- a/src/server.ts +++ b/src/server.ts @@ -3,7 +3,6 @@ import path from 'node:path'; import crypto from 'node:crypto'; import { createServer } from 'node:http'; import { URL } from 'node:url'; -// @ts-ignore import { games, protocols } from 'gamedig'; import 'dotenv/config'; import { GameServerConfig, main, readConfig, updateConfig } from './watcher.js'; diff --git a/src/watcher.ts b/src/watcher.ts index c2b2333..875dc1d 100644 --- a/src/watcher.ts +++ b/src/watcher.ts @@ -1,4 +1,3 @@ -import { Type } from 'gamedig'; import { Low, JSONFile } from '@commonify/lowdb'; import { GameServer, initDb, saveDb } from './game-server.js'; import * as discordBot from './discord-bot.js'; @@ -43,7 +42,7 @@ export interface GameServerConfig { telegram?: TelegramConfig[]; slack?: SlackConfig[]; // node-gamedig stuff - type: Type; + type: string; host: string; port: number; givenPortOnly?: boolean;