Exemple #1
0
/*
===================
SV_ReadClientMove
===================
*/
void SV_ReadClientMove (usercmd_t *move)
{
	int		i;
	vec3_t	angle;
	int		bits;

// read ping time
	host_client->ping_times[host_client->num_pings%NUM_PING_TIMES]
		= sv.time - MSG_ReadFloat ();
	host_client->num_pings++;

// read current angles
	if (host_client->netconnection->proquake_connection == MOD_PROQUAKE) 
	{
		for (i = 0; i<3; i++)
			angle[i] = MSG_ReadPreciseAngle();
	}
	else
	{
		for (i = 0; i<3; i++)
			angle[i] = MSG_ReadAngle();
	}

// ProQuake - server-side fullpitch fix
	if (!pq_fullpitch.value)
	{
		if (angle[PITCH] > 80 || angle[PITCH] < -70)
		{
			angle[PITCH] = COM_Clamp(angle[PITCH], -70, 80);

			MSG_WriteByte (&host_client->message, svc_setangle);
			for (i=0 ; i < 3 ; i++)
				MSG_WriteAngle (&host_client->message, angle[i] );
		}
	}
	
	VectorCopy (angle, host_client->edict->v.v_angle);

// read movement
	move->forwardmove = MSG_ReadShort ();
	move->sidemove = MSG_ReadShort ();
	move->upmove = MSG_ReadShort ();

// read buttons
	bits = MSG_ReadByte ();
	host_client->edict->v.button0 = bits & 1;
	host_client->edict->v.button2 = (bits & 2)>>1;

	i = MSG_ReadByte ();
	if (i)
		host_client->edict->v.impulse = i;

#ifdef QUAKE2
// read light level
	host_client->edict->v.light_level = MSG_ReadByte ();
#endif
}
Exemple #2
0
/*
===================
SV_ReadClientMove
===================
*/
void SV_ReadClientMove (usercmd_t *move)
{
	int		i;
	vec3_t	angle;
	int		bits;
	
// read ping time
	host_client->ping_times[host_client->num_pings%NUM_PING_TIMES]
		= sv.time - MSG_ReadFloat (net_message);
	host_client->num_pings++;

// read current angles	
	if ((host_client->netconnection->mod == MOD_PROQUAKE) && (sv.protocol == PROTOCOL_NETQUAKE)) // precise aim for ProQuake
	{
		for (i=0 ; i<3 ; i++)
			angle[i] = MSG_ReadPreciseAngle (net_message);
	}
	else if (sv.protocol == PROTOCOL_FITZQUAKE || sv.protocol == PROTOCOL_FITZQUAKE_PLUS) //johnfitz -- 16-bit angles for PROTOCOL_FITZQUAKE
	{
		for (i=0 ; i<3 ; i++)
			angle[i] = MSG_ReadAngle16 (net_message);
	}
	else
	{
		for (i=0 ; i<3 ; i++)
			angle[i] = MSG_ReadAngle (net_message);
	}

	VectorCopy (angle, host_client->edict->v.v_angle);
		
// read movement
	move->forwardmove = MSG_ReadShort (net_message);
	move->sidemove = MSG_ReadShort (net_message);
	move->upmove = MSG_ReadShort (net_message);
	
// read buttons
	bits = MSG_ReadByte (net_message);
	host_client->edict->v.button0 = bits & 1;
	host_client->edict->v.button2 = (bits & 2)>>1;

	i = MSG_ReadByte (net_message);
	if (i)
		host_client->edict->v.impulse = i;
}
Exemple #3
0
/*
===================
SV_ReadClientMove
===================
*/
void SV_ReadClientMove (usercmd_t *move)
{
	int		i;
	vec3_t	angle;
	int		bits;

// read ping time
	host_client->ping_times[host_client->num_pings%NUM_PING_TIMES]
		= sv.time - MSG_ReadFloat ();
	host_client->num_pings++;

// read current angles
// JPG - precise aim for ProQuake!!
    for (i=0 ; i<3 ; i++)
        angle[i] = MSG_ReadPreciseAngle ();

// read current angles
//	for (i=0 ; i<3 ; i++)
//		angle[i] = MSG_ReadAngle ();

	VectorCopy (angle, host_client->edict->v.v_angle);

// read movement
	move->forwardmove = MSG_ReadShort ();
	move->sidemove = MSG_ReadShort ();
	move->upmove = MSG_ReadShort ();

// read buttons
	bits = MSG_ReadByte ();
	host_client->edict->v.button0 = bits & 1;
	host_client->edict->v.button2 = (bits & 2)>>1;

	i = MSG_ReadByte ();
	if (i)
		host_client->edict->v.impulse = i;

#ifdef QUAKE2
// read light level
	host_client->edict->v.light_level = MSG_ReadByte ();
#endif
}