mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 04:12:39 +00:00
This commit is contained in:
parent
b1b7f975f1
commit
4c63d1ed40
4 changed files with 27 additions and 1 deletions
|
@ -166,6 +166,8 @@ typedef struct client_s {
|
||||||
// buffer them into this queue, and hand them out to netchan as needed
|
// buffer them into this queue, and hand them out to netchan as needed
|
||||||
netchan_buffer_t *netchan_start_queue;
|
netchan_buffer_t *netchan_start_queue;
|
||||||
netchan_buffer_t **netchan_end_queue;
|
netchan_buffer_t **netchan_end_queue;
|
||||||
|
|
||||||
|
int oldServerTime;
|
||||||
} client_t;
|
} client_t;
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
|
|
@ -1500,6 +1500,13 @@ void SV_ExecuteClientMessage( client_t *cl, msg_t *msg ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this client has acknowledged the new gamestate so it's
|
||||||
|
// safe to start sending it the real time again
|
||||||
|
if( cl->oldServerTime && serverId == sv.serverId ){
|
||||||
|
Com_DPrintf( "%s acknowledged gamestate\n", cl->name );
|
||||||
|
cl->oldServerTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
// read optional clientCommand strings
|
// read optional clientCommand strings
|
||||||
do {
|
do {
|
||||||
c = MSG_ReadByte( msg );
|
c = MSG_ReadByte( msg );
|
||||||
|
|
|
@ -396,6 +396,13 @@ void SV_SpawnServer( char *server, qboolean killBots ) {
|
||||||
Cvar_Set( "nextmap", "map_restart 0");
|
Cvar_Set( "nextmap", "map_restart 0");
|
||||||
// Cvar_Set( "nextmap", va("map %s", server) );
|
// Cvar_Set( "nextmap", va("map %s", server) );
|
||||||
|
|
||||||
|
for (i=0 ; i<sv_maxclients->integer ; i++) {
|
||||||
|
// save when the server started for each client already connected
|
||||||
|
if (svs.clients[i].state >= CS_CONNECTED) {
|
||||||
|
svs.clients[i].oldServerTime = sv.time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// wipe the entire per-level structure
|
// wipe the entire per-level structure
|
||||||
SV_ClearServer();
|
SV_ClearServer();
|
||||||
for ( i = 0 ; i < MAX_CONFIGSTRINGS ; i++ ) {
|
for ( i = 0 ; i < MAX_CONFIGSTRINGS ; i++ ) {
|
||||||
|
|
|
@ -160,7 +160,17 @@ static void SV_WriteSnapshotToClient( client_t *client, msg_t *msg ) {
|
||||||
|
|
||||||
// send over the current server time so the client can drift
|
// send over the current server time so the client can drift
|
||||||
// its view of time to try to match
|
// its view of time to try to match
|
||||||
MSG_WriteLong (msg, sv.time);
|
if( client->oldServerTime ) {
|
||||||
|
// The server has not yet got an acknowledgement of the
|
||||||
|
// new gamestate from this client, so continue to send it
|
||||||
|
// a time as if the server has not restarted. Note from
|
||||||
|
// the client's perspective this time is strictly speaking
|
||||||
|
// incorrect, but since it'll be busy loading a map at
|
||||||
|
// the time it doesn't really matter.
|
||||||
|
MSG_WriteLong (msg, sv.time + client->oldServerTime);
|
||||||
|
} else {
|
||||||
|
MSG_WriteLong (msg, sv.time);
|
||||||
|
}
|
||||||
|
|
||||||
// what we are delta'ing from
|
// what we are delta'ing from
|
||||||
MSG_WriteByte (msg, lastframe);
|
MSG_WriteByte (msg, lastframe);
|
||||||
|
|
Loading…
Reference in a new issue