engine/EngineClientParse.c
/*	Server information pertaining to this client only
*/
Server information pertaining to this client only
Server information pertaining to this client only
void CL_ParseClientdata (void)
{
	int		i,j,bits; 
	bits = (unsigned short)MSG_ReadShort ();  -- read bits here isntead of in CL_ParseServerMessage()
	 -- PROTOCOL_FITZQUAKE
	if (bits & SU_EXTEND1)
		bits |= (MSG_ReadByte() << 16);
	if (bits & SU_EXTEND2)
		bits |= (MSG_ReadByte() << 24);
	if (bits & SU_VIEWHEIGHT)
		cl.viewheight = MSG_ReadChar ();
	else
		cl.viewheight = DEFAULT_VIEWHEIGHT;
	if (bits & SU_IDEALPITCH)
		cl.idealpitch = MSG_ReadChar ();
	else
		cl.idealpitch = 0;
	Math_VectorCopy(cl.mvelocity[0],cl.mvelocity[1]);
	for (i=0 ; i<3 ; i++)
	{
		if (bits & (SU_PUNCH1<<i) )
			cl.punchangle[i] = MSG_ReadChar();
		else
			cl.punchangle[i] = 0;
		if (bits & (SU_VELOCITY1<<i) )
			cl.mvelocity[0][i] = MSG_ReadChar()*16;
		else
			cl.mvelocity[0][i] = 0;
	}
	 -- update v_punchangles
	if (v_punchangles[0][0] != cl.punchangle[0] || v_punchangles[0][1] != cl.punchangle[1] || v_punchangles[0][2] != cl.punchangle[2])
	{
		Math_VectorCopy(v_punchangles[0],v_punchangles[1]);
		Math_VectorCopy(cl.punchangle,v_punchangles[0]);
	}
	i = MSG_ReadLong ();
	if (cl.items != i)
	{
		for (j=0 ; j<32 ; j++)
			if ( (i & (1<<j)) && !(cl.items & (1<<j)))
				cl.item_gettime[j] = cl.time;
		cl.items = i;
	}
	cl.bIsOnGround	= (bits & SU_ONGROUND) != 0;
	cl.bIsInWater	= (bits & SU_INWATER) != 0;
	if (bits & SU_WEAPONFRAME)
		cl.stats[STAT_WEAPONFRAME] = MSG_ReadByte ();
	else
		cl.stats[STAT_WEAPONFRAME] = 0;
	if(bits & SU_ARMOR)
		i = MSG_ReadByte ();
	else
		i = 0;
	if (cl.stats[STAT_ARMOR] != i)
		cl.stats[STAT_ARMOR] = i;
	if (bits & SU_WEAPON)
		i = MSG_ReadByte ();
	else
		i = 0;
	if (cl.stats[STAT_WEAPON] != i)
	{
		cl.stats[STAT_WEAPON] = i;
		 -- lerping
		if (cl.viewent.model != cl.model_precache[cl.stats[STAT_WEAPON]])
			cl.viewent.lerpflags |= LERP_RESETANIM; 
	}
	i = MSG_ReadShort ();
	if (cl.stats[STAT_HEALTH] != i)
		cl.stats[STAT_HEALTH] = i;
	i = MSG_ReadByte ();
	if (cl.stats[STAT_AMMO] != i)
		cl.stats[STAT_AMMO] = i;
	i = MSG_ReadByte ();
	if(cl.stats[STAT_ACTIVEWEAPON] != i)
		cl.stats[STAT_ACTIVEWEAPON] = i;
	 -- PROTOCOL_FITZQUAKE
	if (bits & SU_WEAPON2)
		cl.stats[STAT_WEAPON] |= (MSG_ReadByte() << 8);
	if (bits & SU_ARMOR2)
		cl.stats[STAT_ARMOR] |= (MSG_ReadByte() << 8);
	if (bits & SU_AMMO2)
		cl.stats[STAT_AMMO] |= (MSG_ReadByte() << 8);
	if (bits & SU_WEAPONFRAME2)
		cl.stats[STAT_WEAPONFRAME] |= (MSG_ReadByte() << 8);
	if (bits & SU_WEAPONALPHA)
		cl.viewent.alpha = MSG_ReadByte();
	else
		cl.viewent.alpha = ENTALPHA_DEFAULT;
}
void CL_ParseClientdata ( void ) { int i , j , bits ; bits = ( unsigned short ) MSG_ReadShort ( ) ; if ( bits & SU_EXTEND1 ) bits |= ( MSG_ReadByte ( ) << 16 ) ; if ( bits & SU_EXTEND2 ) bits |= ( MSG_ReadByte ( ) << 24 ) ; if ( bits & SU_VIEWHEIGHT ) cl . viewheight = MSG_ReadChar ( ) ; else cl . viewheight = DEFAULT_VIEWHEIGHT ; if ( bits & SU_IDEALPITCH ) cl . idealpitch = MSG_ReadChar ( ) ; else cl . idealpitch = 0 ; Math_VectorCopy ( cl . mvelocity [ 0 ] , cl . mvelocity [ 1 ] ) ; for ( i = 0 ; i < 3 ; i ++ ) { if ( bits & ( SU_PUNCH1 << i ) ) cl . punchangle [ i ] = MSG_ReadChar ( ) ; else cl . punchangle [ i ] = 0 ; if ( bits & ( SU_VELOCITY1 << i ) ) cl . mvelocity [ 0 ] [ i ] = MSG_ReadChar ( ) * 16 ; else cl . mvelocity [ 0 ] [ i ] = 0 ; } if ( v_punchangles [ 0 ] [ 0 ] != cl . punchangle [ 0 ] || v_punchangles [ 0 ] [ 1 ] != cl . punchangle [ 1 ] || v_punchangles [ 0 ] [ 2 ] != cl . punchangle [ 2 ] ) { Math_VectorCopy ( v_punchangles [ 0 ] , v_punchangles [ 1 ] ) ; Math_VectorCopy ( cl . punchangle , v_punchangles [ 0 ] ) ; } i = MSG_ReadLong ( ) ; if ( cl . items != i ) { for ( j = 0 ; j < 32 ; j ++ ) if ( ( i & ( 1 << j ) ) && ! ( cl . items & ( 1 << j ) ) ) cl . item_gettime [ j ] = cl . time ; cl . items = i ; } cl . bIsOnGround = ( bits & SU_ONGROUND ) != 0 ; cl . bIsInWater = ( bits & SU_INWATER ) != 0 ; if ( bits & SU_WEAPONFRAME ) cl . stats [ STAT_WEAPONFRAME ] = MSG_ReadByte ( ) ; else cl . stats [ STAT_WEAPONFRAME ] = 0 ; if ( bits & SU_ARMOR ) i = MSG_ReadByte ( ) ; else i = 0 ; if ( cl . stats [ STAT_ARMOR ] != i ) cl . stats [ STAT_ARMOR ] = i ; if ( bits & SU_WEAPON ) i = MSG_ReadByte ( ) ; else i = 0 ; if ( cl . stats [ STAT_WEAPON ] != i ) { cl . stats [ STAT_WEAPON ] = i ; if ( cl . viewent . model != cl . model_precache [ cl . stats [ STAT_WEAPON ] ] ) cl . viewent . lerpflags |= LERP_RESETANIM ; } i = MSG_ReadShort ( ) ; if ( cl . stats [ STAT_HEALTH ] != i ) cl . stats [ STAT_HEALTH ] = i ; i = MSG_ReadByte ( ) ; if ( cl . stats [ STAT_AMMO ] != i ) cl . stats [ STAT_AMMO ] = i ; i = MSG_ReadByte ( ) ; if ( cl . stats [ STAT_ACTIVEWEAPON ] != i ) cl . stats [ STAT_ACTIVEWEAPON ] = i ; if ( bits & SU_WEAPON2 ) cl . stats [ STAT_WEAPON ] |= ( MSG_ReadByte ( ) << 8 ) ; if ( bits & SU_ARMOR2 ) cl . stats [ STAT_ARMOR ] |= ( MSG_ReadByte ( ) << 8 ) ; if ( bits & SU_AMMO2 ) cl . stats [ STAT_AMMO ] |= ( MSG_ReadByte ( ) << 8 ) ; if ( bits & SU_WEAPONFRAME2 ) cl . stats [ STAT_WEAPONFRAME ] |= ( MSG_ReadByte ( ) << 8 ) ; if ( bits & SU_WEAPONALPHA ) cl . viewent . alpha = MSG_ReadByte ( ) ; else cl . viewent . alpha = ENTALPHA_DEFAULT ; }
Server information pertaining to this client only
Server information pertaining to this client only
//johnfitz //johnfitz -- read bits here isntead of in CL_ParseServerMessage() //johnfitz -- PROTOCOL_FITZQUAKE //johnfitz //johnfitz -- update v_punchangles //johnfitz // [always sent]	if (bits & SU_ITEMS) // set flash times //johnfitz -- lerping //don't lerp animation across model changes //johnfitz //johnfitz -- PROTOCOL_FITZQUAKE //johnfitz