Revert protocol 69 pending further discussion (#4962)
This commit is contained in:
parent
88693f9abd
commit
d34c6b7e0b
12 changed files with 247 additions and 508 deletions
|
@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#endif
|
||||
|
||||
int demo_protocols[] =
|
||||
{ 67, 66, 0 };
|
||||
{ 66, 67, 68, 0 };
|
||||
|
||||
#define MAX_NUM_ARGVS 50
|
||||
|
||||
|
@ -86,9 +86,6 @@ cvar_t *com_maxfpsMinimized;
|
|||
cvar_t *com_abnormalExit;
|
||||
cvar_t *com_standalone;
|
||||
cvar_t *com_protocol;
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
cvar_t *com_oldprotocol;
|
||||
#endif
|
||||
cvar_t *com_basegame;
|
||||
cvar_t *com_homepath;
|
||||
cvar_t *com_busyWait;
|
||||
|
@ -2713,9 +2710,6 @@ void Com_Init( char *commandLine ) {
|
|||
s = va("%s %s %s", Q3_VERSION, PLATFORM_STRING, __DATE__ );
|
||||
com_version = Cvar_Get ("version", s, CVAR_ROM | CVAR_SERVERINFO );
|
||||
com_protocol = Cvar_Get ("protocol", va("%i", PROTOCOL_VERSION), CVAR_SERVERINFO | CVAR_INIT);
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
com_oldprotocol = Cvar_Get ("oldprotocol", va("%i", PROTOCOL_OLD_VERSION), CVAR_INIT);
|
||||
#endif
|
||||
|
||||
Sys_Init();
|
||||
|
||||
|
|
|
@ -1030,11 +1030,6 @@ qboolean FS_IsDemoExt(const char *filename, int namelen)
|
|||
if(protocol == com_protocol->integer)
|
||||
return qtrue;
|
||||
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
if(protocol == PROTOCOL_OLD_VERSION)
|
||||
return qtrue;
|
||||
#endif
|
||||
|
||||
for(index = 0; demo_protocols[index]; index++)
|
||||
{
|
||||
if(demo_protocols[index] == protocol)
|
||||
|
|
|
@ -83,12 +83,7 @@ Netchan_Setup
|
|||
called to open a channel to a remote system
|
||||
==============
|
||||
*/
|
||||
void Netchan_Setup(netsrc_t sock, netchan_t *chan, netadr_t adr, int qport, int challenge
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
, qboolean compat
|
||||
#endif
|
||||
)
|
||||
{
|
||||
void Netchan_Setup( netsrc_t sock, netchan_t *chan, netadr_t adr, int qport ) {
|
||||
Com_Memset (chan, 0, sizeof(*chan));
|
||||
|
||||
chan->sock = sock;
|
||||
|
@ -96,10 +91,6 @@ void Netchan_Setup(netsrc_t sock, netchan_t *chan, netadr_t adr, int qport, int
|
|||
chan->qport = qport;
|
||||
chan->incomingSequence = 0;
|
||||
chan->outgoingSequence = 1;
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
chan->compat = compat;
|
||||
chan->challenge = challenge;
|
||||
#endif
|
||||
}
|
||||
|
||||
// TTimo: unused, commenting out to make gcc happy
|
||||
|
@ -199,24 +190,17 @@ void Netchan_TransmitNextFragment( netchan_t *chan ) {
|
|||
msg_t send;
|
||||
byte send_buf[MAX_PACKETLEN];
|
||||
int fragmentLength;
|
||||
int outgoingSequence;
|
||||
|
||||
// write the packet header
|
||||
MSG_InitOOB (&send, send_buf, sizeof(send_buf)); // <-- only do the oob here
|
||||
|
||||
outgoingSequence = chan->outgoingSequence | FRAGMENT_BIT;
|
||||
MSG_WriteLong(&send, outgoingSequence);
|
||||
MSG_WriteLong( &send, chan->outgoingSequence | FRAGMENT_BIT );
|
||||
|
||||
// send the qport if we are a client
|
||||
if ( chan->sock == NS_CLIENT ) {
|
||||
MSG_WriteShort( &send, qport->integer );
|
||||
}
|
||||
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
if(!chan->compat)
|
||||
#endif
|
||||
MSG_WriteLong(&send, NETCHAN_GENCHECKSUM(chan->challenge, chan->outgoingSequence));
|
||||
|
||||
// copy the reliable message to the packet first
|
||||
fragmentLength = FRAGMENT_SIZE;
|
||||
if ( chan->unsentFragmentStart + fragmentLength > chan->unsentLength ) {
|
||||
|
@ -284,17 +268,12 @@ void Netchan_Transmit( netchan_t *chan, int length, const byte *data ) {
|
|||
MSG_InitOOB (&send, send_buf, sizeof(send_buf));
|
||||
|
||||
MSG_WriteLong( &send, chan->outgoingSequence );
|
||||
chan->outgoingSequence++;
|
||||
|
||||
// send the qport if we are a client
|
||||
if(chan->sock == NS_CLIENT)
|
||||
MSG_WriteShort(&send, qport->integer);
|
||||
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
if(!chan->compat)
|
||||
#endif
|
||||
MSG_WriteLong(&send, NETCHAN_GENCHECKSUM(chan->challenge, chan->outgoingSequence));
|
||||
|
||||
chan->outgoingSequence++;
|
||||
if ( chan->sock == NS_CLIENT ) {
|
||||
MSG_WriteShort( &send, qport->integer );
|
||||
}
|
||||
|
||||
MSG_WriteData( &send, data, length );
|
||||
|
||||
|
@ -348,17 +327,6 @@ qboolean Netchan_Process( netchan_t *chan, msg_t *msg ) {
|
|||
qport = MSG_ReadShort( msg );
|
||||
}
|
||||
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
if(!chan->compat)
|
||||
#endif
|
||||
{
|
||||
int checksum = MSG_ReadLong(msg);
|
||||
|
||||
// UDP spoofing protection
|
||||
if(NETCHAN_GENCHECKSUM(chan->challenge, sequence) != checksum)
|
||||
return qfalse;
|
||||
}
|
||||
|
||||
// read the fragment information
|
||||
if ( fragmented ) {
|
||||
fragmentStart = MSG_ReadShort( msg );
|
||||
|
|
|
@ -962,7 +962,7 @@ int Q_CountChar(const char *string, char tocount)
|
|||
return count;
|
||||
}
|
||||
|
||||
int QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
||||
void QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
||||
{
|
||||
int len;
|
||||
va_list argptr;
|
||||
|
@ -973,8 +973,6 @@ int QDECL Com_sprintf(char *dest, int size, const char *fmt, ...)
|
|||
|
||||
if(len >= size)
|
||||
Com_Printf("Com_sprintf: Output length %d too short, require %d bytes.\n", size, len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -34,7 +34,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define GAMENAME_FOR_MASTER "iofoo3" // must NOT contain whitespaces
|
||||
#define HEARTBEAT_FOR_MASTER GAMENAME_FOR_MASTER
|
||||
#define FLATLINE_FOR_MASTER GAMENAME_FOR_MASTER "dead"
|
||||
// #define PROTOCOL_SUPPORT_OLD // You probably don't need this for your standalone game
|
||||
#else
|
||||
#define PRODUCT_NAME "ioq3"
|
||||
#define BASEGAME "baseq3"
|
||||
|
@ -43,7 +42,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#define GAMENAME_FOR_MASTER "Quake3Arena"
|
||||
#define HEARTBEAT_FOR_MASTER "QuakeArena-1"
|
||||
#define FLATLINE_FOR_MASTER HEARTBEAT_FOR_MASTER
|
||||
#define PROTOCOL_SUPPORT_OLD
|
||||
#endif
|
||||
|
||||
#define BASETA "missionpack"
|
||||
|
@ -684,7 +682,7 @@ void Parse2DMatrix (char **buf_p, int y, int x, float *m);
|
|||
void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m);
|
||||
int Com_HexStrToInt( const char *str );
|
||||
|
||||
int QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
void QDECL Com_sprintf (char *dest, int size, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
|
||||
|
||||
char *Com_SkipTokens( char *s, int numTokens, char *sep );
|
||||
char *Com_SkipCharset( char *s, char *sep );
|
||||
|
|
|
@ -194,8 +194,7 @@ void NET_Sleep(int msec);
|
|||
|
||||
#define MAX_DOWNLOAD_WINDOW 8 // max of eight download frames
|
||||
#define MAX_DOWNLOAD_BLKSIZE 2048 // 2048 byte block chunks
|
||||
|
||||
#define NETCHAN_GENCHECKSUM(challenge, sequence) ((challenge) ^ ((sequence) * (challenge)))
|
||||
|
||||
|
||||
/*
|
||||
Netchan handles packet fragmentation and out of order / duplicate suppression
|
||||
|
@ -224,20 +223,10 @@ typedef struct {
|
|||
int unsentFragmentStart;
|
||||
int unsentLength;
|
||||
byte unsentBuffer[MAX_MSGLEN];
|
||||
|
||||
int challenge;
|
||||
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
qboolean compat;
|
||||
#endif
|
||||
} netchan_t;
|
||||
|
||||
void Netchan_Init( int qport );
|
||||
void Netchan_Setup(netsrc_t sock, netchan_t *chan, netadr_t adr, int qport, int challenge
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
, qboolean compat
|
||||
#endif
|
||||
);
|
||||
void Netchan_Setup( netsrc_t sock, netchan_t *chan, netadr_t adr, int qport );
|
||||
|
||||
void Netchan_Transmit( netchan_t *chan, int length, const byte *data );
|
||||
void Netchan_TransmitNextFragment( netchan_t *chan );
|
||||
|
@ -253,8 +242,7 @@ PROTOCOL
|
|||
==============================================================
|
||||
*/
|
||||
|
||||
#define PROTOCOL_VERSION 69
|
||||
#define PROTOCOL_OLD_VERSION 68
|
||||
#define PROTOCOL_VERSION 68
|
||||
// 1.31 - 67
|
||||
|
||||
// maintain a list of compatible protocols for demo playing
|
||||
|
@ -869,9 +857,6 @@ extern cvar_t *cl_packetdelay;
|
|||
extern cvar_t *sv_packetdelay;
|
||||
|
||||
extern cvar_t *com_protocol;
|
||||
#ifdef PROTOCOL_SUPPORT_OLD
|
||||
extern cvar_t *com_oldprotocol;
|
||||
#endif
|
||||
|
||||
// com_speeds times
|
||||
extern int time_game;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue