-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
54 lines (47 loc) · 1.07 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
export enum E_SAMPQUERY_PACKET_TYPE {
INFORMATION_QUERY_PACKET = 0x69,
RULES_QUERY_PACKET = 0x72,
DETAILED_QUERY_PACKET = 0x64,
CLIENTLIST_QUERY_PACKET = 63,
RCON_QUERY_PACKET = 0x78
}
export enum E_SAMPQUERY_ERROR {
NONE = 0,
SOCKET_ERROR = 1,
INVALID_HOST = 2,
INVALID_PACKET_LEN = 3,
INVALID_RCON_PASSWORD = 4
}
export interface IServerAddress {
ipaddress: string;
port: number;
rconpassword?: string;
}
export interface IInformationPacket {
isPassworded : boolean,
maxPlayers : number,
playerCount : number,
hostname : string,
gamemode : string,
language : string
};
export interface IRulesPacket {
ruleName: string,
ruleValue: string
};
export interface IDetailedPacket {
playerId: number,
playerName: string,
playerScore: number,
playerPing: number
};
export interface IClientListPacket {
name: string,
score: number
};
export interface IError {
errorID: E_SAMPQUERY_ERROR,
data: string
}
export const incomming_packet_len = 11;
export const outgoing_packet_len = 512;