summaryrefslogtreecommitdiff
path: root/src/server/sv_ccmds.c
diff options
context:
space:
mode:
author/dev/humancontroller <devhc@example.com>2017-08-14 14:10:11 +0200
committer/dev/humancontroller <devhc@example.com>2017-08-28 23:23:25 +0200
commitee0867e45271c6864d9c505d343018ba2fa992ea (patch)
treea5442bbbb7c38852af283268ac2b9bfcec325237 /src/server/sv_ccmds.c
parent3d980bbbc25f21f5d7d8d128f7b2044a9400280b (diff)
implement the placeholder client shit
TODO: to review, debug, etc this change; and amend this description
Diffstat (limited to 'src/server/sv_ccmds.c')
-rw-r--r--src/server/sv_ccmds.c19
1 files changed, 15 insertions, 4 deletions
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 ; i<sv_maxclients->integer ; 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
{