-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤖 Merge PR #69624 [gamedig] Fix attw errors for 5.0 stable by @andrew…
- Loading branch information
1 parent
cc00beb
commit 51c7dbd
Showing
4 changed files
with
99 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
export class GameDig { | ||
constructor(runnerOpts?: { listenUdpPort?: number }); | ||
query(options: QueryOptions): Promise<QueryResult>; | ||
query(options: QueryOptions, callback: (error: Error, state: QueryResult) => void): void; | ||
|
||
static query(options: QueryOptions): Promise<QueryResult>; | ||
static query(options: QueryOptions, callback: (error: Error, state: QueryResult) => void): void; | ||
static getInstance(): GameDig; | ||
} | ||
|
||
export interface games { | ||
[key: string]: { | ||
name: string; | ||
release_year: number; | ||
options: { | ||
protocol: string; | ||
port?: number; | ||
port_query?: number; | ||
port_query_offset?: number | number[]; | ||
}; | ||
extra?: { | ||
doc_notes?: string; | ||
old_id?: string; | ||
// alias?: string; | ||
}; | ||
}; | ||
} | ||
|
||
export interface protocols { | ||
[key: string]: object; | ||
} | ||
|
||
export interface Player { | ||
name?: string; | ||
raw?: object; | ||
ping?: number; | ||
score?: number; | ||
team?: string; | ||
address?: string; | ||
} | ||
|
||
export interface QueryOptions { | ||
type: string; | ||
host: string; | ||
address?: string; | ||
port?: number; | ||
maxRetries?: number; | ||
socketTimeout?: number; | ||
attemptTimeout?: number; | ||
givenPortOnly?: boolean; | ||
ipFamily?: 0 | 4 | 6; | ||
debug?: boolean; | ||
portCache?: boolean; | ||
stripColors?: boolean; | ||
noBreadthOrder?: boolean; | ||
checkOldIDs?: boolean; | ||
// checkAlias?: boolean; | ||
// Valve | ||
requestRules?: boolean; | ||
requestRulesRequired?: boolean; | ||
requestPlayersRequired?: boolean; | ||
// Discord | ||
guildId?: string; | ||
// Nadeo | ||
login?: string; | ||
password?: string; | ||
// Teamspeak 3 | ||
teamspeakQueryPort?: number; | ||
// Terraria | ||
token?: string; | ||
} | ||
|
||
export interface QueryResult { | ||
name: string; | ||
map: string; | ||
password: boolean; | ||
numplayers: number; | ||
maxplayers: number; | ||
players: Player[]; | ||
bots: Player[]; | ||
connect: string; | ||
ping: number; | ||
queryPort: number; | ||
version: string; | ||
raw?: object; | ||
} | ||
|
||
export const games: games; | ||
export const protocols: protocols; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1 @@ | ||
export class GameDig { | ||
constructor(runnerOpts?: { listenUdpPort?: number }); | ||
query(options: QueryOptions): Promise<QueryResult>; | ||
query(options: QueryOptions, callback: (error: Error, state: QueryResult) => void): void; | ||
|
||
static query(options: QueryOptions): Promise<QueryResult>; | ||
static query(options: QueryOptions, callback: (error: Error, state: QueryResult) => void): void; | ||
static getInstance(): GameDig; | ||
} | ||
|
||
export interface games { | ||
[key: string]: { | ||
name: string; | ||
release_year: number; | ||
options: { | ||
protocol: string; | ||
port?: number; | ||
port_query?: number; | ||
port_query_offset?: number | number[]; | ||
}; | ||
extra?: { | ||
doc_notes?: string; | ||
old_id?: string; | ||
// alias?: string; | ||
}; | ||
}; | ||
} | ||
|
||
export interface protocols { | ||
[key: string]: object; | ||
} | ||
|
||
export interface Player { | ||
name?: string; | ||
raw?: object; | ||
ping?: number; | ||
score?: number; | ||
team?: string; | ||
address?: string; | ||
} | ||
|
||
export interface QueryOptions { | ||
type: string; | ||
host: string; | ||
address?: string; | ||
port?: number; | ||
maxRetries?: number; | ||
socketTimeout?: number; | ||
attemptTimeout?: number; | ||
givenPortOnly?: boolean; | ||
ipFamily?: 0 | 4 | 6; | ||
debug?: boolean; | ||
portCache?: boolean; | ||
stripColors?: boolean; | ||
noBreadthOrder?: boolean; | ||
checkOldIDs?: boolean; | ||
// checkAlias?: boolean; | ||
// Valve | ||
requestRules?: boolean; | ||
requestRulesRequired?: boolean; | ||
requestPlayersRequired?: boolean; | ||
// Discord | ||
guildId?: string; | ||
// Nadeo | ||
login?: string; | ||
password?: string; | ||
// Teamspeak 3 | ||
teamspeakQueryPort?: number; | ||
// Terraria | ||
token?: string; | ||
} | ||
|
||
export interface QueryResult { | ||
name: string; | ||
map: string; | ||
password: boolean; | ||
numplayers: number; | ||
maxplayers: number; | ||
players: Player[]; | ||
bots: Player[]; | ||
connect: string; | ||
ping: number; | ||
queryPort: number; | ||
version: string; | ||
raw?: object; | ||
} | ||
|
||
export const games: games; | ||
export const protocols: protocols; | ||
|
||
export as namespace gamedig; | ||
export * from "./index.cjs"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters