tr = SV_Move (top, vec3_origin, vec3_origin, bottom, MOVE_NOMONSTERS, sv_player);
// if looking at a wall, leave ideal the way is was
- if (tr.allsolid)
+ if (tr.startsolid)
return;
// near a dropoff
float total;
// read ping time
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = sv.time - MSG_ReadFloat ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
host_client->num_pings++;
for (i=0, total = 0;i < NUM_PING_TIMES;i++)
total += host_client->ping_times[i];
val->_float = host_client->ping * 1000.0;
// read current angles
- // DPPROTOCOL_VERSION4
for (i = 0;i < 3;i++)
- angle[i] = MSG_ReadPreciseAngle();
+ {
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ if (sv.protocol == PROTOCOL_QUAKE)
+ angle[i] = MSG_ReadAngle8i();
+ else if (sv.protocol == PROTOCOL_DARKPLACES2 || sv.protocol == PROTOCOL_DARKPLACES3)
+ angle[i] = MSG_ReadAngle32f();
+ else if (sv.protocol == PROTOCOL_DARKPLACES1 || sv.protocol == PROTOCOL_DARKPLACES4 || sv.protocol == PROTOCOL_DARKPLACES5)
+ angle[i] = MSG_ReadAngle16i();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ }
VectorCopy (angle, sv_player->v->v_angle);
// read movement
- move->forwardmove = MSG_ReadShort ();
- move->sidemove = MSG_ReadShort ();
- move->upmove = MSG_ReadShort ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ move->forwardmove = MSG_ReadCoord16i ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ move->sidemove = MSG_ReadCoord16i ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ move->upmove = MSG_ReadCoord16i ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
if ((val = GETEDICTFIELDVALUE(sv_player, eval_movement)))
{
val->vector[0] = move->forwardmove;
// read buttons
bits = MSG_ReadByte ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
sv_player->v->button0 = bits & 1;
sv_player->v->button2 = (bits & 2)>>1;
// LordHavoc: added 6 new buttons
if ((val = GETEDICTFIELDVALUE(sv_player, eval_button8))) val->_float = ((bits >> 7) & 1);
i = MSG_ReadByte ();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
if (i)
sv_player->v->impulse = i;
}
extern void SV_SendServerinfo(client_t *client);
void SV_ReadClientMessage(void)
{
- int cmd, clientnum = host_client->number;
+ int cmd, num;
char *s;
//MSG_BeginReading ();
for(;;)
{
- if (!(host_client = svs.connectedclients[clientnum]))
+ if (!host_client->active)
{
// a command caused an error
SV_DropClient (false);
if (msg_badread)
{
- Con_Printf ("SV_ReadClientMessage: badread\n");
+ Con_Print("SV_ReadClientMessage: badread\n");
SV_DropClient (false);
return;
}
switch (cmd)
{
default:
- Con_Printf ("SV_ReadClientMessage: unknown command char %i\n", cmd);
+ Con_Printf("SV_ReadClientMessage: unknown command char %i\n", cmd);
SV_DropClient (false);
return;
{
G_INT(OFS_PARM0) = PR_SetString(s);
pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
- PR_ExecuteProgram ((func_t)(SV_ParseClientCommandQC - pr_functions), "");
+ PR_ExecuteProgram ((func_t)(SV_ParseClientCommandQC - pr_functions), "QC function SV_ParseClientCommand is missing");
}
else if (strncasecmp(s, "status", 6) == 0
|| strncasecmp(s, "name", 4) == 0
|| strncasecmp(s, "ping", 4) == 0
|| strncasecmp(s, "ban", 3) == 0
|| strncasecmp(s, "pmodel", 6) == 0
+ || strncasecmp(s, "rate", 4) == 0
|| (gamemode == GAME_NEHAHRA && (strncasecmp(s, "max", 3) == 0 || strncasecmp(s, "monster", 7) == 0 || strncasecmp(s, "scrag", 5) == 0 || strncasecmp(s, "gimme", 5) == 0 || strncasecmp(s, "wraith", 6) == 0))
|| (gamemode != GAME_NEHAHRA && (strncasecmp(s, "god", 3) == 0 || strncasecmp(s, "notarget", 8) == 0 || strncasecmp(s, "fly", 3) == 0 || strncasecmp(s, "give", 4) == 0 || strncasecmp(s, "noclip", 6) == 0)))
Cmd_ExecuteString (s, src_client);
break;
case clc_ackentities:
- //if (dpprotocol == DPPROTOCOL_VERSION1 || dpprotocol == DPPROTOCOL_VERSION2 || dpprotocol == DPPROTOCOL_VERSION3)
- // EntityFrame_AckFrame(&host_client->entitydatabase, MSG_ReadLong());
- //else
- EntityFrame4_AckFrame(host_client->entitydatabase4, MSG_ReadLong());
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ num = MSG_ReadLong();
+ if (msg_badread) Con_Printf("SV_ReadClientMessage: badread at %s:%i\n", __FILE__, __LINE__);
+ if (developer_networkentities.integer >= 1)
+ Con_Printf("recv clc_ackentities %i\n", num);
+ if (host_client->entitydatabase)
+ EntityFrame_AckFrame(host_client->entitydatabase, num);
+ else if (host_client->entitydatabase4)
+ EntityFrame4_AckFrame(host_client->entitydatabase4, num, true);
+ else if (host_client->entitydatabase5)
+ EntityFrame5_AckFrame(host_client->entitydatabase5, num, host_client - svs.clients + 1);
break;
}
}
{
int i;
- for (i = 0;i < MAX_SCOREBOARD;i++)
+ for (i = 0, host_client = svs.clients;i < svs.maxclients;i++, host_client++)
{
- if (!(host_client = svs.connectedclients[i]))
+ if (!host_client->active)
continue;
- sv_player = host_client->edict;
-
if (!host_client->spawned)
{
// clear client movement until a new packet is received
if (sv.frametime)
{
+ sv_player = host_client->edict;
+
// LordHavoc: QuakeC replacement for SV_ClientThink (player movement)
if (SV_PlayerPhysicsQC)
{
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
- PR_ExecuteProgram ((func_t)(SV_PlayerPhysicsQC - pr_functions), "");
+ PR_ExecuteProgram ((func_t)(SV_PlayerPhysicsQC - pr_functions), "QC function SV_PlayerPhysics is missing");
}
else
SV_ClientThink ();