40 Con_Print(
"prespawn not valid -- already prespawned\n");
71 Con_Print(
"Spawn not valid -- not yet prespawned\n");
76 Con_Print(
"Spawn not valid -- already spawned\n");
208 Con_Print(
"Begin not valid -- not yet spawned\n");
213 Con_Print(
"Begin not valid -- already begun\n");
227 Con_Printf(
"Loaded game, everyone rejoined - unpausing\n");
242 float angleval, sinval, cosval, step,
dir;
253 sinval =
sin(angleval);
254 cosval =
cos(angleval);
264 bottom[2] = top[2] - 160;
275 z[
i] = top[2] + tr.
fraction*(bottom[2]-top[2]);
280 for (j=1 ; j<
i ; j++)
282 step =
z[j] -
z[j-1];
319 float speed, newspeed, control,
friction;
331 stop[2] = start[2] - 34;
361 float addspeed, accelspeed, currentspeed;
368 if (accelspeed > addspeed)
369 accelspeed = addspeed;
371 for (
i=0 ;
i<3 ;
i++)
380 float addspeed, wishspd, accelspeed, currentspeed;
386 addspeed = wishspd - currentspeed;
390 if (accelspeed > addspeed)
391 accelspeed = addspeed;
393 for (
i=0 ;
i<3 ;
i++)
440 vec_t speed, newspeed, fwishspeed, addspeed, accelspeed, temp;
446 for (
i=0 ;
i<3 ;
i++)
470 temp = newspeed/speed;
480 addspeed = fwishspeed - newspeed;
486 if (accelspeed > addspeed)
487 accelspeed = addspeed;
489 for (
i=0 ;
i<3 ;
i++)
517 float fmove, smove, temp;
520 wishvel[0] = wishvel[2] = 0;
531 for (
i=0 ;
i<3 ;
i++)
650 memset(move, 0,
sizeof(*move));
662 Con_Printf(
"%s move%i #%u %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", move->
time > move->
receivetime ?
"^3read future" :
"^4read normal",
sv_numreadmoves + 1, move->
sequence, (
int)
floor((move->
time -
host_client->
cmd.
time) * 1000.0 + 0.5), (
int)
floor(move->
time * 1000.0 + 0.5), move->
impulse, move->
buttons, (
int)move->
viewangles[0], (
int)move->
viewangles[1], (
int)move->
viewangles[2], (
int)move->
forwardmove, (
int)move->
sidemove, (
int)move->
upmove);
669 for (
i = 0;
i < 3;
i++)
716 Con_DPrintf(
"SV_ReadClientMessage: client send bad cursor_entitynumber\n");
753 for(u = 0; u < delta; ++u)
779 double moveframetime;
781 double oldframetime2;
808 Con_Printf(
"%smove #%u %ims (%ims) %i %i '%i %i %i' '%i %i %i'\n", (move->
time -
host_client->
cmd.
time) >
sv.
frametime * 1.01 ?
"^1" :
"^2", move->
sequence, (
int)
floor((move->
time -
host_client->
cmd.
time) * 1000.0 + 0.5), (
int)
floor(move->
time * 1000.0 + 0.5), move->
impulse, move->
buttons, (
int)move->
viewangles[0], (
int)move->
viewangles[1], (
int)move->
viewangles[2], (
int)move->
forwardmove, (
int)move->
sidemove, (
int)move->
upmove);
823 if(moveframetime < 0.0005)
897 int j, movementloss, packetloss;
917 movementloss = packetloss = 0;
960 if (framenum <= host_client->entitydatabase5->latestframenum)
988 int netcmd, num, start;
1009 Con_Print(
"SV_ReadClientMessage: badread\n");
1029 SV_DropClient (
false,
"Unknown message sent to the server");
1042 for(p = s; *p; ++p)
switch(*p)
1051 goto clc_stringcmd_invalid;
1056 if (strncasecmp(s,
"spawn", 5) == 0
1057 || strncasecmp(s,
"begin", 5) == 0
1058 || strncasecmp(s,
"prespawn", 8) == 0)
1062 int restorevm_tempstringsbuf_cursize;
1074clc_stringcmd_invalid:
1083 :
"Disconnect by user");
1116 unsigned char *temp;
#define SUPERCONTENTS_SOLID
cvar_t developer_networkentities
void Cmd_ExecuteString(cmd_state_t *cmd, const char *text, size_t textlen, cmd_source_t src, qbool lockmutex)
Parses a single line of text into arguments and tries to execute it.
cmd_state_t * cmd_serverfromclient
command interpreter for server commands received over network from clients uses cmddefs_null
@ src_client
came in over a net connection as a clc_stringcmd host_client will be valid during this state.
cvar_t collision_extendmovelength
unsigned short CRC_Block(const unsigned char *data, size_t size)
int EntityFrame4_AckFrame(entityframe4_database_t *d, int framenum, int servermode)
void EntityFrame_AckFrame(entityframe_database_t *d, int frame)
char * MSG_ReadString(sizebuf_t *sb, char *string, size_t maxstring)
void MSG_WriteShort(sizebuf_t *sb, int c)
float MSG_ReadAngle32f(sizebuf_t *sb)
void MSG_WriteString(sizebuf_t *sb, const char *s)
void MSG_WriteLong(sizebuf_t *sb, int c)
float MSG_ReadAngle8i(sizebuf_t *sb)
float MSG_ReadAngle16i(sizebuf_t *sb)
void MSG_WriteByte(sizebuf_t *sb, int c)
void MSG_WriteFloat(sizebuf_t *sb, float f)
void MSG_WriteAngle(sizebuf_t *sb, float f, protocolversion_t protocol)
float MSG_ReadCoord16i(sizebuf_t *sb)
size_t MSG_ReadString_len(sizebuf_t *sb, char *string, size_t maxstring)
Same as MSG_ReadString except it returns the number of bytes written to *string excluding the \0 term...
float Com_CalcRoll(const vec3_t angles, const vec3_t velocity, const vec_t angleval, const vec_t velocityval)
void Com_HexDumpToConsole(const unsigned char *data, int size)
void SZ_Write(sizebuf_t *buf, const unsigned char *data, int length)
@ PROTOCOL_DARKPLACES2
various changes
@ PROTOCOL_DARKPLACES4
various changes
@ PROTOCOL_NEHAHRABJP2
same as NEHAHRABJP but with 16bit soundindex
@ PROTOCOL_DARKPLACES3
uses EntityFrame4 entity snapshot encoder/decoder which is broken, this attempted to do partial snaps...
@ PROTOCOL_NEHAHRABJP
same as QUAKEDP but with 16bit modelindex
@ PROTOCOL_DARKPLACES5
uses EntityFrame5 entity snapshot encoder/decoder which is based on a Tribes networking article at ht...
@ PROTOCOL_QUAKEDP
darkplaces extended quake protocol (used by TomazQuake and others), backwards compatible as long as n...
@ PROTOCOL_DARKPLACES6
various changes
@ PROTOCOL_QUAKE
quake (aka netquake/normalquake/nq) protocol
@ PROTOCOL_DARKPLACES8
added parting messages. WIP
@ PROTOCOL_NEHAHRABJP3
same as NEHAHRABJP2 but with some changes
@ PROTOCOL_NEHAHRAMOVIE
Nehahra movie protocol, a big nasty hack dating back to early days of the Quake Standards Group (but ...
@ PROTOCOL_DARKPLACES1
uses EntityFrame entity snapshot encoder/decoder which is a QuakeWorld-like entity snapshot delta com...
void Con_Print(const char *msg)
Prints to all appropriate console targets, and adds timestamps.
void Con_DPrintf(const char *fmt,...)
A Con_Printf that only shows up if the "developer" cvar is set.
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.
float disableclientprediction
vector cursor_trace_start
vector cursor_trace_endpos
fs_offset_t FS_Read(qfile_t *file, void *buffer, size_t buffersize)
int FS_Seek(qfile_t *file, fs_offset_t offset, int whence)
static int(ZEXPORT *qz_inflate)(z_stream *strm
fs_offset_t FS_FileSize(qfile_t *file)
int FS_Close(qfile_t *file)
GLubyte GLubyte GLubyte z
float VectorNormalizeLength(vec3_t v)
returns vector length
void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
#define VectorNormalize(v)
#define bound(min, num, max)
#define VectorSet(vec, x, y, z)
#define VectorCopy(in, out)
#define VectorScale(in, scale, out)
#define VectorAdd(a, b, out)
char sv_readstring[MAX_INPUTLINE]
cvar_t developer_networking
#define NETGRAPH_LOSTPACKET
#define PRVM_serveredictvector(ed, fieldname)
int PRVM_SetTempString(prvm_prog_t *prog, const char *s, size_t slen)
Takes an strlen (not a buffer size).
#define PRVM_serverglobaledict(fieldname)
#define PRVM_serveredictedict(ed, fieldname)
#define PRVM_EDICT_TO_PROG(e)
#define PRVM_EDICT_NUM(n)
#define PRVM_serverglobalfloat(fieldname)
#define PRVM_serveredictfloat(ed, fieldname)
#define PRVM_serverfunction(funcname)
#define clc_ackdownloaddata
void EntityFrameCSQC_LostFrame(struct client_s *client, int framenum)
void EntityFrame5_AckFrame(entityframe5_database_t *d, int framenum)
void EntityFrame5_LostFrame(entityframe5_database_t *d, int framenum)
#define ON_EPSILON
point on plane side epsilon
#define MAX_LIGHTSTYLES
max flickering light styles in level (note: affects savegame format)
#define CL_MAX_USERCMDS
max number of predicted input packets in queue
#define STAT_TOTALMONSTERS
#define STAT_MONSTERS
bumped by svc_killedmonster
#define STAT_SECRETS
bumped on client side by svc_foundsecret
#define STAT_TOTALSECRETS
#define FL_WATERJUMP
player jumping out of water
cvar_t sv_clmovement_enable
#define MOVETYPE_WALK
gravity
cvar_t sv_wateraccelerate
#define MOVETYPE_NONE
never moves
void SV_WriteClientdataToMessage(client_t *client, prvm_edict_t *ent, sizebuf_t *msg, int *stats)
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_CheckVelocity(prvm_edict_t *ent)
cvar_t sv_idealpitchscale
void SV_DropClient(qbool leaving, const char *reason,...)
int SV_GenericHitSuperContentsMask(const prvm_edict_t *edict)
calculates hitsupercontentsmask for a generic qc entity
server_static_t svs
persistant server info
cvar_t sv_clmovement_inputtimeout
cvar_t sv_clmovement_minping
cvar_t sv_clmovement_minping_disabletime
void SV_ClientCommands(const char *fmt,...) DP_FUNC_PRINTF(1)
cvar_t sv_playerphysicsqc
void SV_Physics_ClientMove(void)
float clmovement_inputtimeout
this is used by sv_clmovement_inputtimeout code
qbool active
false = empty client slot
signed char movement_count[NETGRAPH_PACKETS]
qbool begun
false = don't send datagrams
char download_name[MAX_QPATH]
prvm_vec_t spawn_parms[NUM_SPAWN_PARMS]
spawn parms are carried from level to level
entityframe_database_t * entitydatabase
unsigned int movesequence
qbool clientconnectcalled
false = don't do ClientDisconnect on drop
float nametime
prevent animated names
double clmovement_disabletimeout
this is used by sv_clmovement_minping code
int sendsignon
1 = send svc_serverinfo and advance to 2, 2 doesn't send, then advances to 0 (allowing unlimited send...
entityframe5_database_t * entitydatabase5
qbool prespawned
false = don't allow spawn
char name[MAX_SCOREBOARDNAME]
entityframe4_database_t * entitydatabase4
int latestframenum
latest received clc_ackframe (used to detect packet loss)
netconn_t * netconnection
communications handle
int download_expectedposition
next position the client should ack
qbool spawned
false = don't allow begin
prvm_edict_t * edict
PRVM_EDICT_NUM(clientnum+1)
unsigned int movement_highestsequence_seen
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...
double realtime
the accumulated mainloop time since application started (with filtering), without any slowmo or clamp...
netgraphitem_t incoming_netgraph[NETGRAPH_PACKETS]
sizebuf_t message
writing buffer to send to peer as the next reliable message can be added to at any time,...
int max_edicts
number of edicts for which space has been (should be) allocated
void(* ExecuteProgram)(struct prvm_prog_s *prog, func_t fnum, const char *errormessage)
pointer to one of the *VM_ExecuteProgram functions
sizebuf_t tempstringsbuf
buffer for storing all tempstrings created during one invocation of ExecuteProgram
struct client_s * clients
client slots
int maxclients
number of svs.clients slots (updated by maxplayers command)
char lightstyles[MAX_LIGHTSTYLES][64]
qbool loadgame
handle connections specially
protocolversion_t protocol
one of the PROTOCOL_ values
void SV_WriteDemoMessage(client_t *client, sizebuf_t *sendbuffer, qbool clienttoserver)
static void DropPunchAngle(void)
void SV_PlayerPhysics(void)
void SV_Begin_f(cmd_state_t *cmd)
void SV_ReadClientMessage(void)
void SV_ApplyClientMove(void)
static void SV_WaterJump(void)
void SV_Spawn_f(cmd_state_t *cmd)
static void SV_AirAccelerate(vec3_t wishveloc)
void SV_SetIdealPitch(void)
static void SV_ExecuteClientMoves(void)
static void SV_ReadClientMove(void)
static void SV_UserFriction(void)
cvar_t sv_gameplayfix_q2airaccelerate
static void SV_Accelerate(void)
usercmd_t sv_readmoves[CL_MAX_USERCMDS]
static void SV_FrameAck(int framenum)
static void SV_WaterMove(void)
static qbool SV_FrameLost(int framenum)
cvar_t sv_autodemo_perclient
void SV_PreSpawn_f(cmd_state_t *cmd)
static void SV_AirMove(void)
#define Mem_Alloc(pool, size)