Skip to content

Configuration v3

Austin Bischoff edited this page Jan 10, 2017 · 8 revisions

GameQ v3 Configuration

Server Settings

Settings available when adding a server (i.e. \GameQ\GameQ::addServer()), items in bold are required.

  • type - The type of game server (i.e the protocol).
  • host - The ip:port of the server. Port is the server's client port and is required. Valid host values: some.hostname.tld:27015, 127.0.0.1:27015, [::1]:27015. Note that IPv6 host addresses must be included in square brackets.
  • id - This is a unique string that gives you the ability to pull out the server information directly from the result set without having to iterate. If this is omitted the information passed in host will be used.
  • options - This is an array of key => value pairs that define specific options for that specific server.
    • query_port - Sets the query port to be used instead of the calculated query port. Useful if the query port is configurable by the server. Required when querying Teamspeak 2 & 3 servers.

Options

These options are set using the \GameQ\GameQ::setOption() method and are applied to all servers within that instance of GameQ.

General Settings

  • debug - Default: false. When true an exception is thrown if there is an error with any of the servers being queried. When false any server specific exceptions are ignored and that server is assumed to be offline and returned as such.
  • timeout - Default: 3 (seconds). Amount of time a server has to respond to a connection or query before assuming the server is offline.

Advanced Settings

  • capture_packets_file - Default: null. This should be a path to a file where raw responses from server queries are saved. This setting is used when building tests for protocol classes. Probably shouldn't set this value unless you are building tests.
  • stream_timeout - Default: 200000 (microseconds). This setting affects how long the stream_select() waits to listen for response data before allowing the script to continue. Decreasing this value can speed up large lists but increases the amount of CPU usage the script uses. This value should be larger than the server with the largest ping time otherwise you may not receive a query response for slower responding servers.
  • write_wait - Default: 500 (microseconds). This setting affects how long the script will pause between writing packets to the server sockets. Lowering this value increases speed but also cpu usage. Setting this value very low (i.e. 0) can help with the speed of processing a large list of servers.

Filters

Filters are applied using the \GameQ\GameQ::addFilter() method and are applied to every server within that instance of GameQ.

Available Filters

  • normalize - Normalize all of the common data across game servers. For example this filter will always return keys such as gq_online, gq_address, gq_hostname, etc...
  • secondstohuman - Will add additional keys to the result containing a human readable version of the time (i.e. hh:mm:ss). This filter can be applied to any integer or float response but the default is 'time'. If 'time' is found it will make a new key in the same array 'gq_time_human' with the converted value.
  • stripcolors - Used to strip special characters in a player's name which changes the color of the text within the actual game. Mainly found in Quake and Unreal based games. When this filter is applied it returns the player's name without the color codes.