diff options
| author | auric <auric@japegames.com> | 2026-02-21 15:11:51 -0600 |
|---|---|---|
| committer | auric <auric@japegames.com> | 2026-02-21 15:11:51 -0600 |
| commit | 52f92ea70f74008d82d21fef5085fb7380314ea1 (patch) | |
| tree | 357ec1f0ec75779fc945d3b7460e976fe677ae31 /src/console/a2s.h | |
| parent | af012ffe7594350021741c62bd1205b65dfec07f (diff) | |
| parent | fc10d8a0818bb87001a64a72552ed28fe60931ee (diff) | |
Merge pull request #2 from ihateamongus/claude/trusting-dirac
State probing overhaul, A2S queries, tail/broadcast, bot audit log
Diffstat (limited to 'src/console/a2s.h')
| -rw-r--r-- | src/console/a2s.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/console/a2s.h b/src/console/a2s.h new file mode 100644 index 0000000..c96e445 --- /dev/null +++ b/src/console/a2s.h @@ -0,0 +1,27 @@ +#ifndef A2S_H +#define A2S_H + +#include <stdint.h> + +/* + * A2S_INFO query (Valve Source engine query protocol). + * Retrieves server information over UDP. + * + * Only used for units with health.type == HEALTH_A2S. + */ + +typedef struct { + int players; /* current player count */ + int max_players; /* server player limit */ + char map[64]; /* current map name */ +} A2SInfo; + +/* + * a2s_query: Send an A2S_INFO request and parse the response. + * + * Returns 0 on success with *out populated. + * Returns -1 on timeout, parse error, or any network failure. + */ +int a2s_query(const char *host, uint16_t port, int timeout_ms, A2SInfo *out); + +#endif /* A2S_H */ |
