Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
|
enum | ac_serverbyte_t {
ACS_BAD,
ACS_CLIENTACK,
ACS_VIOLATION,
ACS_NOACCESS,
ACS_FILE_VIOLATION,
ACS_READY,
ACS_QUERYREPLY,
ACS_PONG,
ACS_UPDATE_REQUIRED,
ACS_DISCONNECT,
ACS_ERROR
} |
|
enum | ac_clientbyte_t {
ACC_BAD,
ACC_VERSION,
ACC_PREF,
ACC_REQUESTCHALLENGE,
ACC_CLIENTDISCONNECT,
ACC_QUERYCLIENT,
ACC_PING,
ACC_UPDATECHECKS,
ACC_SETPREFERENCES
} |
|
enum | ac_opcode_t {
OP_INVALID,
OP_EQUAL,
OP_NEQUAL,
OP_GTEQUAL,
OP_LTEQUAL,
OP_LT,
OP_GT,
OP_STREQUAL,
OP_STRNEQUAL,
OP_STRSTR
} |
|
enum | ac_client_t {
AC_CLIENT_R1Q2 = 0x01,
AC_CLIENT_EGL = 0x02,
AC_CLIENT_APRGL = 0x04,
AC_CLIENT_APRSW = 0x08,
AC_CLIENT_Q2PRO = 0x10
} |
|
|
static | LIST_DECL (ac_required_list) |
|
static | LIST_DECL (ac_exempt_list) |
|
static char * | AC_SimpleParse (char **data_p, size_t *len_p) |
|
static void | AC_ParseHash (char *data, int linenum, const char *path) |
|
static void | AC_ParseCvar (char *data, int linenum, const char *path) |
|
static void | AC_ParseToken (char *data, int linenum, const char *path) |
|
static qboolean | AC_ParseFile (const char *path, ac_parse_t parse, int depth) |
|
static void | AC_LoadChecks (void) |
|
static void | AC_FreeChecks (void) |
|
static void | AC_Retry (void) |
|
static void | AC_Drop (void) |
|
static void | AC_Disable (void) |
|
static void | AC_Announce (client_t *client, const char *fmt,...) |
|
static client_t * | AC_ParseClient (void) |
|
static void | AC_ParseViolation (void) |
|
static void | AC_ParseClientAck (void) |
|
static void | AC_ParseFileViolation (void) |
|
static void | AC_ParseReady (void) |
|
static void | AC_ParseQueryReply (void) |
|
static void | AC_ParseDisconnect (void) |
|
static void | AC_ParseError (void) |
|
static qboolean | AC_ParseMessage (void) |
|
static void | AC_Write (const char *func) |
|
static void | AC_ClientQuery (client_t *cl) |
|
qboolean | AC_ClientBegin (client_t *cl) |
|
void | AC_ClientAnnounce (client_t *cl) |
|
char * | AC_ClientConnect (client_t *cl) |
|
void | AC_ClientDisconnect (client_t *cl) |
|
void | AC_ClientToken (client_t *cl, const char *token) |
|
static void | AC_Spin (void) |
|
static qboolean | AC_Flush (void) |
|
static void | AC_WriteString (const char *s) |
|
static void | AC_SendChecks (void) |
|
static void | AC_SendPrefs (void) |
|
static void | AC_SendPing (void) |
|
static void | AC_SendHello (void) |
|
static void | AC_CheckTimeouts (void) |
|
static qboolean | AC_Reconnect (void) |
|
void | AC_Run (void) |
|
void | AC_Connect (unsigned mvd_spawn) |
|
void | AC_Disconnect (void) |
|
void | AC_List_f (void) |
|
void | AC_Info_f (void) |
|
static void | AC_Invalidate_f (void) |
|
static void | AC_Update_f (void) |
|
static void | AC_AddException_f (void) |
|
static void | AC_DelException_f (void) |
|
static void | AC_ListExceptions_f (void) |
|
static void | AC_AddRequirement_f (void) |
|
static void | AC_DelRequirement_f (void) |
|
static void | AC_ListRequirements_f (void) |
|
static void | ac_disable_play_changed (cvar_t *self) |
|
void | AC_Register (void) |
|
◆ AC_CVARS_NAME
#define AC_CVARS_NAME "anticheat-cvars.txt" |
Definition at line 169 of file ac.c.
◆ AC_DEFAULT_BACKOFF
#define AC_DEFAULT_BACKOFF 30 |
Definition at line 118 of file ac.c.
◆ AC_HASHES_NAME
#define AC_HASHES_NAME "anticheat-hashes.txt" |
Definition at line 168 of file ac.c.
◆ AC_MAX_INCLUDES
#define AC_MAX_INCLUDES 16 |
Definition at line 172 of file ac.c.
◆ AC_MESSAGE
#define AC_MESSAGE "\220\xe1\xee\xf4\xe9\xe3\xe8\xe5\xe1\xf4\221 " |
Definition at line 123 of file ac.c.
◆ AC_PING_INTERVAL
#define AC_PING_INTERVAL 60000 |
Definition at line 120 of file ac.c.
◆ AC_PING_TIMEOUT
#define AC_PING_TIMEOUT 15000 |
Definition at line 121 of file ac.c.
◆ AC_PROTOCOL_VERSION
#define AC_PROTOCOL_VERSION 0xAC03 |
Definition at line 116 of file ac.c.
◆ AC_RECV_SIZE
#define AC_RECV_SIZE 1024 |
Definition at line 126 of file ac.c.
◆ AC_SEND_SIZE
#define AC_SEND_SIZE 131072 |
Definition at line 125 of file ac.c.
◆ AC_TOKENS_NAME
#define AC_TOKENS_NAME "anticheat-tokens.txt" |
Definition at line 170 of file ac.c.
◆ ACH_NEGATIVE
#define ACH_NEGATIVE (1 << 1) |
Definition at line 114 of file ac.c.
◆ ACH_REQUIRED
#define ACH_REQUIRED (1 << 0) |
Definition at line 113 of file ac.c.
◆ ACP_BLOCKPLAY
#define ACP_BLOCKPLAY (1 << 0) |
Definition at line 111 of file ac.c.
◆ ac_cvar_t
◆ ac_file_t
◆ ac_parse_t
typedef void(* ac_parse_t) (char *, int, const char *) |
Definition at line 174 of file ac.c.
◆ ac_client_t
Enumerator |
---|
AC_CLIENT_R1Q2 | |
AC_CLIENT_EGL | |
AC_CLIENT_APRGL | |
AC_CLIENT_APRSW | |
AC_CLIENT_Q2PRO | |
Definition at line 64 of file ac.c.
◆ ac_clientbyte_t
Enumerator |
---|
ACC_BAD | |
ACC_VERSION | |
ACC_PREF | |
ACC_REQUESTCHALLENGE | |
ACC_CLIENTDISCONNECT | |
ACC_QUERYCLIENT | |
ACC_PING | |
ACC_UPDATECHECKS | |
ACC_SETPREFERENCES | |
Definition at line 39 of file ac.c.
◆ ac_opcode_t
Enumerator |
---|
OP_INVALID | |
OP_EQUAL | |
OP_NEQUAL | |
OP_GTEQUAL | |
OP_LTEQUAL | |
OP_LT | |
OP_GT | |
OP_STREQUAL | |
OP_STRNEQUAL | |
OP_STRSTR | |
Definition at line 51 of file ac.c.
◆ ac_serverbyte_t
Enumerator |
---|
ACS_BAD | |
ACS_CLIENTACK | |
ACS_VIOLATION | |
ACS_NOACCESS | |
ACS_FILE_VIOLATION | |
ACS_READY | |
ACS_QUERYREPLY | |
ACS_PONG | |
ACS_UPDATE_REQUIRED | |
ACS_DISCONNECT | |
ACS_ERROR | |
Definition at line 25 of file ac.c.
◆ AC_AddException_f()
◆ AC_AddRequirement_f()
static void AC_AddRequirement_f |
( |
void |
| ) |
|
|
static |
◆ AC_Announce()
static void AC_Announce |
( |
client_t * |
client, |
|
|
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
static |
Definition at line 571 of file ac.c.
574 char string[MAX_STRING_CHARS];
577 va_start(argptr, fmt);
578 len =
Q_vsnprintf(
string,
sizeof(
string), fmt, argptr);
581 if (len >=
sizeof(
string)) {
582 Com_WPrintf(
"%s: overflow\n", __func__);
589 MSG_WriteData(
string, len + 1);
Referenced by AC_ParseFileViolation(), and AC_ParseViolation().
◆ AC_CheckTimeouts()
Definition at line 1323 of file ac.c.
1329 Com_Printf(
"ANTICHEAT: Server ping timeout, disconnecting.\n");
1343 if (
cl->ac_query_sent != AC_QUERY_SENT) {
1347 Com_WPrintf(
"ANTICHEAT: Query timed out for %s, possible network problem.\n",
cl->name);
1348 cl->ac_valid = qfalse;
Referenced by AC_Run().
◆ AC_ClientAnnounce()
Definition at line 1070 of file ac.c.
1078 if (
cl->ac_required == AC_EXEMPT) {
1080 "%s is exempt from using anticheat.\n",
cl->name);
1081 }
else if (
cl->ac_valid) {
1082 if (
cl->ac_file_failures) {
1084 "%s failed %d file check%s.\n",
1085 cl->name,
cl->ac_file_failures,
1086 cl->ac_file_failures == 1 ?
"" :
"s");
1090 "%s is not using anticheat.\n",
cl->name);
Referenced by SV_Begin_f().
◆ AC_ClientBegin()
qboolean AC_ClientBegin |
( |
client_t * |
cl | ) |
|
Definition at line 1020 of file ac.c.
1026 if (
cl->ac_required == AC_EXEMPT) {
1034 if (
cl->ac_query_sent == AC_QUERY_UNSENT &&
ac.
ready) {
1039 if (
cl->ac_required != AC_REQUIRED) {
1046 Com_Printf(
"ANTICHEAT: Rejected connecting client %s[%s], "
1047 "no anticheat response.\n",
cl->name,
1060 Com_Printf(
"ANTICHEAT: Rejected connecting client %s[%s], "
1061 "no connection to anticheat server.\n",
cl->name,
1064 "This server is unable to take new connections right now. "
1065 "Please try again later.\n");
Referenced by SV_Begin_f().
◆ AC_ClientConnect()
Definition at line 1094 of file ac.c.
1101 cl->ac_required = AC_EXEMPT;
1107 cl->ac_required = AC_REQUIRED;
1109 cl->ac_required = AC_NORMAL;
1111 cl->ac_required = AC_REQUIRED;
Referenced by send_connect_packet().
◆ AC_ClientDisconnect()
◆ AC_ClientQuery()
◆ AC_ClientToken()
Definition at line 1143 of file ac.c.
1145 string_entry_t *tok;
1152 for (tok =
acs.
tokens; tok; tok = tok->next) {
1153 if (!strcmp(tok->string, token)) {
1164 if (
other->ac_token == tok->string) {
1170 "ANTICHEAT: %s bypassed anticheat requirements with token '%s'\n",
1171 cl->name, tok->string);
1172 cl->ac_token = tok->string;
1173 cl->ac_required = AC_EXEMPT;
Referenced by SV_CvarResult_f().
◆ AC_Connect()
void AC_Connect |
( |
unsigned |
mvd_spawn | ) |
|
Definition at line 1437 of file ac.c.
1447 Com_Printf(
"ANTICHEAT: Only supported on dedicated servers, disabling.\n");
1453 Com_Printf(
"ANTICHEAT: Only supported on game servers, disabling.\n");
1460 Com_Printf(
"ANTICHEAT: Attempting to connect to %s...\n",
ac_server_address->string);
1469 for (attempts = 0; attempts < 50; attempts++) {
1476 Com_WPrintf(
"ANTICHEAT: Still not ready, resuming server initialization.\n");
Referenced by SV_InitGame().
◆ AC_DelException_f()
◆ AC_DelRequirement_f()
static void AC_DelRequirement_f |
( |
void |
| ) |
|
|
static |
◆ AC_Disable()
◆ ac_disable_play_changed()
static void ac_disable_play_changed |
( |
cvar_t * |
self | ) |
|
|
static |
◆ AC_Disconnect()
◆ AC_Drop()
Definition at line 525 of file ac.c.
532 Com_Printf(
"ANTICHEAT: Server connection failed.\n");
539 cl->ac_valid = qfalse;
540 cl->ac_file_failures = 0;
546 "This server has lost the connection to the anticheat server. "
547 "Any anticheat clients are no longer valid.\n");
551 "You will need to reconnect once the server has "
552 "re-established the anticheat connection.\n");
559 Com_WPrintf(
"ANTICHEAT: Lost connection to anticheat server!\n");
562 memset(&
ac, 0,
sizeof(
ac));
Referenced by AC_CheckTimeouts(), AC_ParseMessage(), and AC_Run().
◆ AC_Flush()
static qboolean AC_Flush |
( |
void |
| ) |
|
|
static |
◆ AC_FreeChecks()
◆ AC_Info_f()
Definition at line 1549 of file ac.c.
1552 string_entry_t *bad;
1553 char *substring, *filesubstring;
1557 Com_Printf(
"No server running.\n");
1562 Com_Printf(
"The anticheat module is not in use on this server.\n"
1563 "For information on anticheat, please visit http://antiche.at/\n");
1569 Com_Printf(
"Usage: %s [substring|id] [filesubstring]\n",
Cmd_Argv(0));
1579 clientID = atoi(substring);
1581 Com_Printf(
"Invalid client ID.\n");
1586 Com_Printf(
"Player is not active.\n");
1594 if (strstr(
cl->name, substring)) {
1598 Com_Printf(
"Player not found.\n");
1604 if (!
cl->ac_valid) {
1605 Com_Printf(
"%s is not using anticheat.\n",
cl->name);
1609 if (
cl->ac_bad_files) {
1610 Com_Printf(
"File check failures for %s:\n",
cl->name);
1611 for (bad =
cl->ac_bad_files; bad; bad = bad->next) {
1612 if (!filesubstring[0] || strstr(bad->string, filesubstring)) {
1613 Com_Printf(
"%s\n", bad->string);
1617 Com_Printf(
"%s has no file check failures.\n",
cl->name);
Referenced by SV_AC_Info_f().
◆ AC_Invalidate_f()
Definition at line 1621 of file ac.c.
1626 Com_Printf(
"No server running.\n");
1630 Com_Printf(
"Anticheat is not ready.\n");
1640 Com_Printf(
"All clients marked as invalid.\n");
◆ AC_List_f()
Definition at line 1490 of file ac.c.
1497 Com_Printf(
"No server running.\n");
1502 Com_Printf(
"The anticheat module is not in use on this server.\n"
1503 "For information on anticheat, please visit http://antiche.at/\n");
1510 "+----------------+--------+-----+------+\n"
1511 "| Player Name |AC Valid|Files|Client|\n"
1512 "+----------------+--------+-----+------+\n");
1519 if (*sub && !strstr(
cl->name, sub)) {
1523 if (
cl->ac_required == AC_EXEMPT) {
1524 Com_Printf(
"|%-16s| exempt | N/A | N/A |\n",
cl->name);
1525 }
else if (
cl->ac_valid) {
1526 i =
cl->ac_client_type;
1530 Com_Printf(
"|%-16s| yes | %3d |%-6s|\n",
cl->name,
1533 Com_Printf(
"|%-16s| NO | N/A | N/A |\n",
cl->name);
1537 Com_Printf(
"+----------------+--------+-----+------+\n");
1544 "This Quake II server is %sconnected to the anticheat server.\n"
1545 "For information on anticheat, please visit http://antiche.at/\n",
Referenced by SV_AC_List_f().
◆ AC_ListExceptions_f()
static void AC_ListExceptions_f |
( |
void |
| ) |
|
|
static |
◆ AC_ListRequirements_f()
static void AC_ListRequirements_f |
( |
void |
| ) |
|
|
static |
◆ AC_LoadChecks()
Definition at line 450 of file ac.c.
454 "not using any file checks.\n");
457 Com_Printf(
"ANTICHEAT: No file hashes were loaded, "
467 "not using any cvar checks.\n");
469 Com_Printf(
"ANTICHEAT: No cvar checks were loaded, "
Referenced by AC_Connect(), and AC_Update_f().
◆ AC_ParseClient()
◆ AC_ParseClientAck()
Definition at line 711 of file ac.c.
721 Com_DPrintf(
"ANTICHEAT: Message too short in %s\n", __func__);
726 Com_DPrintf(
"ANTICHEAT: %s with client in state %d\n",
727 __func__,
cl->state);
731 Com_DPrintf(
"ANTICHEAT: %s for %s\n", __func__,
cl->name);
733 cl->ac_valid = qtrue;
Referenced by AC_ParseMessage().
◆ AC_ParseCvar()
static void AC_ParseCvar |
( |
char * |
data, |
|
|
int |
linenum, |
|
|
const char * |
path |
|
) |
| |
|
static |
Definition at line 288 of file ac.c.
290 char *values[256], *p;
292 char *name, *opstr, *val, *def;
293 size_t len, namelen, vallen, deflen;
300 Com_WPrintf(
"ANTICHEAT: Incomplete line %d in %s\n", linenum, path);
305 Com_WPrintf(
"ANTICHEAT: Incomplete line %d in %s\n", linenum, path);
310 Com_WPrintf(
"ANTICHEAT: Incomplete line %d in %s\n", linenum, path);
315 if (namelen < 1 || namelen >= 64) {
316 Com_WPrintf(
"ANTICHEAT: Invalid cvar name length on line %d in %s\n", linenum, path);
319 if (deflen < 1 || deflen >= 64) {
320 Com_WPrintf(
"ANTICHEAT: Invalid default value length on line %d in %s\n", linenum, path);
325 if (!strcmp(opstr, op->
str)) {
330 Com_WPrintf(
"ANTICHEAT: Unknown opcode '%s' on line %d in %s\n", opstr, linenum, path);
337 Com_WPrintf(
"ANTICHEAT: Too many values for opcode '%s' on line %d in %s\n", opstr, linenum, path);
341 Com_WPrintf(
"ANTICHEAT: Empty value on line %d in %s\n", linenum, path);
344 p = strchr(val,
',');
350 Com_WPrintf(
"ANTICHEAT: Too long value on line %d in %s\n", linenum, path);
353 values[num_values] = val;
354 lengths[num_values++] = (byte)(len + 1);
361 Z_TagReserve(
sizeof(*cvar) + num_values *
sizeof(
char *) +
362 namelen + 1 + deflen + 1 + vallen + 1, TAG_SERVER);
366 memcpy(cvar->
name, name, namelen + 1);
368 memcpy(cvar->
def, def, deflen + 1);
370 for (i = 0; i < num_values; i++) {
372 memcpy(cvar->
values[i], values[i], lengths[i]);
Referenced by AC_LoadChecks().
◆ AC_ParseDisconnect()
Definition at line 875 of file ac.c.
881 Com_Printf(
"ANTICHEAT: Dropping %s, disconnect message.\n",
cl->name);
Referenced by AC_ParseMessage().
◆ AC_ParseError()
Definition at line 886 of file ac.c.
888 char string[MAX_STRING_CHARS];
891 Com_EPrintf(
"ANTICHEAT: %s\n",
string);
Referenced by AC_ParseMessage().
◆ AC_ParseFile()
static qboolean AC_ParseFile |
( |
const char * |
path, |
|
|
ac_parse_t |
parse, |
|
|
int |
depth |
|
) |
| |
|
static |
Definition at line 391 of file ac.c.
393 char *raw, *data, *p;
397 ret = FS_LoadFile(path, (
void **)&raw);
399 if (ret != Q_ERR_NOENT || depth) {
400 Com_WPrintf(
"ANTICHEAT: Could not %s %s: %s\n",
408 p = strchr(data,
'\n');
410 if (p > data && *(p - 1) ==
'\r') {
422 if (!strncmp(data + 1,
"include ", 8)) {
424 Com_WPrintf(
"ANTICHEAT: Includes too deeply nested.\n");
429 Com_WPrintf(
"ANTICHEAT: Unknown directive %s on line %d in %s\n", data + 1, linenum, path);
433 parse(data, linenum, path);
Referenced by AC_LoadChecks().
◆ AC_ParseFileViolation()
static void AC_ParseFileViolation |
( |
void |
| ) |
|
|
static |
Definition at line 736 of file ac.c.
740 char path[MAX_QPATH];
741 char hash[MAX_QPATH];
752 Com_DPrintf(
"ANTICHEAT: Message too short in %s\n", __func__);
757 if (pathlen >=
sizeof(path)) {
758 Com_WPrintf(
"ANTICHEAT: Oversize path in %s\n", __func__);
759 pathlen =
sizeof(path) - 1;
765 strcpy(hash,
"no hash?");
768 cl->ac_file_failures++;
772 if (!strcmp(f->
path, path)) {
780 Com_Printf(
"ANTICHEAT FILE VIOLATION: %s[%s] has a modified %s [%s]\n",
788 "Your file %s has been modified. "
789 "Please replace it with a known valid copy.\n", path);
808 AC_Announce(
cl,
"%s was kicked for too many modified files\n",
cl->name);
814 memcpy(bad->string, path, pathlen + 1);
815 bad->next =
cl->ac_bad_files;
816 cl->ac_bad_files = bad;
Referenced by AC_ParseMessage().
◆ AC_ParseHash()
static void AC_ParseHash |
( |
char * |
data, |
|
|
int |
linenum, |
|
|
const char * |
path |
|
) |
| |
|
static |
Definition at line 223 of file ac.c.
226 size_t pathlen, hashlen;
239 Com_WPrintf(
"ANTICHEAT: Incomplete line %d in %s\n", linenum, path);
244 if (pathlen < 1 || pathlen >= MAX_QPATH) {
245 Com_WPrintf(
"ANTICHEAT: Invalid quake path length on line %d in %s\n", linenum, path);
248 if (strchr(pstr,
'\\') || !Q_isalnum(pstr[0])) {
249 Com_WPrintf(
"ANTICHEAT: Malformed quake path on line %d in %s\n", linenum, path);
255 Com_WPrintf(
"ANTICHEAT: Malformed hash on line %d in %s\n", linenum, path);
259 for (i = 0; i < 20; i++, hstr += 2) {
260 int c1 = Q_charhex(hstr[0]);
261 int c2 = Q_charhex(hstr[1]);
262 if (c1 == -1 || c2 == -1) {
265 hash[i] = (c1 << 4) | c2;
271 if (strstr(data,
"required")) {
274 if (strstr(data,
"negative")) {
279 file =
SV_Malloc(
sizeof(*file) + pathlen);
280 memcpy(file->
hash, hash,
sizeof(file->
hash));
281 memcpy(file->
path, pstr, pathlen + 1);
Referenced by AC_LoadChecks().
◆ AC_ParseMessage()
static qboolean AC_ParseMessage |
( |
void |
| ) |
|
|
static |
Definition at line 895 of file ac.c.
902 if (!FIFO_TryRead(&
ac.
stream.recv, &msglen, 2)) {
908 msglen = LittleShort(msglen);
910 Com_EPrintf(
"ANTICHEAT: Oversize message: %u bytes\n", msglen);
945 Com_WPrintf(
"ANTICHEAT: You do not have permission to "
946 "use the anticheat server. Anticheat disabled.\n");
950 Com_WPrintf(
"ANTICHEAT: The anticheat server is no longer "
951 "compatible with this version of " APPLICATION
". "
952 "Please make sure you are using the latest " APPLICATION
" version. "
953 "Anticheat disabled.\n");
964 Com_EPrintf(
"ANTICHEAT: Unknown command byte %d, please make "
965 "sure you are using the latest " APPLICATION
" version. "
966 "Anticheat disabled.\n", cmd);
972 Com_WPrintf(
"ANTICHEAT: Read %"PRIz
" bytes past end of message %d\n",
Referenced by AC_Run().
◆ AC_ParseQueryReply()
Definition at line 829 of file ac.c.
840 Com_DPrintf(
"ANTICHEAT: Message too short in %s\n", __func__);
847 cl->ac_query_sent = AC_QUERY_DONE;
849 cl->ac_client_type = type;
850 cl->ac_valid = qtrue;
854 Com_WPrintf(
"ANTICHEAT: %s with client in state %d\n",
855 __func__,
cl->state);
860 Com_DPrintf(
"ANTICHEAT: %s for %s\n", __func__,
cl->name);
Referenced by AC_ParseMessage().
◆ AC_ParseReady()
Definition at line 819 of file ac.c.
824 Com_Printf(
"ANTICHEAT: Ready to serve anticheat clients.\n");
826 CVAR_SERVERINFO | CVAR_ROM, FROM_CODE);
Referenced by AC_ParseMessage().
◆ AC_ParseToken()
static void AC_ParseToken |
( |
char * |
data, |
|
|
int |
linenum, |
|
|
const char * |
path |
|
) |
| |
|
static |
Definition at line 380 of file ac.c.
383 size_t len = strlen(data);
386 memcpy(tok->string, data, len + 1);
Referenced by AC_LoadChecks().
◆ AC_ParseViolation()
Definition at line 638 of file ac.c.
642 char clientreason[64];
650 Com_DPrintf(
"ANTICHEAT: Message too short in %s\n", __func__);
669 if (strcmp(reason,
"disconnected")) {
673 Q_snprintf(showreason,
sizeof(showreason),
" (%s)", reason);
678 cl->name, showreason);
680 Com_Printf(
"ANTICHEAT VIOLATION: %s[%s] was kicked: %s\n",
696 Com_Printf(
"ANTICHEAT DISCONNECT: %s[%s] disconnected from "
697 "anticheat server\n",
cl->name,
701 AC_Announce(
cl,
"%s lost connection to anticheat server.\n",
cl->name);
707 "client is no longer valid.\n",
cl->name);
708 cl->ac_valid = qfalse;
Referenced by AC_ParseMessage().
◆ AC_Reconnect()
static qboolean AC_Reconnect |
( |
void |
| ) |
|
|
static |
Definition at line 1358 of file ac.c.
1363 Com_WPrintf(
"ANTICHEAT: Unable to lookup %s.\n",
1369 Com_EPrintf(
"ANTICHEAT: %s to %s.\n",
Referenced by AC_Connect(), and AC_Run().
◆ AC_Register()
Definition at line 1721 of file ac.c.
1727 "This server requires the r1ch.net anticheat module. "
1728 "Please see http://antiche.at/ for more details.", 0);
Referenced by SV_Init().
◆ AC_Retry()
◆ AC_Run()
Definition at line 1388 of file ac.c.
1390 neterr_t ret = NET_AGAIN;
1396 Com_Printf(
"ANTICHEAT: Attempting to reconnect to anticheat server...\n");
1408 if (ret == NET_OK) {
1409 Com_Printf(
"ANTICHEAT: Connected to anticheat server!\n");
1417 if (ret == NET_OK) {
Referenced by AC_Spin(), and SV_Frame().
◆ AC_SendChecks()
◆ AC_SendHello()
◆ AC_SendPing()
◆ AC_SendPrefs()
◆ AC_SimpleParse()
static char* AC_SimpleParse |
( |
char ** |
data_p, |
|
|
size_t * |
len_p |
|
) |
| |
|
static |
◆ AC_Spin()
◆ AC_Update_f()
Definition at line 1643 of file ac.c.
1648 Com_Printf(
"No server running.\n");
1652 Com_Printf(
"Anticheat is not in use.\n");
1665 cl->ac_token = NULL;
1668 Com_Printf(
"Anticheat configuration updated.\n");
◆ AC_Write()
static void AC_Write |
( |
const char * |
func | ) |
|
|
static |
◆ AC_WriteString()
static void AC_WriteString |
( |
const char * |
s | ) |
|
|
static |
Definition at line 1231 of file ac.c.
1233 size_t len = strlen(s);
1240 MSG_WriteData(s, len);
Referenced by AC_SendChecks().
◆ LIST_DECL() [1/2]
static LIST_DECL |
( |
ac_exempt_list |
| ) |
|
|
static |
◆ LIST_DECL() [2/2]
static LIST_DECL |
( |
ac_required_list |
| ) |
|
|
static |
◆ ac
Definition at line 128 of file ac.c.
Referenced by AC_CheckTimeouts(), AC_ClientBegin(), AC_ClientConnect(), AC_ClientDisconnect(), AC_ClientQuery(), AC_Connect(), ac_disable_play_changed(), AC_Disconnect(), AC_Drop(), AC_Flush(), AC_Invalidate_f(), AC_List_f(), AC_ParseMessage(), AC_ParseReady(), AC_Reconnect(), AC_Retry(), AC_Run(), AC_SendPing(), AC_Spin(), AC_Update_f(), AC_Write(), and get_scratch_buffer_size().
◆ ac_badfile_action
cvar_t* ac_badfile_action |
|
static |
◆ ac_badfile_max
◆ ac_badfile_message
cvar_t* ac_badfile_message |
|
static |
◆ ac_client_disconnect_action
cvar_t* ac_client_disconnect_action |
|
static |
◆ ac_clients
const char ac_clients[][8] |
|
static |
Initial value:= {
"???",
"R1Q2",
"EGL",
"Apr GL",
"Apr SW",
"Q2PRO"
}
Definition at line 148 of file ac.c.
Referenced by AC_List_f().
◆ ac_cvarops
◆ ac_disable_play
◆ ac_error_action
◆ ac_message
◆ ac_num_clients
◆ ac_recv_buffer
◆ ac_required
Definition at line 137 of file ac.c.
Referenced by AC_ClientAnnounce(), AC_ClientBegin(), AC_ClientConnect(), AC_ClientToken(), AC_Connect(), AC_Disable(), AC_Drop(), AC_Info_f(), AC_List_f(), AC_ParseReady(), AC_Register(), and AC_Update_f().
◆ ac_send_buffer
◆ ac_server_address
cvar_t* ac_server_address |
|
static |
◆ ac_show_violation_reason
cvar_t* ac_show_violation_reason |
|
static |
◆ acs
Definition at line 129 of file ac.c.
Referenced by AC_ClientToken(), AC_Connect(), AC_Disconnect(), AC_Drop(), AC_FreeChecks(), AC_List_f(), AC_LoadChecks(), AC_ParseCvar(), AC_ParseFileViolation(), AC_ParseHash(), AC_ParseReady(), AC_ParseToken(), AC_Reconnect(), AC_Retry(), AC_Run(), and AC_SendChecks().
◆ c_ac
static void AC_FreeChecks(void)
void * Z_ReservedAlloc(size_t size)
void SV_DelMatch_f(list_t *list)
static void AC_ListRequirements_f(void)
static void AC_ListExceptions_f(void)
static void AC_Write(const char *func)
static qboolean AC_Reconnect(void)
static void AC_ParseFileViolation(void)
static void AC_LoadChecks(void)
neterr_t NET_Connect(const netadr_t *peer, netstream_t *s)
static cvar_t * ac_required
char * NET_AdrToString(const netadr_t *a)
static void AC_WriteString(const char *s)
static void AC_Disable(void)
char hashlist_name[MAX_QPATH]
size_t Com_FormatTimeLong(char *buffer, size_t size, time_t t)
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
static void AC_ParseHash(char *data, int linenum, const char *path)
qboolean FIFO_ReadMessage(fifo_t *fifo, size_t msglen)
static void AC_AddRequirement_f(void)
cvar_t * Cvar_Get(const char *var_name, const char *var_value, int flags)
const char * Q_ErrorString(qerror_t error)
#define AC_DEFAULT_BACKOFF
static void AC_AddException_f(void)
static void AC_ParseQueryReply(void)
static void AC_CheckTimeouts(void)
void NET_UpdateStream(netstream_t *s)
static void AC_Drop(void)
static qboolean AC_Flush(void)
neterr_t NET_RunConnect(netstream_t *s)
static cvar_t * ac_server_address
static void AC_Retry(void)
void NET_CloseStream(netstream_t *s)
size_t Q_vsnprintf(char *dest, size_t size, const char *fmt, va_list argptr)
static cvar_t * ac_disable_play
void SV_ListMatches_f(list_t *list)
static void AC_ParseViolation(void)
void MSG_WriteByte(int c)
static qboolean AC_ParseMessage(void)
static void AC_ParseReady(void)
void SV_ClientAddMessage(client_t *client, int flags)
static void AC_Update_f(void)
char * Q_strchrnul(const char *s, int c)
#define FOR_EACH_CLIENT(client)
static void AC_DelException_f(void)
static qboolean AC_ParseFile(const char *path, ac_parse_t parse, int depth)
static cvar_t * ac_badfile_action
const char * NET_ErrorString(void)
#define AC_PROTOCOL_VERSION
static cvar_t * ac_message
void Cmd_Register(const cmdreg_t *reg)
static void AC_ParseError(void)
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
void Cvar_SetByVar(cvar_t *var, const char *value, from_t from)
static void AC_ParseDisconnect(void)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
static void AC_SendPing(void)
void MSG_WriteShort(int c)
void SV_DropClient(client_t *client, const char *reason)
cvar_t * Cvar_FullSet(const char *var_name, const char *value, int flags, from_t from)
void Z_TagReserve(size_t size, memtag_t tag)
qboolean COM_IsUint(const char *s)
void SV_BroadcastPrintf(int level, const char *fmt,...)
static cvar_t * ac_error_action
static char * AC_SimpleParse(char **data_p, size_t *len_p)
void MSG_WriteLong(int c)
static cvar_t * ac_badfile_message
static void AC_Invalidate_f(void)
static void AC_ClientQuery(client_t *cl)
size_t MSG_ReadString(char *dest, size_t size)
static const int ac_num_clients
static byte ac_recv_buffer[AC_RECV_SIZE]
static void AC_Announce(client_t *client, const char *fmt,...)
static cvar_t * ac_badfile_max
void SV_ClientPrintf(client_t *client, int level, const char *fmt,...)
static const char ac_clients[][8]
static void AC_DelRequirement_f(void)
static byte ac_send_buffer[AC_SEND_SIZE]
static cvar_t * ac_client_disconnect_action
static void AC_SendHello(void)
static client_t * AC_ParseClient(void)
addrmatch_t * SV_MatchAddress(list_t *list, netadr_t *addr)
neterr_t NET_RunStream(netstream_t *s)
static void AC_ParseClientAck(void)
static const ac_cvarop_t ac_cvarops[]
void AC_ClientDisconnect(client_t *cl)
size_t FIFO_Write(fifo_t *fifo, const void *buffer, size_t len)
static void AC_ParseCvar(char *data, int linenum, const char *path)
static cvar_t * ac_show_violation_reason
static void AC_SendPrefs(void)
static const cmdreg_t c_ac[]
void SV_AddMatch_f(list_t *list)
static void AC_Spin(void)
void SZ_Clear(sizebuf_t *buf)
static void ac_disable_play_changed(cvar_t *self)
static void AC_SendChecks(void)
static void AC_ParseToken(char *data, int linenum, const char *path)