Skip to content

Commit

Permalink
engine: client: ignore some out of band packets if we're not connecti…
Browse files Browse the repository at this point in the history
…ng to server
  • Loading branch information
a1batross committed Jun 11, 2023
1 parent 278ff22 commit 450f774
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions engine/client/cl_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1992,6 +1992,11 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
int realsize;
dword crcValue2 = 0;

// this message only used during connection
// it doesn't make sense after client_connect
if( cls.state != ca_connecting )
return;

if( !CL_IsFromConnectingServer( from ))
return;

Expand Down Expand Up @@ -2055,6 +2060,11 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
}
else if( !Q_strcmp( c, "challenge" ))
{
// this message only used during connection
// it doesn't make sense after client_connect
if( cls.state != ca_connecting )
return;

if( !CL_IsFromConnectingServer( from ))
return;

Expand All @@ -2073,6 +2083,11 @@ void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
}
else if( !Q_strcmp( c, "disconnect" ))
{
// this message only used during connection
// it doesn't make sense after client_connect
if( cls.state != ca_connecting )
return;

if( !CL_IsFromConnectingServer( from ))
return;

Expand Down

0 comments on commit 450f774

Please sign in to comment.