summaryrefslogtreecommitdiff
path: root/src/server/sv_net_chan.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2009-10-03 15:17:16 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:16:38 +0000
commit6d2ffb4c637a49983bc6ce22b68ccec0ed09e0f4 (patch)
treeff15343e4a2ae5a2512c1c21e05a3821a46f10da /src/server/sv_net_chan.c
parente9e52d0b7ec9bae071534df7581126d69d3e9bf8 (diff)
* Merge ioq3-r1637
Diffstat (limited to 'src/server/sv_net_chan.c')
-rw-r--r--src/server/sv_net_chan.c60
1 files changed, 31 insertions, 29 deletions
diff --git a/src/server/sv_net_chan.c b/src/server/sv_net_chan.c
index 0de49d4f..dd2bb204 100644
--- a/src/server/sv_net_chan.c
+++ b/src/server/sv_net_chan.c
@@ -35,28 +35,29 @@ SV_Netchan_Encode
==============
*/
static void SV_Netchan_Encode( client_t *client, msg_t *msg ) {
- long reliableAcknowledge, i, index;
+ long i, index;
byte key, *string;
- int srdc, sbit, soob;
-
+ int srdc, sbit;
+ qboolean soob;
+
if ( msg->cursize < SV_ENCODE_START ) {
return;
}
- srdc = msg->readcount;
- sbit = msg->bit;
- soob = msg->oob;
-
- msg->bit = 0;
- msg->readcount = 0;
- msg->oob = 0;
-
- reliableAcknowledge = MSG_ReadLong(msg);
+ srdc = msg->readcount;
+ sbit = msg->bit;
+ soob = msg->oob;
+
+ msg->bit = 0;
+ msg->readcount = 0;
+ msg->oob = qfalse;
+
+ /* reliableAcknowledge = */ MSG_ReadLong(msg);
+
+ msg->oob = soob;
+ msg->bit = sbit;
+ msg->readcount = srdc;
- msg->oob = soob;
- msg->bit = sbit;
- msg->readcount = srdc;
-
string = (byte *)client->lastClientCommandString;
index = 0;
// xor the client challenge with the netchan sequence number
@@ -90,23 +91,24 @@ SV_Netchan_Decode
*/
static void SV_Netchan_Decode( client_t *client, msg_t *msg ) {
int serverId, messageAcknowledge, reliableAcknowledge;
- int i, index, srdc, sbit, soob;
+ int i, index, srdc, sbit;
+ qboolean soob;
byte key, *string;
- srdc = msg->readcount;
- sbit = msg->bit;
- soob = msg->oob;
-
- msg->oob = 0;
-
- serverId = MSG_ReadLong(msg);
+ srdc = msg->readcount;
+ sbit = msg->bit;
+ soob = msg->oob;
+
+ msg->oob = qfalse;
+
+ serverId = MSG_ReadLong(msg);
messageAcknowledge = MSG_ReadLong(msg);
reliableAcknowledge = MSG_ReadLong(msg);
- msg->oob = soob;
- msg->bit = sbit;
- msg->readcount = srdc;
-
+ msg->oob = soob;
+ msg->bit = sbit;
+ msg->readcount = srdc;
+
string = (byte *)client->reliableCommands[ reliableAcknowledge & (MAX_RELIABLE_COMMANDS-1) ];
index = 0;
//
@@ -137,7 +139,7 @@ void SV_Netchan_TransmitNextFragment( client_t *client ) {
if (!client->netchan.unsentFragments)
{
// make sure the netchan queue has been properly initialized (you never know)
- if (!client->netchan_end_queue) {
+ if ((!client->netchan_end_queue) && (client->state >= CS_CONNECTED)) {
Com_Error(ERR_DROP, "netchan queue is not properly initialized in SV_Netchan_TransmitNextFragment\n");
}
// the last fragment was transmitted, check wether we have queued messages