ServerQueryData Structure

From Garry's Mod
Revision as of 16:44, 9 August 2016 by Willox (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Used for serverlist.Query.

Type Name Description
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"
  • "lan"
number AppID

Steam application ID to get the servers for

Default: 4000

function Callback

Called when a new server is found and queried. Arguments:
number ping - Latency to the server.
string name - Name of the server
string desc - "Nice" gamemode name
string map - Current map
number players - Total player number ( bot + human )
number maxplayers - Maximum reported amount of players
number botplayers - Amount of bots on the server
boolean pass - Whether this server has password or not
number lastplayed - Time when you last played on this server, as UNIX timestamp or 0
string address - IP Address of the server
string gamemode - Gamemode folder name
number workshopid - Gamemode Steam Workshop ID

Return false to stop the query.

function Finished

Called when the query is finished. No arguments

Personal tools