net_dgrm.c: removed the DEBUG build condition around the "Forged packet received"

message prints. Tiny whitespace tidy up.

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@525 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2011-12-18 09:50:49 +00:00
parent 7a7fe8f4c9
commit d076443923

View file

@ -46,8 +46,6 @@ static int receivedDuplicateCount = 0;
static int shortPacketCount = 0; static int shortPacketCount = 0;
static int droppedDatagrams; static int droppedDatagrams;
static int myDriverLevel;
static struct static struct
{ {
unsigned int length; unsigned int length;
@ -55,11 +53,12 @@ static struct
byte data[MAX_DATAGRAM]; byte data[MAX_DATAGRAM];
} packetBuffer; } packetBuffer;
static int myDriverLevel;
extern qboolean m_return_onerror; extern qboolean m_return_onerror;
extern char m_return_reason[32]; extern char m_return_reason[32];
//#ifdef DEBUG
static char *StrAddr (struct qsockaddr *addr) static char *StrAddr (struct qsockaddr *addr)
{ {
static char buf[34]; static char buf[34];
@ -70,7 +69,6 @@ static char *StrAddr (struct qsockaddr *addr)
sprintf (buf + n * 2, "%02x", *p++); sprintf (buf + n * 2, "%02x", *p++);
return buf; return buf;
} }
//#endif
#ifdef BAN_TEST #ifdef BAN_TEST
@ -305,8 +303,8 @@ int Datagram_GetMessage (qsocket_t *sock)
{ {
length = sfunc.Read (sock->socket, (byte *)&packetBuffer, NET_DATAGRAMSIZE, &readaddr); length = sfunc.Read (sock->socket, (byte *)&packetBuffer, NET_DATAGRAMSIZE, &readaddr);
// if ((rand() & 255) > 220) // if ((rand() & 255) > 220)
// continue; // continue;
if (length == 0) if (length == 0)
break; break;
@ -319,11 +317,9 @@ int Datagram_GetMessage (qsocket_t *sock)
if (sfunc.AddrCompare(&readaddr, &sock->addr) != 0) if (sfunc.AddrCompare(&readaddr, &sock->addr) != 0)
{ {
#ifdef DEBUG
Con_Printf("Forged packet received\n"); Con_Printf("Forged packet received\n");
Con_Printf("Expected: %s\n", StrAddr (&sock->addr)); Con_Printf("Expected: %s\n", StrAddr (&sock->addr));
Con_Printf("Received: %s\n", StrAddr (&readaddr)); Con_Printf("Received: %s\n", StrAddr (&readaddr));
#endif
continue; continue;
} }
@ -519,6 +515,7 @@ static const char *Strip_Port (const char *host)
return noport; return noport;
} }
static qboolean testInProgress = false; static qboolean testInProgress = false;
static int testPollCount; static int testPollCount;
static int testDriver; static int testDriver;
@ -793,6 +790,7 @@ int Datagram_Init (void)
banMask.s_addr = INADDR_NONE; banMask.s_addr = INADDR_NONE;
#endif #endif
myDriverLevel = net_driverlevel; myDriverLevel = net_driverlevel;
Cmd_AddCommand ("net_stats", NET_Stats_f); Cmd_AddCommand ("net_stats", NET_Stats_f);
if (safemode || COM_CheckParm("-nolan")) if (safemode || COM_CheckParm("-nolan"))
@ -1308,12 +1306,10 @@ static qsocket_t *_Datagram_Connect (const char *host)
// is it from the right place? // is it from the right place?
if (sfunc.AddrCompare(&readaddr, &sendaddr) != 0) if (sfunc.AddrCompare(&readaddr, &sendaddr) != 0)
{ {
//#ifdef DEBUG
Con_Printf("wrong reply address\n"); Con_Printf("wrong reply address\n");
Con_Printf("Expected: %s | %s\n", dfunc.AddrToString (&sendaddr), StrAddr(&sendaddr)); Con_Printf("Expected: %s | %s\n", dfunc.AddrToString (&sendaddr), StrAddr(&sendaddr));
Con_Printf("Received: %s | %s\n", dfunc.AddrToString (&readaddr), StrAddr(&readaddr)); Con_Printf("Received: %s | %s\n", dfunc.AddrToString (&readaddr), StrAddr(&readaddr));
SCR_UpdateScreen (); SCR_UpdateScreen ();
//#endif
ret = 0; ret = 0;
continue; continue;
} }