This would be the real fix for stuff left over from the #ifdef massacre.

The last two revsions were failed attempts to do this
This commit is contained in:
Dan Olson 2000-05-14 20:25:49 +00:00
parent 4baa81458a
commit bfbfc01491
3 changed files with 26 additions and 14 deletions

View file

@ -249,12 +249,7 @@ typedef struct
challenge_t challenges[MAX_CHALLENGES]; // to prevent invalid IPs from connecting
} server_static_t;
typedef struct foobar_s {
qboolean demoplayback;
int qport;
} foobar_t;
extern foobar_t cls;
extern client_state_t cls;
//=============================================================================

View file

@ -137,8 +137,14 @@ void Netchan_OutOfBand (netadr_t adr, int length, byte *data)
// send the datagram
//zoid, no input in demo playback mode
if (!cls.demoplayback)
if (!is_server)
{
if (!cls.demoplayback)
NET_SendPacket (send.cursize, send.data, adr);
}
else
NET_SendPacket (send.cursize, send.data, adr);
}
/*
@ -296,7 +302,12 @@ void Netchan_Transmit (netchan_t *chan, int length, byte *data)
chan->outgoing_time[i] = realtime;
//zoid, no input in demo playback mode
if (!cls.demoplayback)
if (!is_server)
{
if (!cls.demoplayback)
NET_SendPacket (send.cursize, send.data, chan->remote_address);
}
else
NET_SendPacket (send.cursize, send.data, chan->remote_address);
if (chan->cleartime < realtime)
@ -330,11 +341,17 @@ qboolean Netchan_Process (netchan_t *chan)
unsigned reliable_ack, reliable_message;
int qport;
if ( !cls.demoplayback &&
!NET_CompareAdr (net_from, chan->remote_address))
return false;
else if (is_server && !NET_CompareAdr (net_from, chan->remote_address))
return false;
if (is_server)
{
if ( !NET_CompareAdr (net_from,chan->remote_address))
return false;
}
else
{
if ( !cls.demoplayback &&
!NET_CompareAdr (net_from, chan->remote_address))
return false;
}
// get sequence numbers
MSG_BeginReading ();

View file

@ -27,7 +27,7 @@
*/
#include "qwsvdef.h"
foobar_t cls = {true, 0};
client_state_t cls;
void
Draw_BeginDisc(void)