diff --git a/.gitignore b/.gitignore index fcdc9ed..1083e85 100644 --- a/.gitignore +++ b/.gitignore @@ -229,5 +229,4 @@ data/db.sqlite-shm data/db.sqlite-wal data/database-backups -data/config.json -data/servers.json \ No newline at end of file +data/config.json \ No newline at end of file diff --git a/data/servers.json-example b/data/servers.json similarity index 65% rename from data/servers.json-example rename to data/servers.json index a2e84c0..83edd2f 100644 --- a/data/servers.json-example +++ b/data/servers.json @@ -2,73 +2,61 @@ { "name": "WildPrison", "ip": "wildprison.net", - "type": "PC", - "id": 0 + "type": "PC" }, { "name": "Hypixel", "ip": "mc.hypixel.net", - "type": "PC", - "id": 1 + "type": "PC" }, { - "name": "CubeCraft", + "name": "Cubecraft", "ip": "play.cubecraft.net", - "type": "PC", - "id": 2 + "type": "PC" }, { "name": "Mineplex", "ip": "mineplex.com", - "type": "PC", - "id": 3 + "type": "PC" }, { "name": "2b2t", "ip": "2b2t.org", - "type": "PC", - "id": 4 + "type": "PC" }, { "name": "AkumaMC", "ip": "akumamc.net", - "type": "PC", - "id": 5 + "type": "PC" }, { "name": "Wynncraft", "ip": "play.wynncraft.com", - "type": "PC", - "id": 6 + "type": "PC" }, { "name": "Minehut", "ip": "minehut.com", - "type": "PC", - "id": 7 + "type": "PC" }, { "name": "Grand Theft Minecraft", "ip": "gtm.network", - "type": "PC", - "id": 8 + "type": "PC" }, { "name": "HiveMC", "ip": "geo.hivebedrock.network", - "type": "PE", - "id": 9 + "type": "PE" }, { "name": "Purple Prison", "ip": "MCSL.PURPLE.WTF", - "type": "PC", - "id": 10 + "type": "PC" }, { "name": "MinecraftOnline", "ip": "minecraftonline.com", - "type": "PC", - "id": 11 + "type": "PC" } ] diff --git a/src/server/server.ts b/src/server/server.ts index ca06e22..914b0af 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -20,7 +20,6 @@ export enum ServerStatus { } type ServerOptions = { - id: number; name: string; ip: string; port?: number; @@ -33,11 +32,6 @@ type DnsInfo = { }; export default class Server { - /** - * The ID of the server. - */ - private id: number; - /** * The name of the server. */ @@ -71,8 +65,7 @@ export default class Server { hasResolved: false, }; - constructor({ id, name, ip, port, type }: ServerOptions) { - this.id = id; + constructor({ name, ip, port, type }: ServerOptions) { this.name = name; this.ip = ip; this.port = port; @@ -106,7 +99,7 @@ export default class Server { try { influx.writePoint( new Point("playerCount") - .tag("id", this.getID().toString()) + .tag("name", this.getName()) .tag("ip", this.getIP().toLowerCase()) .intField("playerCount", response.playerCount) .timestamp(response.timestamp) @@ -163,7 +156,6 @@ export default class Server { this.favicon = res.favicon; // Set the favicon resolve({ - id: this.getID(), timestamp: Date.now(), ip: ip, playerCount: res.players.online, @@ -189,7 +181,6 @@ export default class Server { } resolve({ - id: this.getID(), timestamp: Date.now(), ip: this.getIP(), playerCount: res.currentPlayers, @@ -199,15 +190,6 @@ export default class Server { }); } - /** - * Returns the ID of the server. - * - * @returns the ID - */ - public getID(): number { - return this.id; - } - /** * Returns the name of the server. * diff --git a/src/server/serverManager.ts b/src/server/serverManager.ts index a909fd0..af16b9b 100644 --- a/src/server/serverManager.ts +++ b/src/server/serverManager.ts @@ -15,7 +15,6 @@ export default class ServerManager { logger.info("Loading servers"); for (const configServer of Servers) { const server = new Server({ - id: configServer.id, ip: configServer.ip, name: configServer.name, type: configServer.type as ServerType, diff --git a/src/types/ping.ts b/src/types/ping.ts index ab23af3..521de18 100644 --- a/src/types/ping.ts +++ b/src/types/ping.ts @@ -1,5 +1,4 @@ export type Ping = { - id: number; timestamp: number; ip: string; playerCount: number;