-
-
Notifications
You must be signed in to change notification settings - Fork 1
Global Options
Home · Performance · Troubleshooting
Global options apply to every server in one GameQ instance:
$gameQ
->setOption('timeout', 5)
->setOption('max_servers_per_batch', 25);The legacy property syntax remains available, but setOption() is clearer for new code:
$gameQ->timeout = 5;| Option | Default | Unit | Purpose |
|---|---|---|---|
debug |
false |
— | Rethrow handled query and protocol errors instead of converting the affected query to an offline result. |
timeout |
3 |
seconds | Overall connection/query allowance passed to socket operations. |
stream_timeout |
200000 |
microseconds |
stream_select() polling interval while responses are collected. |
write_wait |
500 |
microseconds | Pause between packet writes to reduce CPU and packet bursts. |
max_servers_per_batch |
50 |
servers | Maximum number of servers processed concurrently in one batch. Values below one behave as one. |
max_follow_up_rounds |
64 |
rounds | Safety limit for response-driven pagination and additional query rounds. Zero disables follow-up rounds. |
capture_packets_file |
null |
path | Write raw responses to a file for protocol fixture development. |
Integer options accept integers and numeric strings. Other types raise InvalidArgumentException when the option is consumed. Use positive values for timeout and interval settings.
use GameQ\Exception\ProtocolException;
use GameQ\Exception\QueryException;
$gameQ->setOption('debug', true);
try {
$results = $gameQ->process();
} catch (ProtocolException | QueryException $exception) {
error_log($exception->getMessage());
}Debug mode is intended for diagnosis and tests. Some validation and protocol-preparation failures necessarily bubble up regardless of this option, so production integrations should still handle GameQ exceptions around addServer() and process().
Do not display exception messages or packet data directly to untrusted users.
capture_packets_file supports the fixture-building workflow and is best used with one server at a time:
$gameQ
->setOption('debug', true)
->setOption('capture_packets_file', __DIR__ . '/response.bin');The file can contain binary data, server metadata, player information, or protocol-specific secrets. Store it outside the web root, restrict its permissions, and inspect it before sharing. The fixture generator automates the normal test workflow.
$options = $gameQ->getOptions();
$servers = $gameQ->getServers();Treat these as runtime configuration snapshots. Prefer documented setters to mutating internal objects.
Getting started
Configuration
Guides
Reference
Development
Migration