Skip to content

Navigation Menu

Sign in
Sign up

A2S_RULES

Binary edited this page Oct 30, 2022 · 3 revisions

Synopsis

Structure reflecting the response of an A2S_RULES query.

Example

#include <ssq/a2s.h>
#include <stdio.h>
SSQ_SERVER server;
// ...
uint16_t rule_count = 0;
A2S_RULES *rules = ssq_rules(&server, &rule_count);
if (ssq_server_ok(&server)) {
 for (uint16_t i = 0; i < rule_count; ++i)
 printf("%s = %s\n", rules[i].name, rules[i].value);
 ssq_rules_free(rules, rule_count);
} else {
 // ...
}
// ...

Fields

Identifier Type Description
name char * Name of the rule.
name_len size_t Length of the name string.
value char * Value of the rule.
value_len size_t Length of the value field.

Functions

ssq_rules

Send an A2S_RULES query to a Source game server.

Arguments

Name Type Nullable Description
server SSQ_SERVER * no Source game server to query.
rule_count uint16_t * no Number of rules in the response.

Return value

Returns NULL when an error occurs, otherwise returns an A2S_RULES structure array of size *rule_count containing the rules the server is using.

Notes

⚠️ The A2S_RULES structure array must be freed with ssq_rules_free when done using it.

⚠️ When an error occurs, it must be cleared with ssq_server_err_clr when done handling it.

ssq_rules_free

Free an A2S_RULES structure array.

Arguments

Name Type Nullable Description
rules A2S_RULES * no A2S_RULES structure array to free.
rule_count uint16_t Number of rules in the array.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /