Quake II RTX doxygen  1.0 dev
commands.c File Reference
#include "server.h"

Go to the source code of this file.

Functions

static void SV_SetMaster_f (void)
 
static void SV_ListMasters_f (void)
 
client_tSV_GetPlayer (const char *s, qboolean partial)
 
static void SV_Player_g (genctx_t *ctx)
 
static void SV_SetPlayer_c (genctx_t *ctx, int argnum)
 
static qboolean SV_SetPlayer (void)
 
static void abort_func (void *arg)
 
static void SV_Map (qboolean restart)
 
static void SV_DemoMap_f (void)
 
static void SV_GameMap_f (void)
 
static int should_really_restart (void)
 
static void SV_Map_f (void)
 
static void SV_Map_c (genctx_t *ctx, int argnum)
 
static void SV_DumpEnts_f (void)
 
static void make_mask (netadr_t *mask, netadrtype_t type, int bits)
 
static void SV_Kick_f (void)
 
static void dump_clients (void)
 
static void dump_versions (void)
 
static void dump_downloads (void)
 
static void dump_time (void)
 
static void dump_lag (void)
 
static void dump_protocols (void)
 
static void dump_settings (void)
 
static void SV_Status_f (void)
 
static void SV_ConSay_f (void)
 
static void SV_Heartbeat_f (void)
 
static void SV_Serverinfo_f (void)
 
void SV_PrintMiscInfo (void)
 
static void SV_DumpUser_f (void)
 
static void SV_Stuff_f (void)
 
static void SV_StuffAll_f (void)
 
static void SV_StuffCvar_f (void)
 
static void SV_PickClient_f (void)
 
static void SV_KillServer_f (void)
 
static void SV_ServerCommand_f (void)
 
static qboolean parse_mask (char *s, netadr_t *addr, netadr_t *mask)
 
static size_t format_mask (addrmatch_t *match, char *buf, size_t buf_size)
 
void SV_AddMatch_f (list_t *list)
 
void SV_DelMatch_f (list_t *list)
 
void SV_ListMatches_f (list_t *list)
 
static void SV_AddBan_f (void)
 
static void SV_DelBan_f (void)
 
static void SV_ListBans_f (void)
 
static void SV_AddBlackHole_f (void)
 
static void SV_DelBlackHole_f (void)
 
static void SV_ListBlackHoles_f (void)
 
static list_t * SV_FindStuffList (void)
 
static void SV_AddStuffCmd_f (void)
 
static void SV_DelStuffCmd_f (void)
 
static void SV_ListStuffCmds_f (void)
 
static void SV_StuffCmd_c (genctx_t *ctx, int argnum)
 
static void SV_AddFilterCmd_f (void)
 
static void SV_AddFilterCmd_c (genctx_t *ctx, int argnum)
 
static void SV_DelFilterCmd_f (void)
 
static void SV_DelFilterCmd_c (genctx_t *ctx, int argnum)
 
static void SV_ListFilterCmds_f (void)
 
void SV_InitOperatorCommands (void)
 

Variables

static const char filteractions [FA_MAX][8]
 
static const cmdreg_t c_server []
 

Function Documentation

◆ abort_func()

static void abort_func ( void arg)
static

Definition at line 261 of file commands.c.

262 {
263  CM_FreeMap(arg);
264 }

Referenced by SV_Map().

◆ dump_clients()

static void dump_clients ( void  )
static

Definition at line 510 of file commands.c.

511 {
512  client_t *client;
513 
514  Com_Printf(
515  "num score ping name lastmsg address rate pr fps\n"
516  "--- ----- ---- --------------- ------- --------------------- ----- -- ---\n");
517  FOR_EACH_CLIENT(client) {
518  Com_Printf("%3i %5i ", client->number,
519  client->edict->client->ps.stats[STAT_FRAGS]);
520 
521  switch (client->state) {
522  case cs_zombie:
523  Com_Printf("ZMBI ");
524  break;
525  case cs_assigned:
526  Com_Printf("ASGN ");
527  break;
528  case cs_connected:
529  case cs_primed:
530  if (client->download) {
531  Com_Printf("DNLD ");
532  } else if (client->http_download) {
533  Com_Printf("HTTP ");
534  } else if (client->state == cs_connected) {
535  Com_Printf("CNCT ");
536  } else {
537  Com_Printf("PRIM ");
538  }
539  break;
540  default:
541  Com_Printf("%4i ", client->ping < 9999 ? client->ping : 9999);
542  break;
543  }
544 
545  Com_Printf("%-15.15s ", client->name);
546  Com_Printf("%7u ", svs.realtime - client->lastmessage);
547  Com_Printf("%-21s ", NET_AdrToString(
548  &client->netchan->remote_address));
549  Com_Printf("%5"PRIz" ", client->rate);
550  Com_Printf("%2i ", client->protocol);
551  Com_Printf("%3i ", client->moves_per_sec);
552  Com_Printf("\n");
553  }
554 }

Referenced by SV_Status_f().

◆ dump_downloads()

static void dump_downloads ( void  )
static

Definition at line 571 of file commands.c.

572 {
573  client_t *client;
574  int size, percent;
575  char *name;
576 
577  Com_Printf(
578  "num name download size done\n"
579  "--- --------------- ---------------------------------------- ------- ----\n");
580 
581  FOR_EACH_CLIENT(client) {
582  if (client->download) {
583  name = client->downloadname;
584  size = client->downloadsize;
585  if (!size)
586  size = 1;
587  percent = client->downloadcount * 100 / size;
588  } else if (client->http_download) {
589  name = "<HTTP download>";
590  size = percent = 0;
591  } else {
592  continue;
593  }
594  Com_Printf("%3i %-15.15s %-40.40s %-7d %3d%%\n",
595  client->number, client->name, name, size, percent);
596  }
597 }

Referenced by SV_Status_f().

◆ dump_lag()

static void dump_lag ( void  )
static

Definition at line 621 of file commands.c.

622 {
623  client_t *cl;
624 
625  Com_Printf(
626  "num name PLs2c PLc2s Rmin Ravg Rmax dup\n"
627  "--- --------------- ----- ----- ---- ---- ---- ---\n");
628 
630  Com_Printf("%3i %-15.15s %5.2f %5.2f %4d %4d %4d %3d\n",
631  cl->number, cl->name, PL_S2C(cl), PL_C2S(cl),
632  cl->min_ping, AVG_PING(cl), cl->max_ping,
633  cl->numpackets - 1);
634  }
635 }

Referenced by SV_Status_f().

◆ dump_protocols()

static void dump_protocols ( void  )
static

Definition at line 637 of file commands.c.

638 {
639  client_t *cl;
640 
641  Com_Printf(
642  "num name major minor msglen zlib chan\n"
643  "--- --------------- ----- ----- ------ ---- ----\n");
644 
646  Com_Printf("%3i %-15.15s %5d %5d %6"PRIz" %s %s\n",
647  cl->number, cl->name, cl->protocol, cl->version,
648  cl->netchan->maxpacketlen,
649  cl->has_zlib ? "yes" : "no ",
650  cl->netchan->type ? "new" : "old");
651  }
652 }

Referenced by SV_Status_f().

◆ dump_settings()

static void dump_settings ( void  )
static

Definition at line 654 of file commands.c.

655 {
656  client_t *cl;
657  char opt[8];
658 
659  Com_Printf(
660  "num name proto options upd fps\n"
661  "--- --------------- ----- ------- --- ---\n");
662 
663  opt[6] = ' ';
664  opt[7] = 0;
666  opt[0] = cl->settings[CLS_NOGUN] ? 'G' : ' ';
667  opt[1] = cl->settings[CLS_NOBLEND] ? 'B' : ' ';
668  opt[2] = cl->settings[CLS_RECORDING] ? 'R' : ' ';
669  opt[3] = cl->settings[CLS_NOGIBS] ? 'I' : ' ';
670  opt[4] = cl->settings[CLS_NOFOOTSTEPS] ? 'F' : ' ';
671  opt[5] = cl->settings[CLS_NOPREDICT] ? 'P' : ' ';
672  Com_Printf("%3i %-15.15s %5d %s %3d %3d\n",
673  cl->number, cl->name, cl->protocol, opt,
674  cl->settings[CLS_PLAYERUPDATES], cl->settings[CLS_FPS]);
675  }
676 }

Referenced by SV_Status_f().

◆ dump_time()

static void dump_time ( void  )
static

Definition at line 599 of file commands.c.

600 {
601  client_t *client;
602  char buffer[MAX_QPATH];
603  time_t clock = time(NULL);
604  unsigned idle;
605 
606  Com_Printf(
607  "num name idle time\n"
608  "--- --------------- ---- --------\n");
609 
610  FOR_EACH_CLIENT(client) {
611  idle = (svs.realtime - client->lastactivity) / 1000;
612  if (idle > 9999)
613  idle = 9999;
614  Com_TimeDiff(buffer, sizeof(buffer),
615  &client->connect_time, clock);
616  Com_Printf("%3i %-15.15s %4u %s\n",
617  client->number, client->name, idle, buffer);
618  }
619 }

Referenced by SV_Status_f().

◆ dump_versions()

static void dump_versions ( void  )
static

Definition at line 556 of file commands.c.

557 {
558  client_t *client;
559 
560  Com_Printf(
561  "num name version\n"
562  "--- --------------- -----------------------------------------\n");
563 
564  FOR_EACH_CLIENT(client) {
565  Com_Printf("%3i %-15.15s %-40.40s\n",
566  client->number, client->name,
567  client->version_string ? client->version_string : "-");
568  }
569 }

Referenced by SV_Status_f().

◆ format_mask()

static size_t format_mask ( addrmatch_t match,
char *  buf,
size_t  buf_size 
)
static

Definition at line 1050 of file commands.c.

1051 {
1052  int i, j, bits, size;
1053 
1054  size = (match->mask.type == NA_IP6) ? 128 : 32;
1055  bits = 0;
1056 
1057  for (i = 0; i < size >> 3; i++) {
1058  int c = match->mask.ip.u8[i];
1059 
1060  if (c == 0xff) {
1061  bits += 8;
1062  continue;
1063  }
1064 
1065  if (c == 0) {
1066  break;
1067  }
1068 
1069  for (j = 0; j < 8; j++) {
1070  if (!(c & (1 << (7 - j)))) {
1071  break;
1072  }
1073  }
1074 
1075  bits += j;
1076  break;
1077  }
1078 
1079  return Q_snprintf(buf, buf_size, "%s/%d", NET_BaseAdrToString(&match->addr), bits);
1080 }

Referenced by SV_AddMatch_f(), and SV_ListMatches_f().

◆ make_mask()

static void make_mask ( netadr_t *  mask,
netadrtype_t  type,
int  bits 
)
static

Definition at line 1003 of file commands.c.

1004 {
1005  memset(mask, 0, sizeof(*mask));
1006  mask->type = type;
1007  memset(mask->ip.u8, 0xff, bits >> 3);
1008  if (bits & 7) {
1009  mask->ip.u8[bits >> 3] = ~((1 << (8 - (bits & 7))) - 1);
1010  }
1011 }

Referenced by parse_mask(), and SV_Kick_f().

◆ parse_mask()

static qboolean parse_mask ( char *  s,
netadr_t *  addr,
netadr_t *  mask 
)
static

Definition at line 1013 of file commands.c.

1014 {
1015  int bits, size;
1016  char *p;
1017 
1018  p = strchr(s, '/');
1019  if (p) {
1020  *p++ = 0;
1021  if (*p == 0) {
1022  Com_Printf("Please specify a mask after '/'.\n");
1023  return qfalse;
1024  }
1025  bits = atoi(p);
1026  } else {
1027  bits = -1;
1028  }
1029 
1030  if (!NET_StringToBaseAdr(s, addr)) {
1031  Com_Printf("Bad address: %s\n", s);
1032  return qfalse;
1033  }
1034 
1035  size = (addr->type == NA_IP6) ? 128 : 32;
1036 
1037  if (bits == -1) {
1038  bits = size;
1039  }
1040 
1041  if (bits < 1 || bits > size) {
1042  Com_Printf("Bad mask: %d bits\n", bits);
1043  return qfalse;
1044  }
1045 
1046  make_mask(mask, addr->type, bits);
1047  return qtrue;
1048 }

Referenced by SV_AddMatch_f(), and SV_DelMatch_f().

◆ should_really_restart()

static int should_really_restart ( void  )
static

Definition at line 372 of file commands.c.

373 {
374  static qboolean warned;
375 
376  if (sv.state != ss_game && sv.state != ss_pic && sv.state != ss_cinematic)
377  return 1; // the game is just starting
378 
379 #if !USE_CLIENT
380  if (sv_recycle->integer)
381  return 1; // there is recycle pending
382 #endif
383 
384  if (Cvar_CountLatchedVars())
385  return 1; // there are latched cvars
386 
387  if (!strcmp(Cmd_Argv(2), "force"))
388  return 1; // forced restart
389 
390  if (sv_allow_map->integer == 1)
391  return 1; // `map' warning disabled
392 
393  if (sv_allow_map->integer != 0)
394  return 0; // turn `map' into `gamemap'
395 
396  Com_Printf(
397  "Using 'map' will cause full server restart. "
398  "Use 'gamemap' for changing maps.\n");
399 
400  if (!warned) {
401  Com_Printf(
402  "(You can set 'sv_allow_map' to 1 if you wish to permanently "
403  "disable this warning. To force restart for a single invocation "
404  "of this command, use 'map <mapname> force')\n");
405  warned = qtrue;
406  }
407 
408  return -1; // ignore this command
409 }

Referenced by SV_Map_f().

◆ SV_AddBan_f()

static void SV_AddBan_f ( void  )
static

Definition at line 1206 of file commands.c.

1207 {
1209 }

◆ SV_AddBlackHole_f()

static void SV_AddBlackHole_f ( void  )
static

Definition at line 1219 of file commands.c.

1220 {
1222 }

◆ SV_AddFilterCmd_c()

static void SV_AddFilterCmd_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 1400 of file commands.c.

1401 {
1402  filteraction_t action;
1403 
1404  if (argnum == 2) {
1405  for (action = 0; action < FA_MAX; action++) {
1406  Prompt_AddMatch(ctx, filteractions[action]);
1407  }
1408  }
1409 }

◆ SV_AddFilterCmd_f()

static void SV_AddFilterCmd_f ( void  )
static

Definition at line 1355 of file commands.c.

1356 {
1357  char *s, *comment;
1358  filtercmd_t *filter;
1359  filteraction_t action;
1360  size_t len;
1361 
1362  if (Cmd_Argc() < 2) {
1363 usage:
1364  Com_Printf("Usage: %s <command> [ignore|print|stuff|kick] [comment]\n", Cmd_Argv(0));
1365  return;
1366  }
1367 
1368  if (Cmd_Argc() > 2) {
1369  s = Cmd_Argv(2);
1370  for (action = 0; action < FA_MAX; action++) {
1371  if (!strcmp(s, filteractions[action])) {
1372  break;
1373  }
1374  }
1375  if (action == FA_MAX) {
1376  goto usage;
1377  }
1378  comment = Cmd_ArgsFrom(3);
1379  } else {
1380  action = FA_IGNORE;
1381  comment = NULL;
1382  }
1383 
1384 
1385  s = Cmd_Argv(1);
1386  LIST_FOR_EACH(filtercmd_t, filter, &sv_filterlist, entry) {
1387  if (!Q_stricmp(filter->string, s)) {
1388  Com_Printf("Filtercmd already exists: %s\n", s);
1389  return;
1390  }
1391  }
1392  len = strlen(s);
1393  filter = Z_Malloc(sizeof(*filter) + len);
1394  memcpy(filter->string, s, len + 1);
1395  filter->action = action;
1396  filter->comment = Z_CopyString(comment);
1397  List_Append(&sv_filterlist, &filter->entry);
1398 }

◆ SV_AddMatch_f()

void SV_AddMatch_f ( list_t *  list)

Definition at line 1082 of file commands.c.

1083 {
1084  char *s, buf[MAX_QPATH];
1085  addrmatch_t *match;
1086  netadr_t addr, mask;
1087  size_t len;
1088 
1089  if (Cmd_Argc() < 2) {
1090  Com_Printf("Usage: %s <address[/mask]> [comment]\n", Cmd_Argv(0));
1091  return;
1092  }
1093 
1094  s = Cmd_Argv(1);
1095  if (!parse_mask(s, &addr, &mask)) {
1096  return;
1097  }
1098 
1099  LIST_FOR_EACH(addrmatch_t, match, list, entry) {
1100  if (NET_IsEqualBaseAdr(&match->addr, &addr) &&
1101  NET_IsEqualBaseAdr(&match->mask, &mask)) {
1102  format_mask(match, buf, sizeof(buf));
1103  Com_Printf("Entry %s already exists.\n", buf);
1104  return;
1105  }
1106  }
1107 
1108  s = Cmd_ArgsFrom(2);
1109  len = strlen(s);
1110  match = Z_Malloc(sizeof(*match) + len);
1111  match->addr = addr;
1112  match->mask = mask;
1113  match->hits = 0;
1114  match->time = 0;
1115  memcpy(match->comment, s, len + 1);
1116  List_Append(list, &match->entry);
1117 }

Referenced by AC_AddException_f(), AC_AddRequirement_f(), SV_AddBan_f(), SV_AddBlackHole_f(), SV_AddGtvBan_f(), and SV_AddGtvHost_f().

◆ SV_AddStuffCmd_f()

static void SV_AddStuffCmd_f ( void  )
static

Definition at line 1246 of file commands.c.

1247 {
1248  char *s;
1249  list_t *list;
1250  stuffcmd_t *stuff;
1251  int len;
1252 
1253  if (Cmd_Argc() < 3) {
1254  Com_Printf("Usage: %s <list> <command>\n", Cmd_Argv(0));
1255  return;
1256  }
1257 
1258  if ((list = SV_FindStuffList()) == NULL) {
1259  return;
1260  }
1261 
1262  s = Cmd_ArgsFrom(2);
1263  len = strlen(s);
1264  stuff = Z_Malloc(sizeof(*stuff) + len);
1265  stuff->len = len;
1266  memcpy(stuff->string, s, len + 1);
1267  List_Append(list, &stuff->entry);
1268 }

◆ SV_ConSay_f()

static void SV_ConSay_f ( void  )
static

Definition at line 721 of file commands.c.

722 {
723  client_t *client;
724  char *s;
725 
726  if (!svs.initialized) {
727  Com_Printf("No server running.\n");
728  return;
729  }
730 
731  if (Cmd_Argc() < 2) {
732  Com_Printf("Usage: %s <raw text>\n", Cmd_Argv(0));
733  return;
734  }
735 
736  s = Cmd_RawArgs();
737  FOR_EACH_CLIENT(client) {
738  if (client->state != cs_spawned)
739  continue;
740  SV_ClientPrintf(client, PRINT_CHAT, "console: %s\n", s);
741  }
742 
743  if (COM_DEDICATED) {
744  Com_LPrintf(PRINT_TALK, "console: %s\n", s);
745  }
746 }

Referenced by SV_InitOperatorCommands().

◆ SV_DelBan_f()

static void SV_DelBan_f ( void  )
static

Definition at line 1210 of file commands.c.

1211 {
1213 }

◆ SV_DelBlackHole_f()

static void SV_DelBlackHole_f ( void  )
static

Definition at line 1223 of file commands.c.

1224 {
1226 }

◆ SV_DelFilterCmd_c()

static void SV_DelFilterCmd_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 1463 of file commands.c.

1464 {
1465  filtercmd_t *filter;
1466 
1467  if (argnum == 1) {
1468  if (LIST_EMPTY(&sv_filterlist)) {
1469  return;
1470  }
1471  ctx->ignorecase = qtrue;
1472  Prompt_AddMatch(ctx, "all");
1473  LIST_FOR_EACH(filtercmd_t, filter, &sv_filterlist, entry) {
1474  if (!Prompt_AddMatch(ctx, filter->string)) {
1475  break;
1476  }
1477  }
1478  }
1479 }

◆ SV_DelFilterCmd_f()

static void SV_DelFilterCmd_f ( void  )
static

Definition at line 1411 of file commands.c.

1412 {
1413  filtercmd_t *filter, *next;
1414  char *s;
1415  int i;
1416 
1417  if (Cmd_Argc() < 2) {
1418  Com_Printf("Usage: %s <id|cmd|all>\n", Cmd_Argv(0));
1419  return;
1420  }
1421 
1422  if (LIST_EMPTY(&sv_filterlist)) {
1423  Com_Printf("No filtercmds registered.\n");
1424  return;
1425  }
1426 
1427  s = Cmd_Argv(1);
1428  if (!strcmp(s, "all")) {
1429  LIST_FOR_EACH_SAFE(filtercmd_t, filter, next, &sv_filterlist, entry) {
1430  Z_Free(filter->comment);
1431  Z_Free(filter);
1432  }
1433  List_Init(&sv_filterlist);
1434  return;
1435  }
1436  if (COM_IsUint(s)) {
1437  i = atoi(s);
1438  if (i < 1) {
1439  Com_Printf("Bad filtercmd index: %d\n", i);
1440  return;
1441  }
1442  filter = LIST_INDEX(filtercmd_t, i - 1, &sv_filterlist, entry);
1443  if (!filter) {
1444  Com_Printf("No such filtercmd index: %d\n", i);
1445  return;
1446  }
1447  } else {
1448  LIST_FOR_EACH(filtercmd_t, filter, &sv_filterlist, entry) {
1449  if (!Q_stricmp(filter->string, s)) {
1450  goto remove;
1451  }
1452  }
1453  Com_Printf("No such filtercmd string: %s\n", s);
1454  return;
1455  }
1456 
1457 remove:
1458  List_Remove(&filter->entry);
1459  Z_Free(filter->comment);
1460  Z_Free(filter);
1461 }

◆ SV_DelMatch_f()

void SV_DelMatch_f ( list_t *  list)

Definition at line 1119 of file commands.c.

1120 {
1121  char *s;
1122  addrmatch_t *match, *next;
1123  netadr_t addr, mask;
1124  int i;
1125 
1126  if (Cmd_Argc() < 2) {
1127  Com_Printf("Usage: %s <address[/mask]|id|all>\n", Cmd_Argv(0));
1128  return;
1129  }
1130 
1131  if (LIST_EMPTY(list)) {
1132  Com_Printf("Address list is empty.\n");
1133  return;
1134  }
1135 
1136  s = Cmd_Argv(1);
1137  if (!strcmp(s, "all")) {
1138  LIST_FOR_EACH_SAFE(addrmatch_t, match, next, list, entry) {
1139  Z_Free(match);
1140  }
1141  List_Init(list);
1142  return;
1143  }
1144 
1145  // numeric values are just slot numbers
1146  if (COM_IsUint(s)) {
1147  i = atoi(s);
1148  if (i < 1) {
1149  Com_Printf("Bad index: %d\n", i);
1150  return;
1151  }
1152  match = LIST_INDEX(addrmatch_t, i - 1, list, entry);
1153  if (match) {
1154  goto remove;
1155  }
1156  Com_Printf("No such index: %d\n", i);
1157  return;
1158  }
1159 
1160  if (!parse_mask(s, &addr, &mask)) {
1161  return;
1162  }
1163 
1164  LIST_FOR_EACH(addrmatch_t, match, list, entry) {
1165  if (NET_IsEqualBaseAdr(&match->addr, &addr) &&
1166  NET_IsEqualBaseAdr(&match->mask, &mask)) {
1167 remove:
1168  List_Remove(&match->entry);
1169  Z_Free(match);
1170  return;
1171  }
1172  }
1173  Com_Printf("No such entry: %s\n", s);
1174 }

Referenced by AC_DelException_f(), AC_DelRequirement_f(), SV_DelBan_f(), SV_DelBlackHole_f(), SV_DelGtvBan_f(), and SV_DelGtvHost_f().

◆ SV_DelStuffCmd_f()

static void SV_DelStuffCmd_f ( void  )
static

Definition at line 1270 of file commands.c.

1271 {
1272  list_t *list;
1273  stuffcmd_t *stuff, *next;
1274  char *s;
1275  int i;
1276 
1277  if (Cmd_Argc() < 3) {
1278  Com_Printf("Usage: %s <list> <id|all>\n", Cmd_Argv(0));
1279  return;
1280  }
1281 
1282  if ((list = SV_FindStuffList()) == NULL) {
1283  return;
1284  }
1285 
1286  if (LIST_EMPTY(list)) {
1287  Com_Printf("No stuffcmds registered.\n");
1288  return;
1289  }
1290 
1291  s = Cmd_Argv(2);
1292  if (!strcmp(s, "all")) {
1293  LIST_FOR_EACH_SAFE(stuffcmd_t, stuff, next, list, entry) {
1294  Z_Free(stuff);
1295  }
1296  List_Init(list);
1297  return;
1298  }
1299  i = atoi(s);
1300  if (i < 1) {
1301  Com_Printf("Bad stuffcmd index: %d\n", i);
1302  return;
1303  }
1304  stuff = LIST_INDEX(stuffcmd_t, i - 1, list, entry);
1305  if (!stuff) {
1306  Com_Printf("No such stuffcmd index: %d\n", i);
1307  return;
1308  }
1309 
1310  List_Remove(&stuff->entry);
1311  Z_Free(stuff);
1312 }

◆ SV_DemoMap_f()

static void SV_DemoMap_f ( void  )
static

Definition at line 322 of file commands.c.

323 {
324  Com_Printf("'%s' command is no longer supported.\n", Cmd_Argv(0));
325 #if USE_CLIENT
326  Com_Printf("To play a client demo, use 'demo' command instead.\n");
327 #endif
328 #if USE_MVD_CLIENT
329  Com_Printf("To play a MVD, use 'mvdplay' command.\n");
330 #endif
331 }

◆ SV_DumpEnts_f()

static void SV_DumpEnts_f ( void  )
static

Definition at line 442 of file commands.c.

443 {
444  bsp_t *c = sv.cm.cache;
445  char buffer[MAX_OSPATH];
446 
447  if (!c || !c->entitystring) {
448  Com_Printf("No map loaded.\n");
449  return;
450  }
451 
452  if (Cmd_Argc() != 2) {
453  Com_Printf("Usage: %s <filename>\n", Cmd_Argv(0));
454  return;
455  }
456 
457  if (FS_EasyWriteFile(buffer, sizeof(buffer), FS_MODE_WRITE,
458  "maps/", Cmd_Argv(1), ".ent", c->entitystring, c->numentitychars)) {
459  Com_Printf("Dumped entity string to %s\n", buffer);
460  }
461 }

◆ SV_DumpUser_f()

static void SV_DumpUser_f ( void  )
static

Definition at line 812 of file commands.c.

813 {
814  if (!svs.initialized) {
815  Com_Printf("No server running.\n");
816  return;
817  }
818 
819  if (Cmd_Argc() != 2) {
820  Com_Printf("Usage: %s <userid>\n", Cmd_Argv(0));
821  return;
822  }
823 
824  if (!SV_SetPlayer())
825  return;
826 
827  Com_Printf("\nuserinfo\n");
828  Com_Printf("--------\n");
830 
831  Com_Printf("\nmiscinfo\n");
832  Com_Printf("--------\n");
834 
835  sv_client = NULL;
836  sv_player = NULL;
837 }

◆ SV_FindStuffList()

static list_t* SV_FindStuffList ( void  )
static

Definition at line 1232 of file commands.c.

1233 {
1234  char *s = Cmd_Argv(1);
1235 
1236  if (!strcmp(s, "connect")) {
1237  return &sv_cmdlist_connect;
1238  }
1239  if (!strcmp(s, "begin")) {
1240  return &sv_cmdlist_begin;
1241  }
1242  Com_Printf("Unknown stuffcmd list: %s\n", s);
1243  return NULL;
1244 }

Referenced by SV_AddStuffCmd_f(), SV_DelStuffCmd_f(), and SV_ListStuffCmds_f().

◆ SV_GameMap_f()

static void SV_GameMap_f ( void  )
static

Definition at line 351 of file commands.c.

352 {
353  if (Cmd_Argc() != 2) {
354  Com_Printf("Usage: %s <mapname>\n", Cmd_Argv(0));
355  return;
356  }
357 
358 #if !USE_CLIENT
359  // admin option to reload the game DLL or entire server
360  if (sv_recycle->integer > 0) {
361  if (sv_recycle->integer > 1) {
362  Com_Quit(NULL, ERR_RECONNECT);
363  }
364  SV_Map(qtrue);
365  return;
366  }
367 #endif
368 
369  SV_Map(qfalse);
370 }

◆ SV_GetPlayer()

client_t* SV_GetPlayer ( const char *  s,
qboolean  partial 
)

Definition at line 127 of file commands.c.

128 {
129  client_t *other, *match;
130  int i, count;
131 
132  if (!s[0]) {
133  return NULL;
134  }
135 
136  // numeric values are just slot numbers
137  if (COM_IsUint(s)) {
138  i = atoi(s);
139  if (i < 0 || i >= sv_maxclients->integer) {
140  Com_Printf("Bad client slot number: %d\n", i);
141  return NULL;
142  }
143 
144  other = &svs.client_pool[i];
145  if (other->state <= cs_zombie) {
146  Com_Printf("Client slot %d is not active.\n", i);
147  return NULL;
148  }
149  return other;
150  }
151 
152  // check for exact name match
154  if (other->state <= cs_zombie) {
155  continue;
156  }
157  if (!strcmp(other->name, s)) {
158  return other;
159  }
160  }
161 
162  if (!partial) {
163  Com_Printf("Userid '%s' is not on the server.\n", s);
164  return NULL;
165  }
166 
167  // check for partial, case insensitive name match
168  match = NULL;
169  count = 0;
171  if (other->state <= cs_zombie) {
172  continue;
173  }
174  if (!Q_stricmp(other->name, s)) {
175  return other; // exact match
176  }
177  if (Q_stristr(other->name, s)) {
178  match = other; // partial match
179  count++;
180  }
181  }
182 
183  if (!match) {
184  Com_Printf("No clients matching '%s' found.\n", s);
185  return NULL;
186  }
187 
188  if (count > 1) {
189  Com_Printf("'%s' matches multiple clients.\n", s);
190  return NULL;
191  }
192 
193  return match;
194 }

Referenced by SV_Lag_f(), and SV_SetPlayer().

◆ SV_Heartbeat_f()

static void SV_Heartbeat_f ( void  )
static

Definition at line 754 of file commands.c.

755 {
757 }

◆ SV_InitOperatorCommands()

void SV_InitOperatorCommands ( void  )

Definition at line 1593 of file commands.c.

1594 {
1596 
1597  if (COM_DEDICATED)
1598  Cmd_AddCommand("say", SV_ConSay_f);
1599 }

Referenced by SV_Init().

◆ SV_Kick_f()

static void SV_Kick_f ( void  )
static

Definition at line 474 of file commands.c.

475 {
476  if (!svs.initialized) {
477  Com_Printf("No server running.\n");
478  return;
479  }
480 
481  if (Cmd_Argc() != 2) {
482  Com_Printf("Usage: %s <userid>\n", Cmd_Argv(0));
483  return;
484  }
485 
486  if (!SV_SetPlayer())
487  return;
488 
489  SV_DropClient(sv_client, "?was kicked");
490  sv_client->lastmessage = svs.realtime; // min case there is a funny zombie
491 
492  // optionally ban their IP address
493  if (!strcmp(Cmd_Argv(0), "kickban")) {
494  netadr_t *addr = &sv_client->netchan->remote_address;
495  if (addr->type == NA_IP || addr->type == NA_IP6) {
496  addrmatch_t *match = Z_Malloc(sizeof(*match));
497  match->addr = *addr;
498  make_mask(&match->mask, addr->type, addr->type == NA_IP6 ? 128 : 32);
499  match->hits = 0;
500  match->time = 0;
501  match->comment[0] = 0;
502  List_Append(&sv_banlist, &match->entry);
503  }
504  }
505 
506  sv_client = NULL;
507  sv_player = NULL;
508 }

◆ SV_KillServer_f()

static void SV_KillServer_f ( void  )
static

Definition at line 976 of file commands.c.

977 {
978  if (!svs.initialized) {
979  Com_Printf("No server running.\n");
980  return;
981  }
982 
983  SV_Shutdown("Server was killed.\n", ERR_DISCONNECT);
984 }

◆ SV_ListBans_f()

static void SV_ListBans_f ( void  )
static

Definition at line 1214 of file commands.c.

1215 {
1217 }

◆ SV_ListBlackHoles_f()

static void SV_ListBlackHoles_f ( void  )
static

Definition at line 1227 of file commands.c.

1228 {
1230 }

◆ SV_ListFilterCmds_f()

static void SV_ListFilterCmds_f ( void  )
static

Definition at line 1481 of file commands.c.

1482 {
1483  filtercmd_t *filter;
1484  int count;
1485 
1486  if (LIST_EMPTY(&sv_filterlist)) {
1487  Com_Printf("No filtercmds registered.\n");
1488  return;
1489  }
1490 
1491  Com_Printf("id command action comment\n"
1492  "-- ---------------- ------ -------\n");
1493  count = 1;
1494  LIST_FOR_EACH(filtercmd_t, filter, &sv_filterlist, entry) {
1495  Com_Printf("%-2d %-16s %-6s %s\n", count,
1496  filter->string, filteractions[filter->action],
1497  filter->comment ? filter->comment : "");
1498  count++;
1499  }
1500 }

◆ SV_ListMasters_f()

static void SV_ListMasters_f ( void  )
static

Definition at line 100 of file commands.c.

101 {
102  master_t *m;
103  char buf[8], *adr;
104  int i;
105 
106  if (LIST_EMPTY(&sv_masterlist)) {
107  Com_Printf("There are no masters.\n");
108  return;
109  }
110 
111  Com_Printf("num hostname lastmsg address\n"
112  "--- --------------------- ------- ---------------------\n");
113  i = 0;
114  FOR_EACH_MASTER(m) {
115  if (!svs.initialized) {
116  strcpy(buf, "down");
117  } else if (!m->last_ack) {
118  strcpy(buf, "never");
119  } else {
120  Q_snprintf(buf, sizeof(buf), "%u", svs.realtime - m->last_ack);
121  }
122  adr = m->adr.port ? NET_AdrToString(&m->adr) : "error";
123  Com_Printf("%3d %-21.21s %7s %-21s\n", ++i, m->name, buf, adr);
124  }
125 }

◆ SV_ListMatches_f()

void SV_ListMatches_f ( list_t *  list)

Definition at line 1176 of file commands.c.

1177 {
1178  addrmatch_t *match;
1179  char last[MAX_QPATH];
1180  char addr[MAX_QPATH];
1181  int count;
1182 
1183  if (LIST_EMPTY(list)) {
1184  Com_Printf("Address list is empty.\n");
1185  return;
1186  }
1187 
1188  Com_Printf("id address/mask hits last hit comment\n"
1189  "-- ------------------ ---- ------------ -------\n");
1190  count = 1;
1191  LIST_FOR_EACH(addrmatch_t, match, list, entry) {
1192  format_mask(match, addr, sizeof(addr));
1193  if (!match->time) {
1194  strcpy(last, "never");
1195  } else {
1196  struct tm *tm = localtime(&match->time);
1197  if (!tm || !strftime(last, sizeof(last), "%d %b %H:%M", tm))
1198  strcpy(last, "???");
1199  }
1200  Com_Printf("%-2d %-18s %-4u %-12s %s\n", count, addr,
1201  match->hits, last, match->comment);
1202  count++;
1203  }
1204 }

Referenced by AC_ListExceptions_f(), AC_ListRequirements_f(), SV_ListBans_f(), SV_ListBlackHoles_f(), SV_ListGtvBans_f(), and SV_ListGtvHosts_f().

◆ SV_ListStuffCmds_f()

static void SV_ListStuffCmds_f ( void  )
static

Definition at line 1314 of file commands.c.

1315 {
1316  list_t *list;
1317  stuffcmd_t *stuff;
1318  int count;
1319 
1320  if (Cmd_Argc() != 2) {
1321  Com_Printf("Usage: %s <list>\n", Cmd_Argv(0));
1322  return;
1323  }
1324 
1325  if ((list = SV_FindStuffList()) == NULL) {
1326  return;
1327  }
1328 
1329  if (LIST_EMPTY(list)) {
1330  Com_Printf("No stuffcmds registered.\n");
1331  return;
1332  }
1333 
1334  Com_Printf("id command\n"
1335  "-- -------\n");
1336  count = 1;
1337  LIST_FOR_EACH(stuffcmd_t, stuff, list, entry) {
1338  Com_Printf("%-2d %s\n", count, stuff->string);
1339  count++;
1340  }
1341 }

◆ SV_Map()

static void SV_Map ( qboolean  restart)
static

Definition at line 266 of file commands.c.

267 {
268  mapcmd_t cmd;
269  size_t len;
270 
271  memset(&cmd, 0, sizeof(cmd));
272 
273  // save the mapcmd
274  len = Cmd_ArgvBuffer(1, cmd.buffer, sizeof(cmd.buffer));
275  if (len >= sizeof(cmd.buffer)) {
276  Com_Printf("Refusing to process oversize level string.\n");
277  return;
278  }
279 
280  if (!SV_ParseMapCmd(&cmd))
281  return;
282 
283  // save pending CM to be freed later if ERR_DROP is thrown
284  Com_AbortFunc(abort_func, &cmd.cm);
285 
286  // wipe savegames
287  cmd.endofunit |= restart;
288 
289  SV_AutoSaveBegin(&cmd);
290 
291  // any error will drop from this point
292  if ((sv.state != ss_game && sv.state != ss_pic && sv.state != ss_cinematic) || restart)
293  SV_InitGame(MVD_SPAWN_DISABLED); // the game is just starting
294 
295  // clear pending CM
296  Com_AbortFunc(NULL, NULL);
297 
298  SV_SpawnServer(&cmd);
299 
300  // In order to make the autosaves save player locations where they have entered the level,
301  // we need to defer the call to SV_AutoSaveEnd until the client has connected and
302  // initialized their edict. That happens in SV_Begin_f (user.c).
303  // Only do this in local single player mode for safety.
304  if (sv_maxclients->integer == 1 && !dedicated->integer && !SV_NoSaveGames())
305  {
306  sv_pending_autosave = qtrue;
307  }
308  else
309  {
310  sv_pending_autosave = qfalse;
311  SV_AutoSaveEnd();
312  }
313 }

Referenced by SV_GameMap_f(), and SV_Map_f().

◆ SV_Map_c()

static void SV_Map_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 435 of file commands.c.

436 {
437  if (argnum == 1) {
438  FS_File_g("maps", ".bsp", FS_SEARCH_STRIPEXT, ctx);
439  }
440 }

◆ SV_Map_f()

static void SV_Map_f ( void  )
static

Definition at line 419 of file commands.c.

420 {
421  int res;
422 
423  if (Cmd_Argc() < 2) {
424  Com_Printf("Usage: %s <mapname>\n", Cmd_Argv(0));
425  return;
426  }
427 
428  res = should_really_restart();
429  if (res < 0)
430  return;
431 
432  SV_Map(!!res);
433 }

◆ SV_PickClient_f()

static void SV_PickClient_f ( void  )
static

Definition at line 936 of file commands.c.

937 {
938  char *s;
939  netadr_t address;
940 
941  if (!svs.initialized) {
942  Com_Printf("No server running.\n");
943  return;
944  }
945  if (sv_maxclients->integer == 1) {
946  Com_Printf("Single player server running.\n");
947  return;
948  }
949 
950  if (Cmd_Argc() < 2) {
951  Com_Printf("Usage: %s <address>\n", Cmd_Argv(0));
952  return;
953  }
954 
955  s = Cmd_Argv(1);
956  if (!NET_StringToAdr(s, &address, 0)) {
957  Com_Printf("Bad client address: %s\n", s);
958  return;
959  }
960  if (address.port == 0) {
961  Com_Printf("Please specify client port explicitly.\n");
962  return;
963  }
964 
965  OOB_PRINT(NS_SERVER, &address, "passive_connect\n");
966 }

◆ SV_Player_g()

static void SV_Player_g ( genctx_t *  ctx)
static

Definition at line 196 of file commands.c.

197 {
198  client_t *cl;
199 
200  if (!svs.initialized) {
201  return;
202  }
203 
205  if (cl->state <= cs_zombie) {
206  continue;
207  }
208  if (!Prompt_AddMatch(ctx, cl->name)) {
209  break;
210  }
211  }
212 }

Referenced by SV_SetPlayer_c().

◆ SV_PrintMiscInfo()

void SV_PrintMiscInfo ( void  )

Definition at line 777 of file commands.c.

