My program doesn't have bugs. It just develops random features.

Legacy:UT Server Query

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Introduction

UT makes use of the so called GameSpy Query Protocol to return status information to be used by the in-game browser or 3rd party server browsers.

The server query system uses. just like the game protocol. Wikipedia:UDP. This is an unreliable protocol, meaning packets might get lost during transmission.

UT listens on the port gameport+1 (7778 by default) for GameSpy Query commands.

Below is a list of commands that are accepted by UT. The field seperator is the backslash. The returns always consists out of a set of \name\value elements.

Requests often end with \queryid\[number.number]\final\, if you encounter the \final\ the last piece of the request has been send. But don't rely on the \final\. It may not be received at all.

Note: I've broken down the replies for readability. The actual replies do not have newlines in them.

Query commands

\basic\

This returns basic server information, mainly for recognition.

\gamename\[game name]
\gamever\[Level.EngineVersion]
\minnetver\[Level.MinNetVersion]
\location\[Level.Game.GameReplicationInfo.Region]

The game name is always ut for UT

The regional location is one of the following:

  1. No Region Specified (any Region)
  2. Southeast US
  3. Western US
  4. Midwest US
  5. Northwest US, West Canada
  6. Northeast US, East Canada
  7. United Kingdom
  8. Continental Europe
  9. Central Asia, Middle East
  10. Southeast Asia, Pacific
  11. Africa
  12. Australia / NZ / Pacific
  13. Central, South America

Usual the server admin has not set their location, so it's usualy 0

\info\

Information about the current game running on the server

\hostname\[Level.Game.GameReplicationInfo.ServerName]
\hostport\[game port]
\maptitle\[Level.title]
\mapname\[file name without extention]
\gametype\[Level.Game.Class]
\numplayers\[Level.Game.NumPlayers]
\maxplayers\[Level.Game.MaxPlayers]
\gamemode\openplaying
\gamever\[Level.EngineVersion]
\minnetver\[Level.MinNetVersion]
\worldlog\[world logging enabled and working]
\wantworldlog\[world logging enabled]
...

Game mode is always openplaying

More replies can be added here by various game types, this should not contain game type settings. Check the GetInfo(); function in the game type for additions

\rules\

Setting for the current game, the rules

\mutators\[comma seperated list]
\listenserver\[is a listen server/non dedicated server]
\password\[true or false]
...
\AdminName\[Level.Game.GameReplicationInfo.AdminName]
\AdminEMail\[Level.Game.GameReplicationInfo.AdminEmail]

The return sets of rules depends on the running game type.

Check the GetRules(); function in the game type for additions.

A CTFGame would return the following additional values:

\timelimit\[Timelimit]
\goalteamscore\[GoalTeamScore]
\minplayers\[MinPlayers]
\changelevels\[bChangeLevels]
\maxteams\[MaxTeams]
\balanceteams\[bBalanceTeams]
\playerbalanceteams\[bPlayersBalanceTeams]
\friendlyfire\[percentage]
\gamestype\[Turbo or Hardcore or Classic]
\botskill\[class'ChallengeBotInfo'.default.Skills[Difficulty]]

\players\

Returns information about each player on the server. The # in the names below is the player number

\player_#\[PlayerReplicationInfo.PlayerName]
\frags_#\[PlayerReplicationInfo.Score]
\ping_#\[player ping]
\team_#\[PlayerReplicationInfo.Team]
\mesh_#\[Player mesh]
\skin_#\[Player skin]
\face_#\[Player face]
\ngsecret_#\[bot or true or false]

ngsecret defines if the player has a ngStats password set

\status\

This is a shorthand for \basic\\info\\rules\\players\

\echo\

This command requires a argument, the argument will be returned.

For example when you send:

\echo\this is a test

the following will be returned:

\echo_replay\this is a test

Note: the name of the reply can be diffirent, it could be \echo\, \echo_reply\, \ignored\ or something else.

\level_property\

This will return the value of the argument passed to it.

For example:

\level_property\Title

will return

\Title\[Level.Title]

\game_property\

This works just like \level_property\ except it will return values of Level.Game

\player_property\

This will return a the value of a PlayerPawn variable, for each PlayerPawn on the server.

Tricks

You can combine commands in a single query:

\basic\\info\\rules\

But watch out, when the last command is invalid you might not get a single result. A nice trick to get around this problem is to always append \echo\something at the end.

This allows you to use 3rd party commands that might have been added by a mod.

Related documents