summaryrefslogtreecommitdiff
path: root/src/console/a2s.h
diff options
context:
space:
mode:
authorauric <auric@japegames.com>2026-02-21 15:11:51 -0600
committerauric <auric@japegames.com>2026-02-21 15:11:51 -0600
commit52f92ea70f74008d82d21fef5085fb7380314ea1 (patch)
tree357ec1f0ec75779fc945d3b7460e976fe677ae31 /src/console/a2s.h
parentaf012ffe7594350021741c62bd1205b65dfec07f (diff)
parentfc10d8a0818bb87001a64a72552ed28fe60931ee (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.h27
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 */