Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/engine/client/cl_cgame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ void CL_ConfigstringModified( Cmd::Args& csCmd )
/*
===================
CL_HandleServerCommand
CL_GetServerCommand

Returns true if the command should be passed to the cgame
===================
*/
bool CL_HandleServerCommand(Str::StringRef text, std::string& newText) {
Expand Down Expand Up @@ -255,13 +256,6 @@ void CL_FillServerCommands(std::vector<std::string>& commands, int start, int en
// if we have irretrievably lost a reliable command, drop the connection
if ( start <= clc.serverCommandSequence - MAX_RELIABLE_COMMANDS )
{
// when a demo record was started after the client got a whole bunch of
// reliable commands then the client never got those first reliable commands
if ( clc.demoplaying )
{
return;
}

Sys::Drop( "CL_FillServerCommand: a reliable command was cycled out" );
}

Expand Down
16 changes: 15 additions & 1 deletion src/engine/client/cl_parse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,14 @@ void CL_ParseGamestate( msg_t *msg )
CL_ClearState();

// a gamestate always marks a server command sequence
clc.serverCommandSequence = MSG_ReadLong( msg );
int commandNum = MSG_ReadLong( msg );

if ( commandNum < clc.serverCommandSequence )
{
Sys::Drop( "Gamestate moved serverCommandSequence backward" );
}

clc.serverCommandSequence = commandNum;

// trash any commands from previous game
clc.lastExecutedServerCommand = clc.serverCommandSequence;
Expand Down Expand Up @@ -499,6 +506,13 @@ void CL_ParseCommandString( msg_t *msg )
return;
}

if ( clc.serverCommandSequence + 1 != seq )
{
Sys::Drop( "Out-of-sequence server command: expected %d, got %d",
clc.serverCommandSequence + 1, seq );
return;
}

clc.serverCommandSequence = seq;

index = seq & ( MAX_RELIABLE_COMMANDS - 1 );
Expand Down
Loading