Removed network message entirely

Header needs to include more data to properly filter someone trying to connect
This commit is contained in:
Boondorl 2024-11-06 20:02:44 -05:00 committed by Ricardo Luís Vaz Silva
parent 8a14497d8c
commit 4c140224a2

View file

@ -117,8 +117,6 @@ static SOCKET mysocket = INVALID_SOCKET;
static sockaddr_in sendaddress[MAXNETNODES]; static sockaddr_in sendaddress[MAXNETNODES];
static uint8_t sendplayer[MAXNETNODES]; static uint8_t sendplayer[MAXNETNODES];
constexpr int NET_EXIT = 0x80;
#ifdef __WIN32__ #ifdef __WIN32__
const char *neterror (void); const char *neterror (void);
#else #else
@ -308,7 +306,7 @@ void PacketGet (void)
GetPlayerName(node).GetChars()); GetPlayerName(node).GetChars());
} }
doomcom.data[0] = NET_EXIT; doomcom.data[0] = NCMD_EXIT;
c = 1; c = 1;
} }
else if (err != WSAEWOULDBLOCK) else if (err != WSAEWOULDBLOCK)
@ -346,11 +344,8 @@ void PacketGet (void)
} }
else if (c > 0) else if (c > 0)
{ //The packet is not from any in-game node, so we might as well discard it. { //The packet is not from any in-game node, so we might as well discard it.
// Don't show the message for disconnect notifications. if (TransmitBuffer[0] == PRE_FAKE)
if (TransmitBuffer[0] != NET_EXIT)
{ {
if (TransmitBuffer[0] != PRE_FAKE)
DPrintf(DMSG_WARNING, "Dropped packet: Unknown host (%s:%d)\n", inet_ntoa(fromaddress.sin_addr), fromaddress.sin_port);
// If it's someone waiting in the lobby, let them know the game already started // If it's someone waiting in the lobby, let them know the game already started
uint8_t msg[] = { PRE_FAKE, PRE_IN_PROGRESS }; uint8_t msg[] = { PRE_FAKE, PRE_IN_PROGRESS };
PreSend(msg, 2, &fromaddress); PreSend(msg, 2, &fromaddress);