From acf502162a85bcbb89de693665a8ece254a64aac Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 2 Mar 2015 21:25:53 +0000 Subject: [PATCH] Just in case, make QW sequence numbers unsigned too. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12173 d7cf8633-e32d-0410-b094-e92efae38249 --- client.h | 8 ++++---- netconn.c | 6 +++--- netconn.h | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client.h b/client.h index c074d238..d9facec2 100644 --- a/client.h +++ b/client.h @@ -863,8 +863,8 @@ typedef struct client_static_s // value of "qport" cvar at time of connection int qw_qport; // copied from cls.netcon->qw. variables every time they change, or set by demos (which have no cls.netcon) - int qw_incoming_sequence; - int qw_outgoing_sequence; + unsigned int qw_incoming_sequence; + unsigned int qw_outgoing_sequence; // current file download buffer (only saved when file is completed) char qw_downloadname[MAX_QPATH]; @@ -1416,9 +1416,9 @@ typedef struct client_state_s float qw_weaponkick; - int qw_validsequence; + unsigned int qw_validsequence; - int qw_deltasequence[QW_UPDATE_BACKUP]; + unsigned int qw_deltasequence[QW_UPDATE_BACKUP]; // csqc stuff: // server entity number corresponding to a clientside entity diff --git a/netconn.c b/netconn.c index aa4d5ba1..9db3a473 100755 --- a/netconn.c +++ b/netconn.c @@ -764,9 +764,9 @@ int NetConn_SendUnreliableMessage(netconn_t *conn, sizebuf_t *data, protocolvers sendreliable = true; } // outgoing unreliable packet number, and outgoing reliable packet number (0 or 1) - StoreLittleLong(sendbuffer, (unsigned int)conn->outgoing_unreliable_sequence | ((unsigned int)sendreliable<<31)); + StoreLittleLong(sendbuffer, conn->outgoing_unreliable_sequence | (((unsigned int)sendreliable)<<31)); // last received unreliable packet number, and last received reliable packet number (0 or 1) - StoreLittleLong(sendbuffer + 4, (unsigned int)conn->qw.incoming_sequence | ((unsigned int)conn->qw.incoming_reliable_sequence<<31)); + StoreLittleLong(sendbuffer + 4, conn->qw.incoming_sequence | (((unsigned int)conn->qw.incoming_reliable_sequence)<<31)); packetLen = 8; conn->outgoing_unreliable_sequence++; // client sends qport in every packet @@ -1212,7 +1212,7 @@ static int NetConn_ReceivedMessage(netconn_t *conn, const unsigned char *data, s if (protocol == PROTOCOL_QUAKEWORLD) { - int sequence, sequence_ack; + unsigned int sequence, sequence_ack; int reliable_ack, reliable_message; int count; //int qport; diff --git a/netconn.h b/netconn.h index fc13054f..44ea4775 100755 --- a/netconn.h +++ b/netconn.h @@ -197,14 +197,14 @@ typedef struct netconn_s int qport; // sequencing variables - int incoming_sequence; - int incoming_acknowledged; - int incoming_reliable_acknowledged; ///< single bit + unsigned int incoming_sequence; + unsigned int incoming_acknowledged; + qboolean incoming_reliable_acknowledged; ///< single bit - int incoming_reliable_sequence; ///< single bit, maintained local + qboolean incoming_reliable_sequence; ///< single bit, maintained local - int reliable_sequence; ///< single bit - int last_reliable_sequence; ///< sequence number of last send + qboolean reliable_sequence; ///< single bit + unsigned int last_reliable_sequence; ///< sequence number of last send } qw; -- 2.39.2