mirror of
https://github.com/tribufu/node-gamedig
synced 2026-05-06 15:17:36 +00:00
feat: remove games.txt and replace it with an in-code solution (#407)
* feat: remove games.txt and replace it with an in-code solution * docs: update changelog * chore: add todo comment regarding weird game ids to rename * fix: generate games list md file * fix: gemerate games list file to alphabetical id order * fix: update changelog to note removal of some game ids and add geneshift alternative
This commit is contained in:
parent
2fb9f507e2
commit
ce4cddb87f
7 changed files with 2456 additions and 468 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import GameResolver from './GameResolver.js'
|
||||
import { lookup } from './game-resolver.js'
|
||||
import { getProtocol } from './ProtocolResolver.js'
|
||||
import GlobalUdpSocket from './GlobalUdpSocket.js'
|
||||
|
||||
|
|
@ -14,7 +14,6 @@ export default class QueryRunner {
|
|||
this.udpSocket = new GlobalUdpSocket({
|
||||
port: runnerOpts.listenUdpPort
|
||||
})
|
||||
this.gameResolver = new GameResolver()
|
||||
}
|
||||
|
||||
async run (userOptions) {
|
||||
|
|
@ -29,7 +28,7 @@ export default class QueryRunner {
|
|||
port_query: gameQueryPort,
|
||||
port_query_offset: gameQueryPortOffset,
|
||||
...gameOptions
|
||||
} = this.gameResolver.lookup(userOptions.type)
|
||||
} = lookup(userOptions.type)
|
||||
const attempts = []
|
||||
|
||||
const optionsCollection = {
|
||||
|
|
@ -78,7 +77,7 @@ export default class QueryRunner {
|
|||
} finally {
|
||||
// Deno doesn't support unref, so we must close the socket after every connection
|
||||
// https://github.com/denoland/deno/issues/20138
|
||||
if (typeof Deno !== "undefined") {
|
||||
if (typeof Deno !== 'undefined') {
|
||||
this.udpSocket?.socket?.close()
|
||||
delete this.udpSocket
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue