Quake II RTX doxygen
1.0 dev
|
|
Go to the documentation of this file.
48 Com_Printf(
"Only dedicated servers use masters.\n");
63 Com_Printf(
"Too many masters.\n");
69 Com_Printf(
"Bad master address: %s\n", s);
74 if (NET_IsEqualBaseAdr(&
m->adr, &adr)) {
75 Com_Printf(
"Ignoring duplicate master at %s.\n",
NET_AdrToString(&adr));
82 m = Z_Malloc(
sizeof(*
m) + len);
83 memcpy(
m->name, s, len + 1);
86 m->last_resolved = time(NULL);
107 Com_Printf(
"There are no masters.\n");
111 Com_Printf(
"num hostname lastmsg address\n"
112 "--- --------------------- ------- ---------------------\n");
117 }
else if (!
m->last_ack) {
118 strcpy(buf,
"never");
123 Com_Printf(
"%3d %-21.21s %7s %-21s\n", ++i,
m->name, buf, adr);
140 Com_Printf(
"Bad client slot number: %d\n", i);
146 Com_Printf(
"Client slot %d is not active.\n", i);
157 if (!strcmp(
other->name, s)) {
163 Com_Printf(
"Userid '%s' is not on the server.\n", s);
174 if (!Q_stricmp(
other->name, s)) {
177 if (Q_stristr(
other->name, s)) {
184 Com_Printf(
"No clients matching '%s' found.\n", s);
189 Com_Printf(
"'%s' matches multiple clients.\n", s);
271 memset(&cmd, 0,
sizeof(cmd));
275 if (len >=
sizeof(cmd.
buffer)) {
276 Com_Printf(
"Refusing to process oversize level string.\n");
324 Com_Printf(
"'%s' command is no longer supported.\n",
Cmd_Argv(0));
326 Com_Printf(
"To play a client demo, use 'demo' command instead.\n");
329 Com_Printf(
"To play a MVD, use 'mvdplay' command.\n");
354 Com_Printf(
"Usage: %s <mapname>\n",
Cmd_Argv(0));
374 static qboolean warned;
397 "Using 'map' will cause full server restart. "
398 "Use 'gamemap' for changing maps.\n");
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");
424 Com_Printf(
"Usage: %s <mapname>\n",
Cmd_Argv(0));
438 FS_File_g(
"maps",
".bsp", FS_SEARCH_STRIPEXT, ctx);
444 bsp_t *
c =
sv.
cm.cache;
445 char buffer[MAX_OSPATH];
447 if (!
c || !
c->entitystring) {
448 Com_Printf(
"No map loaded.\n");
453 Com_Printf(
"Usage: %s <filename>\n",
Cmd_Argv(0));
458 "maps/",
Cmd_Argv(1),
".ent",
c->entitystring,
c->numentitychars)) {
459 Com_Printf(
"Dumped entity string to %s\n", buffer);
465 static void make_mask(netadr_t *mask, netadrtype_t type,
int bits);
477 Com_Printf(
"No server running.\n");
482 Com_Printf(
"Usage: %s <userid>\n",
Cmd_Argv(0));
493 if (!strcmp(
Cmd_Argv(0),
"kickban")) {
495 if (addr->type == NA_IP || addr->type == NA_IP6) {
498 make_mask(&match->
mask, addr->type, addr->type == NA_IP6 ? 128 : 32);
515 "num score ping name lastmsg address rate pr fps\n"
516 "--- ----- ---- --------------- ------- --------------------- ----- -- ---\n");
518 Com_Printf(
"%3i %5i ", client->
number,
519 client->
edict->client->ps.stats[STAT_FRAGS]);
521 switch (client->
state) {
541 Com_Printf(
"%4i ", client->
ping < 9999 ? client->
ping : 9999);
545 Com_Printf(
"%-15.15s ", client->
name);
548 &client->
netchan->remote_address));
549 Com_Printf(
"%5"PRIz
" ", client->
rate);
550 Com_Printf(
"%2i ", client->
protocol);
562 "--- --------------- -----------------------------------------\n");
565 Com_Printf(
"%3i %-15.15s %-40.40s\n",
578 "num name download size done\n"
579 "--- --------------- ---------------------------------------- ------- ----\n");
589 name =
"<HTTP download>";
594 Com_Printf(
"%3i %-15.15s %-40.40s %-7d %3d%%\n",
595 client->
number, client->
name, name, size, percent);
602 char buffer[MAX_QPATH];
603 time_t clock = time(NULL);
607 "num name idle time\n"
608 "--- --------------- ---- --------\n");
616 Com_Printf(
"%3i %-15.15s %4u %s\n",
626 "num name PLs2c PLc2s Rmin Ravg Rmax dup\n"
627 "--- --------------- ----- ----- ---- ---- ---- ---\n");
630 Com_Printf(
"%3i %-15.15s %5.2f %5.2f %4d %4d %4d %3d\n",
642 "num name major minor msglen zlib chan\n"
643 "--- --------------- ----- ----- ------ ---- ----\n");
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");
660 "num name proto options upd fps\n"
661 "--- --------------- ----- ------- --- ---\n");
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]);
686 Com_Printf(
"No server running.\n");
691 Com_Printf(
"Current map: %s\n\n",
sv.
name);
695 Com_Printf(
"No UDP clients.\n");
727 Com_Printf(
"No server running.\n");
732 Com_Printf(
"Usage: %s <raw text>\n",
Cmd_Argv(0));
769 char serverinfo[MAX_INFO_STRING];
773 Com_Printf(
"Server info settings:\n");
779 char buffer[MAX_QPATH];
781 Com_Printf(
"version %s\n",
783 Com_Printf(
"protocol (maj/min) %d/%d\n",
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));
802 Com_Printf(
"connection time %s\n", buffer);
815 Com_Printf(
"No server running.\n");
820 Com_Printf(
"Usage: %s <userid>\n",
Cmd_Argv(0));
827 Com_Printf(
"\nuserinfo\n");
828 Com_Printf(
"--------\n");
831 Com_Printf(
"\nmiscinfo\n");
832 Com_Printf(
"--------\n");
849 Com_Printf(
"No server running.\n");
854 Com_Printf(
"Usage: %s <userid> <raw text>\n",
Cmd_Argv(0));
881 Com_Printf(
"No server running.\n");
886 Com_Printf(
"Usage: %s <raw text>\n",
Cmd_Argv(0));
914 Com_Printf(
"No server running.\n");
919 Com_Printf(
"Usage: %s <userid> <variable> [...]\n",
Cmd_Argv(0));
926 for (i = 2; i < argc; i++) {
942 Com_Printf(
"No server running.\n");
946 Com_Printf(
"Single player server running.\n");
951 Com_Printf(
"Usage: %s <address>\n",
Cmd_Argv(0));
957 Com_Printf(
"Bad client address: %s\n", s);
960 if (address.port == 0) {
961 Com_Printf(
"Please specify client port explicitly.\n");
965 OOB_PRINT(NS_SERVER, &address,
"passive_connect\n");
979 Com_Printf(
"No server running.\n");
983 SV_Shutdown(
"Server was killed.\n", ERR_DISCONNECT);
996 Com_Printf(
"No game loaded.\n");
1000 ge->ServerCommand();
1003 static void make_mask(netadr_t *mask, netadrtype_t type,
int bits)
1005 memset(mask, 0,
sizeof(*mask));
1007 memset(mask->ip.u8, 0xff, bits >> 3);
1009 mask->ip.u8[bits >> 3] = ~((1 << (8 - (bits & 7))) - 1);
1013 static qboolean
parse_mask(
char *s, netadr_t *addr, netadr_t *mask)
1022 Com_Printf(
"Please specify a mask after '/'.\n");
1030 if (!NET_StringToBaseAdr(s, addr)) {
1031 Com_Printf(
"Bad address: %s\n", s);
1035 size = (addr->type == NA_IP6) ? 128 : 32;
1041 if (bits < 1 || bits > size) {
1042 Com_Printf(
"Bad mask: %d bits\n", bits);
1052 int i, j, bits, size;
1054 size = (match->
mask.type == NA_IP6) ? 128 : 32;
1057 for (i = 0; i < size >> 3; i++) {
1058 int c = match->
mask.ip.u8[i];
1069 for (j = 0; j < 8; j++) {
1070 if (!(
c & (1 << (7 - j)))) {
1084 char *s, buf[MAX_QPATH];
1086 netadr_t addr, mask;
1090 Com_Printf(
"Usage: %s <address[/mask]> [comment]\n",
Cmd_Argv(0));
1100 if (NET_IsEqualBaseAdr(&match->
addr, &addr) &&
1101 NET_IsEqualBaseAdr(&match->
mask, &mask)) {
1103 Com_Printf(
"Entry %s already exists.\n", buf);
1110 match = Z_Malloc(
sizeof(*match) + len);
1115 memcpy(match->
comment, s, len + 1);
1116 List_Append(list, &match->
entry);
1123 netadr_t addr, mask;
1127 Com_Printf(
"Usage: %s <address[/mask]|id|all>\n",
Cmd_Argv(0));
1131 if (LIST_EMPTY(list)) {
1132 Com_Printf(
"Address list is empty.\n");
1137 if (!strcmp(s,
"all")) {
1138 LIST_FOR_EACH_SAFE(
addrmatch_t, match, next, list, entry) {
1149 Com_Printf(
"Bad index: %d\n", i);
1152 match = LIST_INDEX(
addrmatch_t, i - 1, list, entry);
1156 Com_Printf(
"No such index: %d\n", i);
1165 if (NET_IsEqualBaseAdr(&match->
addr, &addr) &&
1166 NET_IsEqualBaseAdr(&match->
mask, &mask)) {
1168 List_Remove(&match->
entry);
1173 Com_Printf(
"No such entry: %s\n", s);
1179 char last[MAX_QPATH];
1180 char addr[MAX_QPATH];
1183 if (LIST_EMPTY(list)) {
1184 Com_Printf(
"Address list is empty.\n");
1188 Com_Printf(
"id address/mask hits last hit comment\n"
1189 "-- ------------------ ---- ------------ -------\n");
1194 strcpy(last,
"never");
1196 struct tm *tm = localtime(&match->
time);
1197 if (!tm || !strftime(last,
sizeof(last),
"%d %b %H:%M", tm))
1198 strcpy(last,
"???");
1200 Com_Printf(
"%-2d %-18s %-4u %-12s %s\n", count, addr,
1236 if (!strcmp(s,
"connect")) {
1239 if (!strcmp(s,
"begin")) {
1242 Com_Printf(
"Unknown stuffcmd list: %s\n", s);
1254 Com_Printf(
"Usage: %s <list> <command>\n",
Cmd_Argv(0));
1264 stuff = Z_Malloc(
sizeof(*stuff) + len);
1266 memcpy(stuff->
string, s, len + 1);
1267 List_Append(list, &stuff->
entry);
1278 Com_Printf(
"Usage: %s <list> <id|all>\n",
Cmd_Argv(0));
1286 if (LIST_EMPTY(list)) {
1287 Com_Printf(
"No stuffcmds registered.\n");
1292 if (!strcmp(s,
"all")) {
1293 LIST_FOR_EACH_SAFE(
stuffcmd_t, stuff, next, list, entry) {
1301 Com_Printf(
"Bad stuffcmd index: %d\n", i);
1304 stuff = LIST_INDEX(
stuffcmd_t, i - 1, list, entry);
1306 Com_Printf(
"No such stuffcmd index: %d\n", i);
1310 List_Remove(&stuff->
entry);
1321 Com_Printf(
"Usage: %s <list>\n",
Cmd_Argv(0));
1329 if (LIST_EMPTY(list)) {
1330 Com_Printf(
"No stuffcmds registered.\n");
1334 Com_Printf(
"id command\n"
1337 LIST_FOR_EACH(
stuffcmd_t, stuff, list, entry) {
1338 Com_Printf(
"%-2d %s\n", count, stuff->
string);
1352 "ignore",
"print",
"stuff",
"kick"
1364 Com_Printf(
"Usage: %s <command> [ignore|print|stuff|kick] [comment]\n",
Cmd_Argv(0));
1370 for (action = 0; action <
FA_MAX; action++) {
1387 if (!Q_stricmp(filter->
string, s)) {
1388 Com_Printf(
"Filtercmd already exists: %s\n", s);
1393 filter = Z_Malloc(
sizeof(*filter) + len);
1394 memcpy(filter->
string, s, len + 1);
1396 filter->
comment = Z_CopyString(comment);
1405 for (action = 0; action <
FA_MAX; action++) {
1418 Com_Printf(
"Usage: %s <id|cmd|all>\n",
Cmd_Argv(0));
1423 Com_Printf(
"No filtercmds registered.\n");
1428 if (!strcmp(s,
"all")) {
1439 Com_Printf(
"Bad filtercmd index: %d\n", i);
1444 Com_Printf(
"No such filtercmd index: %d\n", i);
1449 if (!Q_stricmp(filter->
string, s)) {
1453 Com_Printf(
"No such filtercmd string: %s\n", s);
1458 List_Remove(&filter->
entry);
1471 ctx->ignorecase = qtrue;
1487 Com_Printf(
"No filtercmds registered.\n");
1491 Com_Printf(
"id command action comment\n"
1492 "-- ---------------- ------ -------\n");
1495 Com_Printf(
"%-2d %-16s %-6s %s\n", count,
1502 #if USE_MVD_CLIENT || USE_MVD_SERVER
1505 {
"h",
"help",
"display this message" },
1506 {
"z",
"compress",
"compress file with gzip" },
1510 static void SV_Record_c(genctx_t *ctx,
int argnum)
1520 static void SV_Record_f(
void)
1523 if (
sv.
state == ss_broadcast) {
1532 static void SV_Stop_f(
void)
1535 if (
sv.
state == ss_broadcast) {
1579 #if USE_MVD_CLIENT || USE_MVD_SERVER
1580 {
"mvdrecord", SV_Record_f, SV_Record_c },
1581 {
"mvdstop", SV_Stop_f },
qboolean sv_pending_autosave
static void SV_Serverinfo_f(void)
void SV_Shutdown(const char *finalmsg, error_type_t type)
void SV_DelMatch_f(list_t *list)
#define MVD_SPAWN_DISABLED
cvar_t * Cvar_Set(const char *var_name, const char *value)
void CM_FreeMap(cm_t *cm)
static void SV_Map_f(void)
void SV_MvdStatus_f(void)
size_t Com_TimeDiff(char *buffer, size_t size, time_t *p, time_t now)
char * NET_AdrToString(const netadr_t *a)
size_t Cvar_BitInfo(char *info, int bit)
static void abort_func(void *arg)
static void SV_SetPlayer_c(genctx_t *ctx, int argnum)
static const cmdreg_t c_server[]
size_t Q_snprintf(char *dest, size_t size, const char *fmt,...)
static qboolean SV_SetPlayer(void)
void Cmd_AddCommand(const char *name, xcommand_t function)
static void dump_time(void)
#define FOR_EACH_MASTER_SAFE(m, n)
cvar_t * sv_enhanced_setplayer
void MVD_StreamedStop_f(void)
static void SV_ServerCommand_f(void)
void Com_AbortFunc(void(*func)(void *), void *arg)
static void SV_DelBlackHole_f(void)
static void dump_downloads(void)
static void SV_Stuff_f(void)
static void SV_DelFilterCmd_f(void)
static void SV_ListBlackHoles_f(void)
static void SV_ListFilterCmds_f(void)
int Cvar_CountLatchedVars(void)
static const char filteractions[FA_MAX][8]
void SV_AutoSaveBegin(mapcmd_t *cmd)
static void SV_ConSay_f(void)
void SV_ListMatches_f(list_t *list)
static void SV_AddFilterCmd_f(void)
char * Cmd_RawArgsFrom(int from)
void MSG_WriteByte(int c)
static void SV_StuffAll_f(void)
void SV_ClientAddMessage(client_t *client, int flags)
qboolean Prompt_AddMatch(genctx_t *ctx, const char *s)
#define FOR_EACH_MASTER(m)
#define FOR_EACH_CLIENT(client)
void MVD_StreamedRecord_f(void)
char * Cmd_ArgsFrom(int from)
#define HEARTBEAT_SECONDS
static size_t format_mask(addrmatch_t *match, char *buf, size_t buf_size)
qboolean SV_ParseMapCmd(mapcmd_t *cmd)
void SV_SpawnServer(mapcmd_t *cmd)
static void SV_GameMap_f(void)
static void SV_Map(qboolean restart)
char * NET_BaseAdrToString(const netadr_t *a)
static void SV_StuffCmd_c(genctx_t *ctx, int argnum)
static void SV_ListBans_f(void)
void FS_File_g(const char *path, const char *ext, unsigned flags, genctx_t *ctx)
static void SV_DumpUser_f(void)
static void dump_versions(void)
static void dump_lag(void)
static void SV_AddBlackHole_f(void)
void Cmd_Register(const cmdreg_t *reg)
static void SV_DelFilterCmd_c(genctx_t *ctx, int argnum)
static void SV_Heartbeat_f(void)
void SV_ClientCommand(client_t *client, const char *fmt,...)
static void SV_SetMaster_f(void)
static void SV_AddBan_f(void)
static void dump_protocols(void)
static void SV_DemoMap_f(void)
static list_t * SV_FindStuffList(void)
qboolean NET_StringToAdr(const char *s, netadr_t *a, int default_port)
void SV_AutoSaveEnd(void)
void Com_LPrintf(print_type_t type, const char *fmt,...)
static void SV_DelStuffCmd_f(void)
void Info_Print(const char *infostring)
void SV_DropClient(client_t *client, const char *reason)
static const cmd_option_t o_record[]
static void SV_Player_g(genctx_t *ctx)
void SV_PrintMiscInfo(void)
void SV_InitOperatorCommands(void)
static void SV_DelBan_f(void)
qboolean COM_IsUint(const char *s)
void MSG_WriteString(const char *string)
static void SV_PickClient_f(void)
static qboolean parse_mask(char *s, netadr_t *addr, netadr_t *mask)
void Com_Quit(const char *reason, error_type_t type)
void SV_InitGame(unsigned mvd_spawn)
static int should_really_restart(void)
static void SV_ListMasters_f(void)
static void SV_ListStuffCmds_f(void)
static void SV_AddFilterCmd_c(genctx_t *ctx, int argnum)
size_t Cmd_ArgvBuffer(int arg, char *buffer, size_t size)
static void dump_clients(void)
void MVD_File_g(genctx_t *ctx)
void SV_ClientPrintf(client_t *client, int level, const char *fmt,...)
static void SV_KillServer_f(void)
static void dump_settings(void)
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)
static void SV_DumpEnts_f(void)
void SV_MvdRecord_f(void)
char userinfo[MAX_INFO_STRING]
static void SV_StuffCvar_f(void)
void SV_AddMatch_f(list_t *list)
list_t sv_cmdlist_connect
static void SV_AddStuffCmd_f(void)
static void SV_Status_f(void)
void SZ_Clear(sizebuf_t *buf)
static void SV_Kick_f(void)
client_t * SV_GetPlayer(const char *s, qboolean partial)
static void SV_Map_c(genctx_t *ctx, int argnum)
char name[MAX_CLIENT_NAME]
static void make_mask(netadr_t *mask, netadrtype_t type, int bits)