diff options
Diffstat (limited to 'src/server/sv_init.c')
-rw-r--r-- | src/server/sv_init.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/server/sv_init.c b/src/server/sv_init.c index 236c3d98..316c71a1 100644 --- a/src/server/sv_init.c +++ b/src/server/sv_init.c @@ -196,6 +196,8 @@ void SV_SetConfigstring (int index, const char *val) { // send the data to all relevent clients for (i = 0, client = svs.clients; i < sv_maxclients->integer ; i++, client++) { + if (client->isPlaceholder) + continue; if ( index <= CS_SYSTEMINFO && !modified[ client->netchan.alternateProtocol ] ) { continue; } @@ -250,6 +252,8 @@ void SV_SetConfigstringRestrictions (int index, const clientList_t* clientList) for ( i = 0 ; i < sv_maxclients->integer ; i++ ) { if ( svs.clients[i].state >= CS_CONNECTED ) { + if (svs.clients[i].isPlaceholder) + continue; if ( Com_ClientListContains( &oldClientList, i ) != Com_ClientListContains( clientList, i ) ) { // A client has left or joined the restricted list, so update @@ -277,6 +281,9 @@ void SV_SetUserinfo( int index, const char *val ) { Q_strncpyz( svs.clients[index].userinfo, val, sizeof( svs.clients[ index ].userinfo ) ); Q_strncpyz( svs.clients[index].name, Info_ValueForKey( val, "name" ), sizeof(svs.clients[index].name) ); + + if (svs.clients[index].isPlaceholder) + svs.clients[index].ping = atoi(Info_ValueForKey(val, "ping")); } @@ -542,8 +549,11 @@ void SV_SpawnServer( char *server, qboolean killBots ) { svs.snapFlagServerBit ^= SNAPFLAG_SERVERCOUNT; for (i=0 ; i<sv_maxclients->integer ; i++) { + svs.clients[i].view = NULL; // save when the server started for each client already connected if (svs.clients[i].state >= CS_CONNECTED) { + if (svs.clients[i].isPlaceholder) + continue; svs.clients[i].oldServerTime = sv.time; } } @@ -610,7 +620,7 @@ void SV_SpawnServer( char *server, qboolean killBots ) { char *denied; // connect the client again - denied = VM_ExplicitArgPtr( gvm, VM_Call( gvm, GAME_CLIENT_CONNECT, i, qfalse ) ); // firstTime = qfalse + denied = VM_ExplicitArgPtr( gvm, VM_Call( gvm, GAME_CLIENT_CONNECT, i, qfalse, svs.clients[i].isPlaceholder ) ); // firstTime = qfalse if ( denied ) { // this generally shouldn't happen, because the client // was connected before the level change @@ -619,6 +629,12 @@ void SV_SpawnServer( char *server, qboolean killBots ) { // when we get the next packet from a connected client, // the new gamestate will be sent svs.clients[i].state = CS_CONNECTED; + if (svs.clients[i].isPlaceholder) + { + svs.clients[i].state = CS_ACTIVE; + svs.clients[i].gentity = SV_GentityNum(i); + svs.clients[i].gentity->s.number = i; + } } } } @@ -787,6 +803,8 @@ void SV_FinalMessage( char *message ) { for ( j = 0 ; j < 2 ; j++ ) { for (i=0, cl = svs.clients ; i < sv_maxclients->integer ; i++, cl++) { if (cl->state >= CS_CONNECTED) { + if (cl->isPlaceholder) + continue; // don't send a disconnect to a local client if ( cl->netchan.remoteAddress.type != NA_LOOPBACK ) { SV_SendServerCommand( cl, "print \"%s\n\"\n", message ); |