Garry's Mod Wiki

ServerQueryData

Description

Used for serverlist.Query.

Members

string GameDir
The game directory to get the servers for

Default: "garrysmod"

string Type
Type of servers to retrieve. Valid values are internet, favorite, history and lan
number AppID
Steam application ID to get the servers for

Default: 4000

function Callback
Called when a new server is found and queried.
Function argument(s):
1 number ping - Latency to the server.
2 string name - Name of the server
3 string desc - "Nice" gamemode name
4 string map - Current map
5 number players - Total player number ( bot + human )
6 number maxplayers - Maximum reported amount of players
7 number botplayers - Amount of bots on the server
8 boolean pass - Whether this server has password or not
9 number lastplayed - Time when you last played on this server, as UNIX timestamp or 0
10 string address - IP Address of the server
11 string gamemode - Gamemode folder name
12 number workshopid - Gamemode Steam Workshop ID
13 boolean isanon - Is the server signed into an anonymous account?
14 string version - Version number, same format as jit.version_num
15 string localization - Two digit country code, us if nil
16 string gmcategory - Category of the gamemode, ex. pvp, pve, rp or roleplay
Function return value(s):
1 boolean stop - Return false to stop the query.
function CallbackFailed
Called if the query has failed, called with the servers IP Address
function Finished
Called when the query is finished. No arguments