31cvar_t sv_status_show_qcstatus = {
CF_SERVER |
CF_ARCHIVE,
"sv_status_show_qcstatus",
"0",
"show the 'qcstatus' field in status replies, not the 'frags' field. Turn this on if your mod uses this field, and the 'frags' field on the other hand has no meaningful value."};
55 Con_Print(
"map <levelname> : start a new game (kicks off all players)\n");
97 Con_Print(
"changelevel <levelname> : continue game on a new level\n");
128 Con_Print(
"restart : restart current level\n");
133 Con_Print(
"Only the server may restart\n");
247 else if (t[0] ==
'9')
249 else if (t[0] ==
'0')
251 else if (t[0] >=
'2')
444 print(
"Pause not allowed.\n");
469 qbool fromServer =
false;
491 if (!fromServer && !teamonly)
493 else if (!fromServer && teamonly)
500 while ((
const char *)p2 > (
const char *)text && (p2[-1] ==
'\r' || p2[-1] ==
'\n' || (p2[-1] ==
'\"' && quoted)))
502 if (p2[-1] ==
'\"' && quoted)
532 const char *playername_start =
NULL;
533 size_t playername_length = 0;
534 int playernumber = 0;
539 qbool fromServer =
false;
558 while (p1 < p2 && *p1 ==
' ')
563 while (p1 < p2 && *p1 ==
' ')
565 while (p1 < p2 && isdigit(*p1))
567 playernumber = playernumber * 10 + (*p1 -
'0');
575 playername_start = p1;
576 while (p1 < p2 && *p1 !=
'"')
578 playername_length = p1 - playername_start;
584 playername_start = p1;
585 while (p1 < p2 && *p1 !=
' ')
587 playername_length = p1 - playername_start;
589 while (p1 < p2 && *p1 ==
' ')
595 if(playername_length >=
sizeof(namebuf))
598 Con_Print(
"Host_Tell: too long player name/ID\n");
603 memcpy(namebuf, playername_start, playername_length);
604 namebuf[playername_length] = 0;
605 for (playernumber = 0; playernumber <
svs.
maxclients; playernumber++)
609 if (strcasecmp(
svs.
clients[playernumber].name, namebuf) == 0)
616 Con_Print(
"Host_Tell: invalid player name/ID\n");
622 while (p2 > p1 && (p2[-1] ==
'\n' || p2[-1] ==
'\r'))
631 Con_Print(
"Host_Tell: missing end quote\n");
635 while (p2 > p1 && (p2[-1] ==
'\n' || p2[-1] ==
'\r'))
639 for (j = (
int)
strlen(text);j < (
int)(
sizeof(text) - 2) && p1 < p2;)
670 print(
"Client ping times:\n");
688 int i, j,
ping, packetloss, movementloss;
728 dpsnprintf(temp,
sizeof(temp),
" %d %d,%d",
ping, packetloss, movementloss);
748 int seconds = 0, minutes = 0, hours = 0,
i, j, k, in, players,
ping = 0, packetloss = 0;
783 print (
"^2IP %%pl ping time frags no name\n");
785 print (
"^5IP no name\n");
794 if (in == 0 || in == 1)
801 hours = minutes / 60;
803 minutes -= (hours * 60);
833 for(q = str; *q && p != qcstatus +
sizeof(qcstatus) - 1; ++q)
838 frags = atoi(qcstatus);
859 print (
"%s%-47s %2i %4i %2i:%02i:%02i %4i #%-3u ^7%s\n", k%2 ?
"^3" :
"^7", ip, packetloss,
ping, hours, minutes,
seconds,
frags,
i+1, client->
name);
863 print (
"%s%-47s #%-3u ^7%s\n", k%2 ?
"^3" :
"^7", ip,
i+1, client->
name);
894 const char *newNameSource;
905 dp_strlcpy(newName, newNameSource,
sizeof(newName));
1017 int top, bottom, playercolor;
1025 playercolor = top*16 + bottom;
1068 qbool byNumber =
false;
1128 SV_DropClient (
false,
va(reason,
sizeof(reason),
"Kicked by %s", who));
1146 Con_Print(
"maxplayers can not be changed while a server is running.\n");
1147 Con_Print(
"It will be changed on next server startup (\"map\" command).\n");
1181 for (
i = 0, j = 0;newPath[
i];
i++)
1182 if (newPath[
i] !=
'\r' && newPath[
i] !=
'\n')
1183 newPath[j++] = newPath[
i];
1228 for (
i = 0, j = 0;newPath[
i];
i++)
1229 if (newPath[
i] !=
'\r' && newPath[
i] !=
'\n')
1230 newPath[j++] = newPath[
i];
1419 const char *cvarname;
1456 print(
"Usage: ent_create <classname> [<key> <value> ... ]\n\nIf executing as a player, an entity of classname will spawn where you're aiming.\nOptional key-value pairs can be provided. If origin is provided, it will spawn the entity at that coordinate.\nHowever, an origin is required if the command is executed from a dedicated server console.\n");
1512 print(
"Missing origin\n");
1522 print(
"Could not spawn a \"%s\". No such entity or it has no spawn function\n",
Cmd_Argv(
cmd, 1));
1554 print(
"Cannot remove the world\n");
1575 if(!trace.
ent || !ednum)
1582 print(
"No edict given\n");
1607 print(
"No such entity\n");
1625 print(
"Cannot remove the world\n");
#define SUPERCONTENTS_BODY
#define SUPERCONTENTS_SOLID
cvar_t cl_name
User-visible names of these CF_USERINFO cvars must be matched in CL_SetInfo()!
void Cmd_AddCommand(unsigned flags, const char *cmd_name, xcommand_t function, const char *description)
called by the init functions of other parts of the program to register commands and functions to call...
@ src_client
came in over a net connection as a clc_stringcmd host_client will be valid during this state.
@ src_local
from the command buffer
#define CF_NOTIFY
cvar should trigger a chat notification to all connected clients when changed
#define CF_USERINFO
command or cvar used to communicate userinfo to the server
#define CF_SERVER
cvar/command that only the server can change/execute
static int Cmd_Argc(cmd_state_t *cmd)
static const char * Cmd_Argv(cmd_state_t *cmd, int arg)
Cmd_Argv(cmd, ) will return an empty string (not a NULL) if arg > argc, so string operations are alwa...
#define CF_SERVER_FROM_CLIENT
command the client is allowed to execute on the server as a stringcmd
#define CF_CHEAT
command or cvar that gives an unfair advantage over other players and is blocked unless sv_cheats is ...
static const char * Cmd_Args(cmd_state_t *cmd)
#define CF_ARCHIVE
cvar should have its set value saved to config.cfg and persist across sessions
cvar_t collision_extendmovelength
void MSG_WriteShort(sizebuf_t *sb, int c)
void MSG_WriteString(sizebuf_t *sb, const char *s)
void MSG_WriteByte(sizebuf_t *sb, int c)
void MSG_WriteUnterminatedString(sizebuf_t *sb, const char *s)
char * va(char *buf, size_t buflen, const char *format,...)
qbool COM_ParseToken_Simple(const char **datapointer, qbool returnnewline, qbool parsebackslash, qbool parsecomments)
int dpsnprintf(char *buffer, size_t buffersize, const char *format,...)
Returns the number of printed characters, excluding the final '\0' or returns -1 if the buffer isn't ...
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
@ PROTOCOL_QUAKEWORLD
quakeworld protocol
#define dp_strlcat(dst, src, dsize)
#define dp_strlcpy(dst, src, dsize)
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_Printf(const char *fmt,...)
Prints to all appropriate console targets.
void Con_DPrint(const char *msg)
A Con_Print that only shows up if the "developer" cvar is set.
void Cvar_SetQuick(cvar_t *var, const char *value)
const char * Cvar_VariableString(cvar_state_t *cvars, const char *var_name, unsigned neededflags)
void Cvar_Set(cvar_state_t *cvars, const char *var_name, const char *value)
equivelant to "<name> <variable>" typed at the console
void Cvar_RegisterVariable(cvar_t *variable)
registers a cvar that already has the name, string, and optionally the archive elements set.
void Cvar_RegisterCallback(cvar_t *variable, void(*callback)(cvar_t *))
char engineversion[128]
version string for the corner of the console, crash messages, status command, etc
#define STRING_COLOR_RGB_TAG_CHAR
#define STRING_COLOR_DEFAULT_STR
#define STRING_COLOR_DEFAULT
static int(ZEXPORT *qz_inflate)(z_stream *strm
GLenum GLuint GLenum GLsizei const GLchar * buf
static lhnetaddresstype_t LHNETADDRESS_GetAddressType(const lhnetaddress_t *address)
#define bound(min, num, max)
#define VectorSet(vec, x, y, z)
void Matrix4x4_Transform(const matrix4x4_t *in, const float v[3], float out[3])
void Matrix4x4_OriginFromMatrix(const matrix4x4_t *in, float *out)
model_t * Mod_ForName(const char *name, qbool crash, qbool checkdisk, const char *parentname)
#define NETGRAPH_LOSTPACKET
void PRVM_ED_ClearEdict(prvm_prog_t *prog, prvm_edict_t *e)
void PRVM_ED_CallPostspawnFunction(prvm_prog_t *prog, prvm_edict_t *ent)
#define PRVM_serverglobaledict(fieldname)
#define PRVM_EDICT_TO_PROG(e)
int PRVM_SetEngineString(prvm_prog_t *prog, const char *s)
#define PRVM_EDICT_NUM(n)
qbool PRVM_ED_ParseEpair(prvm_prog_t *prog, prvm_edict_t *ent, mdef_t *key, const char *s, qbool parsebackslash)
#define PRVM_NEXT_EDICT(e)
const char * PRVM_GetString(prvm_prog_t *prog, int num)
mdef_t * PRVM_ED_FindField(prvm_prog_t *prog, const char *name)
#define PRVM_serverglobalfloat(fieldname)
#define PRVM_serveredictfloat(ed, fieldname)
#define PRVM_serverfunction(funcname)
qbool PRVM_ED_CallSpawnFunction(prvm_prog_t *prog, prvm_edict_t *ent, const char *data, const char *start)
#define PRVM_serveredictstring(ed, fieldname)
void PRVM_ED_Free(prvm_prog_t *prog, prvm_edict_t *ed)
void PRVM_ED_CallPrespawnFunction(prvm_prog_t *prog, prvm_edict_t *ent)
prvm_edict_t * PRVM_ED_Alloc(prvm_prog_t *prog)
int Protocol_NumberForEnum(protocolversion_t p)
const char * Protocol_NameForEnum(protocolversion_t p)
#define qw_svc_updateping
#define MAX_INPUTLINE
maximum size of console commandline, QuakeC strings, and many other text processing buffers
#define MAX_SCOREBOARD
max number of players in game at once (255 protocol limit)
#define IT_GRENADE_LAUNCHER
#define HIT_PROXIMITY_GUN
void SV_SaveSpawnparms(void)
void SV_Begin_f(cmd_state_t *cmd)
void SV_BroadcastPrintf(const char *fmt,...) DP_FUNC_PRINTF(1)
void SV_Spawn_f(cmd_state_t *cmd)
void SV_Loadgame_f(cmd_state_t *cmd)
#define MOVETYPE_WALK
gravity
void SV_SpawnServer(const char *map)
trace_t SV_TraceLine(const vec3_t start, const vec3_t end, int type, prvm_edict_t *passedict, int hitsupercontentsmask, int skipsupercontentsmask, int skipmaterialflagsmask, float extend)
void SV_LinkEdict(prvm_edict_t *ent)
void SV_ClientPrint(const char *msg)
void SV_GetEntityMatrix(prvm_prog_t *prog, prvm_edict_t *ent, matrix4x4_t *out, qbool viewmatrix)
const char * SV_TimingReport(char *buf, size_t buflen)
for output in SV_Status_f
void SV_DropClient(qbool leaving, const char *reason,...)
void SV_Savegame_f(cmd_state_t *cmd)
server_static_t svs
persistant server info
void SV_ClientCommands(const char *fmt,...) DP_FUNC_PRINTF(1)
void SV_PreSpawn_f(cmd_state_t *cmd)
void SV_ClientPrintf(const char *fmt,...) DP_FUNC_PRINTF(1)
struct model_s * model_precache[MAX_MODELS]
char playermodel[MAX_QPATH]
qbool active
false = empty client slot
qbool begun
false = don't send datagrams
float nametime
prevent animated names
int rate
requested rate in bytes per second
char old_name[MAX_SCOREBOARDNAME]
char playerskin[MAX_QPATH]
char name[MAX_SCOREBOARDNAME]
netconn_t * netconnection
communications handle
int rate_burstsize
temporarily exceed rate by this amount of bytes
char old_model[MAX_QPATH]
prvm_edict_t * edict
PRVM_EDICT_NUM(clientnum+1)
double connecttime
realtime this client connected
float ping
LadyHavoc: can be used for prediction or whatever...
command interpreter state - the tokenizing and execution of commands, as well as pointers to which cv...
void(* ConnectLocal)(void)
void(* SV_SendCvar)(struct cmd_state_s *)
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
struct host_static_t::@12 hook
void(* Disconnect)(qbool, const char *,...)
void(* Draw)(struct entity_render_s *ent)
netgraphitem_t incoming_netgraph[NETGRAPH_PACKETS]
lhnetaddress_t peeraddress
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
qbool free
true if this edict is unused
qbool loaded
used to indicate whether a prog is loaded
int num_edicts
copies of some vars that were former read from sv
void(* ExecuteProgram)(struct prvm_prog_s *prog, func_t fnum, const char *errormessage)
pointer to one of the *VM_ExecuteProgram functions
union prvm_prog_t::@31 globals
struct client_s * clients
client slots
int maxclients
number of svs.clients slots (updated by maxplayers command)
int serverflags
episode completion information
char worldbasename[MAX_QPATH]
qbool active
false if only a net client
sizebuf_t reliable_datagram
protocolversion_t protocol
one of the PROTOCOL_ values
static void SV_Viewframe_f(cmd_state_t *cmd)
static void SV_SendCvar_f(cmd_state_t *cmd)
static void SV_Notarget_f(cmd_state_t *cmd)
cvar_t sv_status_show_qcstatus
static void SV_Ping_f(cmd_state_t *cmd)
static void SV_Viewmodel_f(cmd_state_t *cmd)
cvar_t sv_namechangetimer
static void PrintFrameName(model_t *m, int frame)
static void SV_Map_f(cmd_state_t *cmd)
static void SV_Color_f(cmd_state_t *cmd)
static void SV_Ent_Remove_f(cmd_state_t *cmd)
static void SV_PModel_f(cmd_state_t *cmd)
static void SV_Say_Team_f(cmd_state_t *cmd)
static void SV_Status_f(cmd_state_t *cmd)
static void SV_Changelevel_f(cmd_state_t *cmd)
static void SV_Pings_f(cmd_state_t *cmd)
static void SV_Playerskin_f(cmd_state_t *cmd)
static void SV_Kill_f(cmd_state_t *cmd)
static void SV_Say(cmd_state_t *cmd, qbool teamonly)
void SV_Name(int clientnum)
void SV_InitOperatorCommands(void)
static void SV_Restart_f(cmd_state_t *cmd)
static void SV_Give_f(cmd_state_t *cmd)
static void SV_Ent_Remove_All_f(cmd_state_t *cmd)
static void SV_Rate_BurstSize_f(cmd_state_t *cmd)
static void SV_Viewnext_f(cmd_state_t *cmd)
int current_skill
skill level for currently loaded level (in case the user changes the cvar while the level is running,...
static void SV_Noclip_f(cmd_state_t *cmd)
static void SV_Viewprev_f(cmd_state_t *cmd)
static void SV_Playermodel_f(cmd_state_t *cmd)
static void SV_Kick_f(cmd_state_t *cmd)
static void SV_DisableCheats_c(cvar_t *var)
static void SV_Rate_f(cmd_state_t *cmd)
static void SV_Name_f(cmd_state_t *cmd)
static prvm_edict_t * FindViewthing(prvm_prog_t *prog)
static void SV_Pause_f(cmd_state_t *cmd)
static void SV_God_f(cmd_state_t *cmd)
static void SV_MaxPlayers_f(cmd_state_t *cmd)
static void SV_Say_f(cmd_state_t *cmd)
static void SV_Fly_f(cmd_state_t *cmd)
static void SV_Ent_Create_f(cmd_state_t *cmd)
static void SV_Tell_f(cmd_state_t *cmd)
void SV_WriteNetnameIntoDemo(client_t *client)
size_t u8_COM_StringLengthNoColors(const char *_s, size_t size_s, qbool *valid)
#define Mem_Alloc(pool, size)