// free the client (the body stays around)
if (!crash)
{
- // LordHavoc: no opportunity for resending, so use unreliable
+ // LordHavoc: no opportunity for resending, so use unreliable 3 times
MSG_WriteByte(&host_client->message, svc_disconnect);
NetConn_SendUnreliableMessage(host_client->netconnection, &host_client->message);
+ NetConn_SendUnreliableMessage(host_client->netconnection, &host_client->message);
+ NetConn_SendUnreliableMessage(host_client->netconnection, &host_client->message);
}
// break the net connection
NetConn_Close(host_client->netconnection);
// call qc ClientDisconnect function
// LordHavoc: don't call QC if server is dead (avoids recursive
// Host_Error in some mods when they run out of edicts)
- if (host_client->active && sv.active && host_client->edict && host_client->spawned)
+ if (host_client->clientconnectcalled && sv.active && host_client->edict)
{
// call the prog function for removing a client
// this will set the body to a dead frame, among other things
int saveSelf = pr_global_struct->self;
+ host_client->clientconnectcalled = false;
pr_global_struct->self = EDICT_TO_PROG(host_client->edict);
PR_ExecuteProgram(pr_global_struct->ClientDisconnect, "QC function ClientDisconnect is missing");
pr_global_struct->self = saveSelf;
}
// remove leaving player from scoreboard
- //host_client->edict->v->netname = PR_SetString(host_client->name);
+ //host_client->edict->v->netname = PR_SetEngineString(host_client->name);
//if ((val = GETEDICTFIELDVALUE(host_client->edict, eval_clientcolors)))
// val->_float = 0;
//host_client->edict->v->frags = 0;
if (sv.paused || (cl.islocalgame && (key_dest != key_game || key_consoleactive)))
sv.frametime = 0;
- pr_global_struct->frametime = sv.frametime;
-
// set the time and clear the general datagram
SV_ClearDatagram();
// come in midframe (particularly if host is running really slow)
NetConn_ServerFrame();
- // read client messages
- SV_RunClients();
-
// move things around and think unless paused
if (sv.frametime)
SV_Physics();
time2 = Sys_DoubleTime();
// update audio
- if (cls.signon == SIGNONS && cl_entities[cl.viewentity].state_current.active)
- {
- // LordHavoc: this used to use renderer variables (eww)
- S_Update(&cl_entities[cl.viewentity].render.matrix);
- }
- else
- S_Update(&identitymatrix);
+ S_Update(&r_refdef.viewentitymatrix);
CDAudio_Update();
}
isdown = true;
+ // be quiet while shutting down
+ S_StopAllSounds();
+
// disconnect client from server if active
CL_Disconnect();