diff options
Diffstat (limited to 'src/client/cl_input.c')
-rw-r--r-- | src/client/cl_input.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/client/cl_input.c b/src/client/cl_input.c index 7a917df2..7d0a692e 100644 --- a/src/client/cl_input.c +++ b/src/client/cl_input.c @@ -269,7 +269,7 @@ void IN_Button15Down(void) {IN_KeyDown(&in_buttons[15]);} void IN_Button15Up(void) {IN_KeyUp(&in_buttons[15]);} void IN_CenterView (void) { - cl.viewangles[PITCH] = -SHORT2ANGLE(cl.snap.ps.delta_angles[PITCH]); + cl.viewangles[PITCH] = -SHORT2ANGLE((clc.netchan.alternateProtocol == 2 ? cl.snap.alternatePs.delta_angles : cl.snap.ps.delta_angles)[PITCH]); } @@ -795,12 +795,25 @@ void CL_WritePacket( void ) { { if((clc.voipFlags & VOIP_SPATIAL) || Com_IsVoipTarget(clc.voipTargets, sizeof(clc.voipTargets), -1)) { + if ( clc.netchan.alternateProtocol != 0 ) { + MSG_WriteByte (&buf, clc_EOF); + MSG_WriteByte (&buf, clc_voipSpeex); + } MSG_WriteByte (&buf, clc_voipOpus); MSG_WriteByte (&buf, clc.voipOutgoingGeneration); MSG_WriteLong (&buf, clc.voipOutgoingSequence); MSG_WriteByte (&buf, clc.voipOutgoingDataFrames); - MSG_WriteData (&buf, clc.voipTargets, sizeof(clc.voipTargets)); - MSG_WriteByte(&buf, clc.voipFlags); + if ( clc.netchan.alternateProtocol == 0 ) { + MSG_WriteData (&buf, clc.voipTargets, sizeof(clc.voipTargets)); + MSG_WriteByte(&buf, clc.voipFlags); + } else { + MSG_WriteLong (&buf, clc.voipTargets[0] | (clc.voipTargets[1] << 8) | + (clc.voipTargets[2] << 16) | ((clc.voipTargets[3] & 0x7F) << 24)); + MSG_WriteLong (&buf, (clc.voipTargets[3] >> 7) | + (clc.voipTargets[4] << 1) | (clc.voipTargets[5] << 9) | + (clc.voipTargets[6] << 17) | ((clc.voipTargets[7] & 0x3F) << 25)); + MSG_WriteLong (&buf, clc.voipTargets[7] >> 6); + } MSG_WriteShort (&buf, clc.voipOutgoingDataSize); MSG_WriteData (&buf, clc.voipOutgoingData, clc.voipOutgoingDataSize); @@ -822,7 +835,9 @@ void CL_WritePacket( void ) { MSG_WriteLong (&fakemsg, clc.voipOutgoingSequence); MSG_WriteByte (&fakemsg, clc.voipOutgoingDataFrames); MSG_WriteShort (&fakemsg, clc.voipOutgoingDataSize ); - MSG_WriteBits (&fakemsg, clc.voipFlags, VOIP_FLAGCNT); + if ( clc.netchan.alternateProtocol == 0 ) { + MSG_WriteBits (&fakemsg, clc.voipFlags, VOIP_FLAGCNT); + } MSG_WriteData (&fakemsg, clc.voipOutgoingData, voipSize); MSG_WriteByte (&fakemsg, svc_EOF); CL_WriteDemoMessage (&fakemsg, 0); @@ -862,7 +877,7 @@ void CL_WritePacket( void ) { // also use the message acknowledge key ^= clc.serverMessageSequence; // also use the last acknowledged server command in the key - key ^= MSG_HashKey(clc.serverCommands[ clc.serverCommandSequence & (MAX_RELIABLE_COMMANDS-1) ], 32); + key ^= MSG_HashKey(clc.netchan.alternateProtocol, clc.serverCommands[ clc.serverCommandSequence & (MAX_RELIABLE_COMMANDS-1) ], 32); // write all the commands, including the predicted command for ( i = 0 ; i < count ; i++ ) { |