778 {
779  char buffer[MAX_QPATH];
780 
781  Com_Printf("version %s\n",
783  Com_Printf("protocol (maj/min) %d/%d\n",
785  Com_Printf("maxmsglen %"PRIz"\n", sv_client->netchan->maxpacketlen);
786  Com_Printf("zlib support %s\n", sv_client->has_zlib ? "yes" : "no");
787  Com_Printf("netchan type %s\n", sv_client->netchan->type ? "new" : "old");
788  Com_Printf("ping %d\n", sv_client->ping);
789  Com_Printf("movement fps %d\n", sv_client->moves_per_sec);
790 #if USE_FPS
791  Com_Printf("update rate %d\n", sv_client->settings[CLS_FPS]);
792 #endif
793  Com_Printf("RTT (min/avg/max) %d/%d/%d ms\n",
795  Com_Printf("PL server to client %.2f%% (approx)\n", PL_S2C(sv_client));
796  Com_Printf("PL client to server %.2f%%\n", PL_C2S(sv_client));
797 #ifdef USE_PACKETDUP
798  Com_Printf("packetdup %d\n", sv_client->numpackets - 1);
799 #endif
800  Com_TimeDiff(buffer, sizeof(buffer),
801  &sv_client->connect_time, time(NULL));
802  Com_Printf("connection time %s\n", buffer);
803 }

Referenced by SV_DumpUser_f(), and SV_ShowMiscInfo_f().

◆ SV_ServerCommand_f()

static void SV_ServerCommand_f ( void  )
static

Definition at line 993 of file commands.c.

994 {
995  if (!ge) {
996  Com_Printf("No game loaded.\n");
997  return;
998  }
999 
1000  ge->ServerCommand();
1001 }

◆ SV_Serverinfo_f()

static void SV_Serverinfo_f ( void  )
static

Definition at line 767 of file commands.c.

768 {
769  char serverinfo[MAX_INFO_STRING];
770 
771  Cvar_BitInfo(serverinfo, CVAR_SERVERINFO);
772 
773  Com_Printf("Server info settings:\n");
774  Info_Print(serverinfo);
775 }

◆ SV_SetMaster_f()

static void SV_SetMaster_f ( void  )
static

Definition at line 37 of file commands.c.

38 {
39  netadr_t adr;
40  int i, total;
41  char *s;
42  master_t *m, *n;
43  size_t len;
44 
45 #if USE_CLIENT
46  // only dedicated servers send heartbeats
47  if (!dedicated->integer) {
48  Com_Printf("Only dedicated servers use masters.\n");
49  return;
50  }
51 #endif
52 
53  // free old masters
55  Z_Free(m);
56  }
57 
58  List_Init(&sv_masterlist);
59 
60  total = 0;
61  for (i = 1; i < Cmd_Argc(); i++) {
62  if (total == MAX_MASTERS) {
63  Com_Printf("Too many masters.\n");
64  break;
65  }
66 
67  s = Cmd_Argv(i);
68  if (!NET_StringToAdr(s, &adr, PORT_MASTER)) {
69  Com_Printf("Bad master address: %s\n", s);
70  continue;
71  }
72 
74  if (NET_IsEqualBaseAdr(&m->adr, &adr)) {
75  Com_Printf("Ignoring duplicate master at %s.\n", NET_AdrToString(&adr));
76  goto out;
77  }
78  }
79 
80  Com_Printf("Master server at %s.\n", NET_AdrToString(&adr));
81  len = strlen(s);
82  m = Z_Malloc(sizeof(*m) + len);
83  memcpy(m->name, s, len + 1);
84  m->adr = adr;
85  m->last_ack = 0;
86  m->last_resolved = time(NULL);
87  List_Append(&sv_masterlist, &m->entry);
88  total++;
89 out:;
90  }
91 
92  if (total) {
93  // make sure the server is listed public
94  Cvar_Set("public", "1");
95 
97  }
98 }

◆ SV_SetPlayer()

static qboolean SV_SetPlayer ( void  )
static

Definition at line 228 of file commands.c.

229 {
230  client_t *cl;
231 
232  cl = SV_GetPlayer(Cmd_Argv(1), !!sv_enhanced_setplayer->integer);
233  if (!cl) {
234  return qfalse;
235  }
236 
237  sv_client = cl;
239  return qtrue;
240 }

Referenced by SV_DumpUser_f(), SV_Kick_f(), SV_Stuff_f(), and SV_StuffCvar_f().

◆ SV_SetPlayer_c()

static void SV_SetPlayer_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 214 of file commands.c.

215 {
216  if (argnum == 1) {
217  SV_Player_g(ctx);
218  }
219 }

◆ SV_Status_f()

static void SV_Status_f ( void  )
static

Definition at line 683 of file commands.c.

684 {
685  if (!svs.initialized) {
686  Com_Printf("No server running.\n");
687  return;
688  }
689 
690  if (sv.name[0]) {
691  Com_Printf("Current map: %s\n\n", sv.name);
692  }
693 
694  if (LIST_EMPTY(&sv_clientlist)) {
695  Com_Printf("No UDP clients.\n");
696  } else {
697  if (Cmd_Argc() > 1) {
698  char *w = Cmd_Argv(1);
699  switch (*w) {
700  case 't': dump_time(); break;
701  case 'd': dump_downloads(); break;
702  case 'l': dump_lag(); break;
703  case 'p': dump_protocols(); break;
704  case 's': dump_settings(); break;
705  default: dump_versions(); break;
706  }
707  } else {
708  dump_clients();
709  }
710  }
711  Com_Printf("\n");
712 
713  SV_MvdStatus_f();
714 }

◆ SV_Stuff_f()

static void SV_Stuff_f ( void  )
static

Definition at line 846 of file commands.c.

847 {
848  if (!svs.initialized) {
849  Com_Printf("No server running.\n");
850  return;
851  }
852 
853  if (Cmd_Argc() < 3) {
854  Com_Printf("Usage: %s <userid> <raw text>\n", Cmd_Argv(0));
855  return;
856  }
857 
858  if (!SV_SetPlayer())
859  return;
860 
864 
865  sv_client = NULL;
866  sv_player = NULL;
867 }

◆ SV_StuffAll_f()

static void SV_StuffAll_f ( void  )
static

Definition at line 876 of file commands.c.

877 {
878  client_t *client;
879 
880  if (!svs.initialized) {
881  Com_Printf("No server running.\n");
882  return;
883  }
884 
885  if (Cmd_Argc() < 2) {
886  Com_Printf("Usage: %s <raw text>\n", Cmd_Argv(0));
887  return;
888  }
889 
892 
893  FOR_EACH_CLIENT(client) {
895  }
896 
898 
899 }

◆ SV_StuffCmd_c()

static void SV_StuffCmd_c ( genctx_t *  ctx,
int  argnum 
)
static

Definition at line 1343 of file commands.c.

1344 {
1345  if (argnum == 1) {
1346  Prompt_AddMatch(ctx, "connect");
1347  Prompt_AddMatch(ctx, "begin");
1348  }
1349 }

◆ SV_StuffCvar_f()

static void SV_StuffCvar_f ( void  )
static

Definition at line 908 of file commands.c.

909 {
910  int i, argc = Cmd_Argc();
911  char *c;
912 
913  if (!svs.initialized) {
914  Com_Printf("No server running.\n");
915  return;
916  }
917 
918  if (argc < 3) {
919  Com_Printf("Usage: %s <userid> <variable> [...]\n", Cmd_Argv(0));
920  return;
921  }
922 
923  if (!SV_SetPlayer())
924  return;
925 
926  for (i = 2; i < argc; i++) {
927  c = Cmd_Argv(i);
928  SV_ClientCommand(sv_client, "cmd \177c console %s $%s\n", c, c);
930  }
931 
932  sv_client = NULL;
933  sv_player = NULL;
934 }

Variable Documentation

◆ c_server

const cmdreg_t c_server[]
static

Definition at line 1548 of file commands.c.

Referenced by SV_InitOperatorCommands().

◆ filteractions

const char filteractions[FA_MAX][8]
static
Initial value:
= {
"ignore", "print", "stuff", "kick"
}

Definition at line 1351 of file commands.c.

Referenced by SV_AddFilterCmd_c(), SV_AddFilterCmd_f(), and SV_ListFilterCmds_f().

sv_blacklist
list_t sv_blacklist
sv_pending_autosave
qboolean sv_pending_autosave
Definition: main.c:35
client_s::version_string
char * version_string
Definition: server.h:282
stuffcmd_t::string
char string[1]
Definition: server.h:407
SV_Shutdown
void SV_Shutdown(const char *finalmsg, error_type_t type)
Definition: main.c:2252
stuffcmd_t
Definition: server.h:404
SV_DelMatch_f
void SV_DelMatch_f(list_t *list)
Definition: commands.c:1119
MVD_SPAWN_DISABLED
#define MVD_SPAWN_DISABLED
Definition: server.h:94
filtercmd_t::action
filteraction_t action
Definition: server.h:421
Cvar_Set
cvar_t * Cvar_Set(const char *var_name, const char *value)
Definition: cvar.c:466
CM_FreeMap
void CM_FreeMap(cm_t *cm)
Definition: cmodel.c:47
cs_spawned
@ cs_spawned
Definition: server.h:192
SV_MvdStatus_f
void SV_MvdStatus_f(void)
Definition: mvd.c:1912
Com_TimeDiff
size_t Com_TimeDiff(char *buffer, size_t size, time_t *p, time_t now)
Definition: utils.c:443
addrmatch_t::entry
list_t entry
Definition: server.h:396
svs
server_static_t svs
Definition: init.c:21
NET_AdrToString
char * NET_AdrToString(const netadr_t *a)
Definition: net.c:257
sv_masterlist
list_t sv_masterlist
sv_banlist
list_t sv_banlist
Cvar_BitInfo
size_t Cvar_BitInfo(char *info, int bit)
Definition: cvar.c:1109
abort_func
static void abort_func(void *arg)
Definition: commands.c:261
c_server
static const cmdreg_t c_server[]
Definition: commands.c:1548
Q_snprintf
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
Definition: shared.c:846
client_s::moves_per_sec
int moves_per_sec
Definition: server.h:295
SV_SetPlayer
static qboolean SV_SetPlayer(void)
Definition: commands.c:228
client_s::protocol
int protocol
Definition: server.h:324
PL_C2S
#define PL_C2S(cl)
Definition: server.h:244
client_s::downloadname
char * downloadname
Definition: server.h:318
Cmd_AddCommand
void Cmd_AddCommand(const char *name, xcommand_t function)
Definition: cmd.c:1562
master_t
Definition: server.h:429
stuffcmd_t::entry
list_t entry
Definition: server.h:405
client_s::has_zlib
qboolean has_zlib
Definition: server.h:267
dump_time
static void dump_time(void)
Definition: commands.c:599
FOR_EACH_MASTER_SAFE
#define FOR_EACH_MASTER_SAFE(m, n)
Definition: server.h:449
sv_enhanced_setplayer
cvar_t * sv_enhanced_setplayer
Definition: main.c:85
client_s::state
clstate_t state
Definition: server.h:260
PL_S2C
#define PL_S2C(cl)
Definition: server.h:242
MSG_CLEAR
#define MSG_CLEAR
Definition: server.h:215
client_s::number
int number
Definition: server.h:262
MSG_RELIABLE
#define MSG_RELIABLE
Definition: server.h:214
MAX_MASTERS
#define MAX_MASTERS
Definition: server.h:426
addrmatch_t::time
time_t time
Definition: server.h:400
addrmatch_t::hits
unsigned hits
Definition: server.h:399
Com_AbortFunc
void Com_AbortFunc(void(*func)(void *), void *arg)
Definition: common.c:588
filteraction_t
filteraction_t
Definition: server.h:410
addrmatch_t::comment
char comment[1]
Definition: server.h:401
dump_downloads
static void dump_downloads(void)
Definition: commands.c:571
client_s::downloadcount
int downloadcount
Definition: server.h:317
addrmatch_t::mask
netadr_t mask
Definition: server.h:398
Cvar_CountLatchedVars
int Cvar_CountLatchedVars(void)
Definition: cvar.c:649
filteractions
static const char filteractions[FA_MAX][8]
Definition: commands.c:1351
SV_AutoSaveBegin
void SV_AutoSaveBegin(mapcmd_t *cmd)
Definition: save.c:474
SV_ConSay_f
static void SV_ConSay_f(void)
Definition: commands.c:721
other
@ other
Definition: ogg.c:63
SV_ListMatches_f
void SV_ListMatches_f(list_t *list)
Definition: commands.c:1176
sv_client
client_t * sv_client
Definition: main.c:32
Cmd_RawArgsFrom
char * Cmd_RawArgsFrom(int from)
Definition: cmd.c:1021
MSG_WriteByte
void MSG_WriteByte(int c)
Definition: msg.c:107
Cmd_Argv
char * Cmd_Argv(int arg)
Definition: cmd.c:899
svc_stufftext
#define svc_stufftext
Definition: g_local.h:41
Cmd_Argc
int Cmd_Argc(void)
Definition: cmd.c:889
SV_ClientAddMessage
void SV_ClientAddMessage(client_t *client, int flags)
Definition: send.c:399
Prompt_AddMatch
qboolean Prompt_AddMatch(genctx_t *ctx, const char *s)
Definition: prompt.c:149
FOR_EACH_MASTER
#define FOR_EACH_MASTER(m)
Definition: server.h:447
FOR_EACH_CLIENT
#define FOR_EACH_CLIENT(client)
Definition: server.h:239
sv_allow_map
cvar_t * sv_allow_map
Definition: main.c:81
FA_IGNORE
@ FA_IGNORE
Definition: server.h:411
addrmatch_t::addr
netadr_t addr
Definition: server.h:397
client_s::console_queries
int console_queries
Definition: server.h:285
Cmd_ArgsFrom
char * Cmd_ArgsFrom(int from)
Definition: cmd.c:981
server_static_s::last_heartbeat
unsigned last_heartbeat
Definition: server.h:466
HEARTBEAT_SECONDS
#define HEARTBEAT_SECONDS
Definition: server.h:427
dedicated
cvar_t * dedicated
Definition: g_main.c:46
client_s::download
byte * download
Definition: server.h:315
format_mask
static size_t format_mask(addrmatch_t *match, char *buf, size_t buf_size)
Definition: commands.c:1050
sv
server_t sv
Definition: init.c:22
SV_ParseMapCmd
qboolean SV_ParseMapCmd(mapcmd_t *cmd)
Definition: init.c:285
filtercmd_t
Definition: server.h:419
msg_write
sizebuf_t msg_write
Definition: msg.c:34
SV_SpawnServer
void SV_SpawnServer(mapcmd_t *cmd)
Definition: init.c:139
SV_Map
static void SV_Map(qboolean restart)
Definition: commands.c:266
NET_BaseAdrToString
char * NET_BaseAdrToString(const netadr_t *a)
Definition: net.c:216
client_s::lastactivity
unsigned lastactivity
Definition: server.h:289
FS_File_g
void FS_File_g(const char *path, const char *ext, unsigned flags, genctx_t *ctx)
Definition: files.c:2954
Z_Free
void Z_Free(void *ptr)
Definition: zone.c:147
dump_versions
static void dump_versions(void)
Definition: commands.c:556
server_static_s::client_pool
client_t * client_pool
Definition: server.h:456
dump_lag
static void dump_lag(void)
Definition: commands.c:621
server_static_s::initialized
qboolean initialized
Definition: server.h:453
FA_MAX
@ FA_MAX
Definition: server.h:416
Cmd_Register
void Cmd_Register(const cmdreg_t *reg)
Definition: cmd.c:1572
m
static struct mdfour * m
Definition: mdfour.c:32
cs_zombie
@ cs_zombie
Definition: server.h:187
SV_ClientCommand
void SV_ClientCommand(client_t *client, const char *fmt,...)
Definition: send.c:185
dump_protocols
static void dump_protocols(void)
Definition: commands.c:637
SV_FindStuffList
static list_t * SV_FindStuffList(void)
Definition: commands.c:1232
NET_StringToAdr
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
Definition: net.c:332
SV_AutoSaveEnd
void SV_AutoSaveEnd(void)
Definition: save.c:516
Com_LPrintf
void Com_LPrintf(print_type_t type, const char *fmt,...)
Definition: g_main.c:242
client_s::lastmessage
unsigned lastmessage
Definition: server.h:288
sv_clientlist
list_t sv_clientlist
client_s::version
int version
Definition: server.h:325
Info_Print
void Info_Print(const char *infostring)
Definition: shared.c:1235
ge
game_export_t * ge
Definition: game.c:22
mapcmd_t
Definition: server.h:437
client_s::connect_time
time_t connect_time
Definition: server.h:361
SV_DropClient
void SV_DropClient(client_t *client, const char *reason)
Definition: main.c:212
SV_Player_g
static void SV_Player_g(genctx_t *ctx)
Definition: commands.c:196
SV_PrintMiscInfo
void SV_PrintMiscInfo(void)
Definition: commands.c:777
cl
client_state_t cl
Definition: main.c:99
client_s::http_download
qboolean http_download
Definition: server.h:272
server_t::cm
cm_t cm
Definition: server.h:161
COM_IsUint
qboolean COM_IsUint(const char *s)
Definition: shared.c:330
MSG_WriteString
void MSG_WriteString(const char *string)
Definition: msg.c:160
c
statCounters_t c
Definition: main.c:30
mapcmd_t::cm
cm_t cm
Definition: server.h:444
mapcmd_t::endofunit
qboolean endofunit
Definition: server.h:443
parse_mask
static qboolean parse_mask(char *s, netadr_t *addr, netadr_t *mask)
Definition: commands.c:1013
cs_assigned
@ cs_assigned
Definition: server.h:189
sv_filterlist
list_t sv_filterlist
Com_Quit
void Com_Quit(const char *reason, error_type_t type)
Definition: common.c:609
SV_InitGame
void SV_InitGame(unsigned mvd_spawn)
Definition: init.c:361
client_s::settings
int settings[CLS_MAX]
Definition: server.h:326
should_really_restart
static int should_really_restart(void)
Definition: commands.c:372
sv_recycle
cvar_t * sv_recycle
Definition: main.c:83
server_static_s::realtime
unsigned realtime
Definition: server.h:454
filtercmd_t::comment
char * comment
Definition: server.h:422
Cmd_ArgvBuffer
size_t Cmd_ArgvBuffer(int arg, char *buffer, size_t size)
Definition: cmd.c:912
dump_clients
static void dump_clients(void)
Definition: commands.c:510
cs_primed
@ cs_primed
Definition: server.h:191
SV_ClientPrintf
void SV_ClientPrintf(client_t *client, int level, const char *fmt,...)
Definition: send.c:121
server_t::state
server_state_t state
Definition: server.h:146
mapcmd_t::buffer
char buffer[MAX_QPATH]
Definition: server.h:438
filtercmd_t::string
char string[1]
Definition: server.h:423
sv_player
edict_t * sv_player
Definition: main.c:33
client_s::ping
int ping
Definition: server.h:297
client_s::max_ping
int max_ping
Definition: server.h:297
dump_settings
static void dump_settings(void)
Definition: commands.c:654
client_s::netchan
netchan_t * netchan
Definition: server.h:357
client_s
Definition: server.h:256
SV_NoSaveGames
int SV_NoSaveGames(void)
Definition: save.c:460
client_s::downloadsize
int downloadsize
Definition: server.h:316
FS_EasyWriteFile
qboolean FS_EasyWriteFile(char *buf, size_t size, unsigned mode, const char *dir, const char *name, const char *ext, const void *data, size_t len)
Definition: files.c:1960
client_s::numpackets
int numpackets
Definition: server.h:358
client_s::min_ping
int min_ping
Definition: server.h:297
client_s::rate
size_t rate
Definition: server.h:278
sv_cmdlist_begin
list_t sv_cmdlist_begin
filtercmd_t::entry
list_t entry
Definition: server.h:420
addrmatch_t
Definition: server.h:395
AVG_PING
#define AVG_PING(cl)
Definition: server.h:246
stuffcmd_t::len
int len
Definition: server.h:406
client_s::userinfo
char userinfo[MAX_INFO_STRING]
Definition: server.h:275
SV_AddMatch_f
void SV_AddMatch_f(list_t *list)
Definition: commands.c:1082
sv_cmdlist_connect
list_t sv_cmdlist_connect
cs_connected
@ cs_connected
Definition: server.h:190
server_t::name
char name[MAX_QPATH]
Definition: server.h:160
SZ_Clear
void SZ_Clear(sizebuf_t *buf)
Definition: sizebuf.c:40
SV_GetPlayer
client_t * SV_GetPlayer(const char *s, qboolean partial)
Definition: commands.c:127
client_s::name
char name[MAX_CLIENT_NAME]
Definition: server.h:276
client_s::edict
edict_t * edict
Definition: server.h:261
sv_maxclients
cvar_t * sv_maxclients
Definition: main.c:58
make_mask
static void make_mask(netadr_t *mask, netadrtype_t type, int bits)
Definition: commands.c:1003
Cmd_RawArgs
char * Cmd_RawArgs(void)
Definition: cmd.c:951