From ee0867e45271c6864d9c505d343018ba2fa992ea Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Mon, 14 Aug 2017 14:10:11 +0200 Subject: implement the placeholder client shit TODO: to review, debug, etc this change; and amend this description --- src/server/sv_ccmds.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/server/sv_ccmds.c') diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index 21a5f0e5..688f20b3 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -162,7 +162,10 @@ static void SV_MapRestart_f( void ) { // to give them the correct time so that when they finish loading // they don't violate the backwards time check in cl_cgame.c for (i=0 ; iinteger ; i++) { + svs.clients[i].view = NULL; if (svs.clients[i].state == CS_PRIMED) { + //if (svs.clients[i].isPlaceholder) + //continue; svs.clients[i].oldServerTime = sv.restartTime; } } @@ -195,11 +198,14 @@ static void SV_MapRestart_f( void ) { continue; } - // add the map_restart command - SV_AddServerCommand( client, "map_restart\n" ); + if (!client->isPlaceholder) + { + // add the map_restart command + SV_AddServerCommand( client, "map_restart\n" ); + } // connect the client again, without the firstTime flag - denied = VM_ExplicitArgPtr( gvm, VM_Call( gvm, GAME_CLIENT_CONNECT, i, qfalse ) ); + denied = VM_ExplicitArgPtr( gvm, VM_Call( gvm, GAME_CLIENT_CONNECT, i, qfalse, client->isPlaceholder ) ); if ( denied ) { // this generally shouldn't happen, because the client // was connected before the level change @@ -208,7 +214,12 @@ static void SV_MapRestart_f( void ) { continue; } - if(client->state == CS_ACTIVE) + if (client->isPlaceholder) + { + client->gentity = SV_GentityNum(i); + client->gentity->s.number = i; + } + else if (client->state == CS_ACTIVE) SV_ClientEnterWorld(client, &client->lastUsercmd); else { -- cgit