top[0] = sv_player->v.origin[0] + cosval*(i+3)*12;
top[1] = sv_player->v.origin[1] + sinval*(i+3)*12;
top[2] = sv_player->v.origin[2] + sv_player->v.view_ofs[2];
-
+
bottom[0] = top[0];
bottom[1] = top[1];
bottom[2] = top[2] - 160;
-
- tr = SV_Move (top, vec3_origin, vec3_origin, bottom, 1, sv_player);
+
+ tr = SV_Move (top, vec3_origin, vec3_origin, bottom, MOVE_NOMONSTERS, sv_player);
if (tr.allsolid)
return; // looking at a wall, leave ideal the way is was
start[2] = origin[2] + sv_player->v.mins[2];
stop[2] = start[2] - 34;
- trace = SV_Move (start, vec3_origin, vec3_origin, stop, true, sv_player);
+ trace = SV_Move (start, vec3_origin, vec3_origin, stop, MOVE_NOMONSTERS, sv_player);
if (trace.fraction == 1.0)
friction = sv_friction.value*sv_edgefriction.value;
// apply friction
control = speed < sv_stopspeed.value ? sv_stopspeed.value : speed;
newspeed = speed - sv.frametime*control*friction;
-
+
if (newspeed < 0)
newspeed = 0;
else
eval_t *val;
len = VectorNormalizeLength (sv_player->v.punchangle);
-
+
len -= 10*sv.frametime;
if (len < 0)
len = 0;
else
wishvel[2] += cmd.upmove;
- wishspeed = Length(wishvel);
+ wishspeed = VectorLength(wishvel);
if (wishspeed > sv_maxspeed.value)
{
temp = sv_maxspeed.value/wishspeed;
//
// water friction
//
- speed = Length (velocity);
+ speed = VectorLength (velocity);
if (speed)
{
newspeed = speed - sv.frametime * speed * sv_friction.value;
else
{ // not on ground, so little effect on velocity
SV_AirAccelerate (wishvel);
- }
+ }
}
/*
return;
}
- SV_AirMove ();
+ SV_AirMove ();
}
int bits;
eval_t *val;
float total;
-
+
// read ping time
- host_client->ping_times[host_client->num_pings%NUM_PING_TIMES]
- = sv.time - MSG_ReadFloat ();
+ host_client->ping_times[host_client->num_pings % NUM_PING_TIMES] = sv.time - MSG_ReadFloat ();
host_client->num_pings++;
for (i=0, total = 0;i < NUM_PING_TIMES;i++)
total += host_client->ping_times[i];
host_client->ping = total / NUM_PING_TIMES; // can be used for prediction
host_client->latency = 0;
- if (sv_predict.value && (svs.maxclients > 1) && (!sv.paused)) // if paused or a local game, don't predict
+ if (sv_predict.integer && (svs.maxclients > 1) && (!sv.paused)) // if paused or a local game, don't predict
host_client->latency = host_client->ping;
if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_ping)))
val->_float = host_client->ping * 1000.0;
// read current angles
- if (dpprotocol)
- {
- for (i=0 ; i<3 ; i++)
- angle[i] = MSG_ReadPreciseAngle ();
- }
- else
- {
- for (i=0 ; i<3 ; i++)
- angle[i] = MSG_ReadAngle ();
- }
+ // dpprotocol version 2
+ for (i = 0;i < 3;i++)
+ angle[i] = MSG_ReadFloat ();
VectorCopy (angle, host_client->edict->v.v_angle);
-
+
// read movement
move->forwardmove = MSG_ReadShort ();
move->sidemove = MSG_ReadShort ();
val->vector[1] = move->sidemove;
val->vector[2] = move->upmove;
}
-
+
// read buttons
bits = MSG_ReadByte ();
host_client->edict->v.button0 = bits & 1;
Returns false if the client should be killed
===================
*/
+void SV_SendServerinfo (client_t *client);
qboolean SV_ReadClientMessage (void)
{
int ret;
{
Sys_Printf ("SV_ReadClientMessage: badread\n");
return false;
- }
-
+ }
+
cmd = MSG_ReadChar ();
-
+
+#ifndef NOROUTINGFIX
+ if (cmd != -1 && host_client->waitingforconnect)
+ {
+ host_client->waitingforconnect = false;
+ host_client->sendserverinfo = true;
+ }
+#endif
+
switch (cmd)
{
case -1:
goto nextmsg; // end of message
-
+
default:
- Sys_Printf ("SV_ReadClientMessage: unknown command char\n");
+ Sys_Printf ("SV_ReadClientMessage: unknown command char %i\n", cmd);
return false;
-
+
case clc_nop:
// Sys_Printf ("clc_nop\n");
break;
-
- case clc_stringcmd:
+
+ case clc_stringcmd:
s = MSG_ReadString ();
ret = 0;
if (Q_strncasecmp(s, "status", 6) == 0
|| Q_strncasecmp(s, "ping", 4) == 0
|| Q_strncasecmp(s, "ban", 3) == 0
|| Q_strncasecmp(s, "pmodel", 6) == 0
- || (nehahra && (Q_strncasecmp(s, "max", 3) == 0 || Q_strncasecmp(s, "monster", 7) == 0 || Q_strncasecmp(s, "scrag", 5) == 0 || Q_strncasecmp(s, "gimme", 5) == 0 || Q_strncasecmp(s, "wraith", 6) == 0))
- || (!nehahra && (Q_strncasecmp(s, "god", 3) == 0 || Q_strncasecmp(s, "notarget", 8) == 0 || Q_strncasecmp(s, "fly", 3) == 0 || Q_strncasecmp(s, "give", 4) == 0 || Q_strncasecmp(s, "noclip", 6) == 0)))
+ || (gamemode == GAME_NEHAHRA && (Q_strncasecmp(s, "max", 3) == 0 || Q_strncasecmp(s, "monster", 7) == 0 || Q_strncasecmp(s, "scrag", 5) == 0 || Q_strncasecmp(s, "gimme", 5) == 0 || Q_strncasecmp(s, "wraith", 6) == 0))
+ || (gamemode != GAME_NEHAHRA && (Q_strncasecmp(s, "god", 3) == 0 || Q_strncasecmp(s, "notarget", 8) == 0 || Q_strncasecmp(s, "fly", 3) == 0 || Q_strncasecmp(s, "give", 4) == 0 || Q_strncasecmp(s, "noclip", 6) == 0)))
{
ret = 1;
Cmd_ExecuteString (s, src_client);
case clc_move:
SV_ReadClientMove (&host_client->cmd);
break;
+
+ case clc_ackentities:
+ EntityFrame_AckFrame(&host_client->entitydatabase, MSG_ReadLong());
+ break;
}
}
} while (ret == 1);