Quake II RTX doxygen
1.0 dev
|
|
Go to the source code of this file.
◆ create_baselines()
Definition at line 40 of file user.c.
44 entity_packed_t *base, **chunk;
58 if ((
g_features->integer & GMF_PROPERINUSE) && !ent->inuse) {
79 if (base->solid != PACKED_BSP)
Referenced by SV_New_f().
◆ handle_filtercmd()
◆ stuff_cmds()
static void stuff_cmds |
( |
list_t * |
list | ) |
|
|
static |
◆ stuff_junk()
Definition at line 321 of file user.c.
323 static const char junkchars[] =
324 "!~#``&'()*`+,-./~01~2`3`4~5`67`89:~<=`>?@~ab~c"
325 "d`ef~j~k~lm`no~pq`rst`uv`w``x`yz[`\\]^_`|~";
329 for (i = 0; i < 8; i++) {
330 for (j = 0; j < 15; j++) {
331 k = rand_byte() % (
sizeof(junkchars) - 1);
332 junk[i][j] = junkchars[k];
342 if (rand_byte() & 1) {
Referenced by SV_New_f().
◆ SV_AC_Info_f()
◆ SV_AC_List_f()
◆ SV_Begin_f()
Definition at line 488 of file user.c.
494 Com_DPrintf(
"Begin not valid -- not yet primed\n");
499 Com_DPrintf(
"Begin not valid -- already spawned\n");
517 Com_DPrintf(
"Going from cs_primed to cs_spawned for %s\n",
Referenced by AC_CheckTimeouts(), and AC_ParseQueryReply().
◆ SV_BeginDownload_f()
Definition at line 579 of file user.c.
581 char name[MAX_QPATH];
584 ssize_t downloadsize, maxdownloadsize, result;
591 if (len >= MAX_QPATH) {
596 if (!strcmp(name,
"http")) {
614 || strstr(name,
"..")
616 || !Q_ispath(name[0])
618 || !Q_ispath(name[len - 1])
620 || !strchr(name,
'/')) {
621 Com_DPrintf(
"Refusing download of %s to %s\n", name,
sv_client->
name);
625 if (FS_pathcmpn(name, CONST_STR_LEN(
"players/")) == 0) {
627 }
else if (FS_pathcmpn(name, CONST_STR_LEN(
"models/")) == 0 ||
628 FS_pathcmpn(name, CONST_STR_LEN(
"sprites/")) == 0) {
630 }
else if (FS_pathcmpn(name, CONST_STR_LEN(
"sound/")) == 0) {
632 }
else if (FS_pathcmpn(name, CONST_STR_LEN(
"maps/")) == 0) {
634 }
else if (FS_pathcmpn(name, CONST_STR_LEN(
"textures/")) == 0 ||
635 FS_pathcmpn(name, CONST_STR_LEN(
"env/")) == 0) {
637 }
else if (FS_pathcmpn(name, CONST_STR_LEN(
"pics/")) == 0) {
643 if (!allow->integer) {
644 Com_DPrintf(
"Refusing download of %s to %s\n", name,
sv_client->
name);
649 Com_DPrintf(
"Closing existing download for %s (should not happen)\n",
sv_client->
name);
654 downloadcmd = svc_download;
661 downloadsize =
FS_FOpenFile(name, &f, FS_MODE_READ | FS_FLAG_DEFLATE);
663 Com_DPrintf(
"Serving compressed download to %s\n",
sv_client->
name);
664 downloadcmd = svc_zdownload;
672 Com_DPrintf(
"Couldn't download %s to %s\n", name,
sv_client->
name);
677 maxdownloadsize = MAX_LOADFILE;
679 if (sv_max_download_size->integer) {
684 if (downloadsize == 0) {
685 Com_DPrintf(
"Refusing empty download of %s to %s\n", name,
sv_client->
name);
689 if (downloadsize > maxdownloadsize) {
690 Com_DPrintf(
"Refusing oversize download of %s to %s\n", name,
sv_client->
name);
694 if (offset > downloadsize) {
695 Com_DPrintf(
"Refusing download, %s has wrong version of %s (%d > %d)\n",
698 "Please delete the corresponding .tmp file from your system.\n");
702 if (offset == downloadsize) {
703 Com_DPrintf(
"Refusing download, %s already has %s (%d bytes)\n",
714 result =
FS_Read(download, downloadsize, f);
715 if (result != downloadsize) {
716 Com_DPrintf(
"Couldn't download %s to %s\n", name,
sv_client->
name);
729 Com_DPrintf(
"Downloading %s to %s\n", name,
sv_client->
name);
◆ SV_ClientThink()
static void SV_ClientThink |
( |
usercmd_t * |
cmd | ) |
|
|
inlinestatic |
Definition at line 1043 of file user.c.
1051 Com_DPrintf(
"commandMsec underflow from %s: %d\n",
1056 if (cmd->buttons != old->buttons
1057 || cmd->forwardmove != old->forwardmove
1058 || cmd->sidemove != old->sidemove
1059 || cmd->upmove != old->upmove) {
Referenced by SV_NewClientExecuteMove(), and SV_OldClientExecuteMove().
◆ SV_CloseDownload()
◆ SV_CvarResult_f()
Definition at line 874 of file user.c.
879 if (!strcmp(
c,
"version")) {
888 }
else if (!strcmp(
c,
"connect")) {
894 }
else if (!strcmp(
c,
"actoken")) {
896 }
else if (!strcmp(
c,
"console")) {
◆ SV_Disconnect_f()
◆ SV_ExecuteClientMessage()
Definition at line 1482 of file user.c.
1507 switch (
c & SVCMD_MASK) {
1529 if (client->
protocol < PROTOCOL_VERSION_R1Q2)
1535 case clc_move_nodelta:
1536 case clc_move_batched:
1537 if (client->
protocol != PROTOCOL_VERSION_Q2PRO)
1543 case clc_userinfo_delta:
1544 if (client->
protocol != PROTOCOL_VERSION_Q2PRO)
Referenced by SV_PacketEvent().
◆ SV_ExecuteUserCommand()
static void SV_ExecuteUserCommand |
( |
const char * |
s | ) |
|
|
static |
◆ SV_Lag_f()
Definition at line 828 of file user.c.
844 "Lag stats for: %s\n"
845 "RTT (min/avg/max): %d/%d/%d ms\n"
846 "Server to client PL: %.2f%% (approx)\n"
847 "Client to server PL: %.2f%%\n",
◆ SV_New_f()
Definition at line 365 of file user.c.
373 Com_DPrintf(
"Going from cs_assigned to cs_connected for %s\n",
379 Com_DPrintf(
"New not valid -- already primed\n");
415 case PROTOCOL_VERSION_R1Q2:
421 case PROTOCOL_VERSION_Q2PRO:
442 "cmd \177c actoken $actoken\n"
454 Com_DPrintf(
"Going from cs_connected to cs_primed for %s\n",
466 write_compressed_gamestate();
469 write_compressed_configstrings();
Referenced by SV_Begin_f().
◆ SV_NewClientExecuteMove()
static void SV_NewClientExecuteMove |
( |
int |
c | ) |
|
|
static |
Definition at line 1168 of file user.c.
1170 usercmd_t cmds[MAX_PACKET_FRAMES][MAX_PACKET_USERCMDS];
1171 usercmd_t *lastcmd, *cmd;
1173 int numCmds[MAX_PACKET_FRAMES], numDups;
1174 int i, j, lightlevel;
1184 numDups =
c >> SVCMD_BITS;
1187 if (numDups >= MAX_PACKET_FRAMES) {
1192 if (
c == clc_move_nodelta) {
1202 for (i = 0; i <= numDups; i++) {
1204 if (numCmds[i] == -1) {
1208 if (numCmds[i] >= MAX_PACKET_USERCMDS) {
1212 for (j = 0; j < numCmds[i]; j++) {
1219 cmd->lightlevel = lightlevel;
1231 if (q_unlikely(!lastcmd)) {
1236 if (net_drop > numDups) {
1240 if (net_drop < 20) {
1242 while (net_drop > numDups) {
1248 while (net_drop > 0) {
1249 i = numDups - net_drop;
1250 for (j = 0; j < numCmds[i]; j++) {
1259 for (j = 0; j < numCmds[numDups]; j++) {
Referenced by SV_ExecuteClientMessage().
◆ SV_NextDownload_f()
◆ SV_NextServer_f()
Definition at line 766 of file user.c.
768 char nextserver[MAX_QPATH];
770 Q_strlcpy(nextserver, v,
sizeof(nextserver));
◆ SV_NoGameData_f()
◆ SV_OldClientExecuteMove()
static void SV_OldClientExecuteMove |
( |
void |
| ) |
|
|
static |
◆ SV_ParseClientCommand()
static void SV_ParseClientCommand |
( |
void |
| ) |
|
|
static |
◆ SV_ParseClientSetting()
static void SV_ParseClientSetting |
( |
void |
| ) |
|
|
static |
◆ SV_ParseDeltaUserinfo()
static void SV_ParseDeltaUserinfo |
( |
void |
| ) |
|
|
static |
Definition at line 1334 of file user.c.
1336 char key[MAX_INFO_KEY], value[MAX_INFO_VALUE];
1341 Com_DPrintf(
"Too many userinfos from %s\n",
sv_client->
name);
1350 if (len >=
sizeof(key)) {
1356 if (len >=
sizeof(value)) {
1367 Com_DDPrintf(
"%s(%s): %s %s [%d]\n", __func__,
1372 Com_DPrintf(
"Too many userinfos from %s\n",
sv_client->
name);
Referenced by SV_ExecuteClientMessage().
◆ SV_ParseFullUserinfo()
static void SV_ParseFullUserinfo |
( |
void |
| ) |
|
|
static |
◆ SV_SetLastFrame()
static void SV_SetLastFrame |
( |
int |
lastframe | ) |
|
|
static |
◆ SV_ShowMiscInfo_f()
◆ SV_ShowServerInfo_f()
static void SV_ShowServerInfo_f |
( |
void |
| ) |
|
|
static |
Definition at line 803 of file user.c.
805 char serverinfo[MAX_INFO_STRING];
◆ SV_StopDownload_f()
Definition at line 743 of file user.c.
757 Com_DPrintf(
"Download of %s to %s stopped by user request\n",
◆ SV_UpdateUserinfo()
◆ write_baseline()
static void write_baseline |
( |
entity_packed_t * |
base | ) |
|
|
static |
◆ write_plain_baselines()
static void write_plain_baselines |
( |
void |
| ) |
|
|
static |
◆ write_plain_configstrings()
static void write_plain_configstrings |
( |
void |
| ) |
|
|
static |
Definition at line 89 of file user.c.
97 for (i = 0; i < MAX_CONFIGSTRINGS; i++,
string += MAX_QPATH) {
101 length = strlen(
string);
102 if (length > MAX_QPATH) {
112 MSG_WriteData(
string, length);
Referenced by SV_New_f().
◆ moveIssued
◆ stringCmdCount
◆ ucmds
Initial value:= {
{ "baselines", NULL },
{ "configstrings", NULL },
{ NULL, NULL }
}
Definition at line 920 of file user.c.
Referenced by SV_ExecuteUserCommand().
◆ userinfoUpdateCount
static void SV_OldClientExecuteMove(void)
qboolean sv_pending_autosave
static qboolean moveIssued
#define SV_BASELINES_MASK
cvar_t * Cvar_Set(const char *var_name, const char *value)
static void SV_Disconnect_f(void)
static void SV_ParseClientSetting(void)
cvar_t * allow_download_players
char * NET_AdrToString(const netadr_t *a)
static void SV_StopDownload_f(void)
size_t Cvar_BitInfo(char *info, int bit)
#define SV_BASELINES_CHUNKS
qboolean Info_Validate(const char *s)
void SV_CloseDownload(client_t *client)
ssize_t FS_Read(void *buf, size_t len, qhandle_t f)
static void SV_ShowServerInfo_f(void)
static void write_baseline(entity_packed_t *base)
void MSG_ReadDeltaUsercmd_Enhanced(const usercmd_t *from, usercmd_t *to, int version)
static void SV_NoGameData_f(void)
cvar_t * sv_force_reconnect
void AC_ClientToken(client_t *cl, const char *token)
void MSG_ReadDeltaUsercmd(const usercmd_t *from, usercmd_t *to)
static int userinfoUpdateCount
#define SV_BASELINES_SHIFT
static void SV_NextServer_f(void)
void Cmd_TokenizeString(const char *text, qboolean macroExpand)
static void SV_NewClientExecuteMove(int c)
char * Cmd_RawArgsFrom(int from)
void MSG_WriteByte(int c)
void SV_ClientAddMessage(client_t *client, int flags)
static void stuff_junk(void)
void SV_UserinfoChanged(client_t *cl)
#define SV_AlignKeyFrames(client)
static void SV_SetLastFrame(int lastframe)
int MSG_ReadBits(int bits)
ssize_t FS_FOpenFile(const char *name, qhandle_t *f, unsigned mode)
void MSG_PackEntity(entity_packed_t *out, const entity_state_t *in, qboolean short_angles)
cvar_t * allow_download_maps
cvar_t * allow_download_textures
void AC_ClientAnnounce(client_t *cl)
static void write_plain_configstrings(void)
static void handle_filtercmd(filtercmd_t *filter)
entity_packed_t * baselines[SV_BASELINES_CHUNKS]
static void SV_ParseDeltaUserinfo(void)
client_frame_t frames[UPDATE_BACKUP]
void Com_EndRedirect(void)
void Cbuf_AddText(cmdbuf_t *buf, const char *text)
char * Info_ValueForKey(const char *s, const char *key)
qboolean AC_ClientBegin(client_t *cl)
void MSG_WriteDeltaEntity(const entity_packed_t *from, const entity_packed_t *to, msgEsFlags_t flags)
static void SV_NextDownload_f(void)
void SV_ClientCommand(client_t *client, const char *fmt,...)
cvar_t * sv_allow_unconnected_cmds
int Cvar_VariableInteger(const char *var_name)
void SV_AutoSaveEnd(void)
size_t Q_strlcpy(char *dst, const char *src, size_t size)
static const ucmd_t ucmds[]
qboolean COM_IsWhite(const char *s)
void Info_Print(const char *infostring)
void MSG_WriteShort(int c)
void SV_DropClient(client_t *client, const char *reason)
static void SV_ShowMiscInfo_f(void)
void SV_PrintMiscInfo(void)
static void SV_ExecuteUserCommand(const char *s)
cvar_t * allow_download_sounds
static void SV_CvarResult_f(void)
static void SV_ParseClientCommand(void)
void MSG_WriteString(const char *string)
void MSG_ReadDeltaUsercmd_Hacked(const usercmd_t *from, usercmd_t *to)
cvar_t * allow_download_others
void MSG_WriteLong(int c)
static void write_plain_baselines(void)
#define Q2PRO_SHORTANGLES(c, e)
int Cvar_ClampInteger(cvar_t *var, int min, int max)
size_t MSG_ReadString(char *dest, size_t size)
static void SV_Lag_f(void)
cvar_t * allow_download_pics
size_t Cmd_ArgvBuffer(int arg, char *buffer, size_t size)
static void SV_AC_List_f(void)
void SV_ClientPrintf(client_t *client, int level, const char *fmt,...)
static void SV_AC_Info_f(void)
static void SV_BeginDownload_f(void)
char * Cvar_VariableString(const char *var_name)
void FS_FCloseFile(qhandle_t f)
cvar_t * allow_download_models
static void SV_UpdateUserinfo(void)
qboolean Info_SetValueForKey(char *s, const char *key, const char *value)
#define SV_BASELINES_PER_CHUNK
server_entity_t entities[MAX_EDICTS]
void SV_RemoveClient(client_t *client)
ratelimit_t ratelimit_namechange
char userinfo[MAX_INFO_STRING]
list_t sv_cmdlist_connect
qboolean SV_RateLimited(ratelimit_t *r)
static int stringCmdCount
size_t FS_NormalizePath(char *out, const char *in)
static void stuff_cmds(list_t *list)
static void create_baselines(void)
#define SV_ClientRedirect()
client_t * SV_GetPlayer(const char *s, qboolean partial)
static void SV_ClientThink(usercmd_t *cmd)
char name[MAX_CLIENT_NAME]
static void SV_ParseFullUserinfo(void)