Skip to content

Commit

Permalink
Removed network message entirely
Browse files Browse the repository at this point in the history
Header needs to include more data to properly filter someone trying to connect
  • Loading branch information
Boondorl authored and RicardoLuis0 committed Nov 16, 2024
1 parent 8a14497 commit 4c14022
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/common/engine/i_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ static SOCKET mysocket = INVALID_SOCKET;
static sockaddr_in sendaddress[MAXNETNODES];
static uint8_t sendplayer[MAXNETNODES];

constexpr int NET_EXIT = 0x80;

#ifdef __WIN32__
const char *neterror (void);
#else
Expand Down Expand Up @@ -308,7 +306,7 @@ void PacketGet (void)
GetPlayerName(node).GetChars());
}

doomcom.data[0] = NET_EXIT;
doomcom.data[0] = NCMD_EXIT;
c = 1;
}
else if (err != WSAEWOULDBLOCK)
Expand Down Expand Up @@ -346,11 +344,8 @@ void PacketGet (void)
}
else if (c > 0)
{ //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] != NET_EXIT)
if (TransmitBuffer[0] == PRE_FAKE)
{
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
uint8_t msg[] = { PRE_FAKE, PRE_IN_PROGRESS };
PreSend(msg, 2, &fromaddress);
Expand Down

0 comments on commit 4c14022

Please sign in to comment.