mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 14:20:59 +00:00
no more Max Headroom impersonations during level changes
This commit is contained in:
parent
e379238126
commit
8f0c6dffed
3 changed files with 22 additions and 5 deletions
|
@ -266,6 +266,8 @@ CL_ParseServerInfo (void)
|
|||
|
||||
Con_DPrintf ("Serverinfo packet received.\n");
|
||||
|
||||
S_BlockSound ();
|
||||
|
||||
// wipe the client_state_t struct
|
||||
CL_ClearState ();
|
||||
|
||||
|
@ -273,13 +275,13 @@ CL_ParseServerInfo (void)
|
|||
i = MSG_ReadLong (net_message);
|
||||
if (i != PROTOCOL_VERSION) {
|
||||
Con_Printf ("Server returned version %i, not %i", i, PROTOCOL_VERSION);
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
// parse maxclients
|
||||
cl.maxclients = MSG_ReadByte (net_message);
|
||||
if (cl.maxclients < 1 || cl.maxclients > MAX_SCOREBOARD) {
|
||||
Con_Printf ("Bad maxclients (%u) from server\n", cl.maxclients);
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
cl.scores = Hunk_AllocName (cl.maxclients * sizeof (*cl.scores), "scores");
|
||||
|
||||
|
@ -308,7 +310,7 @@ CL_ParseServerInfo (void)
|
|||
break;
|
||||
if (nummodels == MAX_MODELS) {
|
||||
Con_Printf ("Server sent too many model precaches\n");
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
strcpy (model_precache[nummodels], str);
|
||||
Mod_TouchModel (str);
|
||||
|
@ -322,7 +324,7 @@ CL_ParseServerInfo (void)
|
|||
break;
|
||||
if (numsounds == MAX_SOUNDS) {
|
||||
Con_Printf ("Server sent too many sound precaches\n");
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
strcpy (sound_precache[numsounds], str);
|
||||
S_TouchSound (str);
|
||||
|
@ -336,7 +338,7 @@ CL_ParseServerInfo (void)
|
|||
cl.model_precache[i] = Mod_ForName (model_precache[i], false);
|
||||
if (cl.model_precache[i] == NULL) {
|
||||
Con_Printf ("Model %s not found\n", model_precache[i]);
|
||||
return;
|
||||
goto done;
|
||||
}
|
||||
CL_KeepaliveMessage ();
|
||||
}
|
||||
|
@ -356,6 +358,8 @@ CL_ParseServerInfo (void)
|
|||
|
||||
noclip_anglehack = false; // noclip is turned off at start
|
||||
r_gravity = 800.0; // Set up gravity for renderer effects
|
||||
done:
|
||||
S_UnblockSound ();
|
||||
}
|
||||
|
||||
int bitcounts[16];
|
||||
|
|
|
@ -311,6 +311,16 @@ V_Init_Cvars (void)
|
|||
{
|
||||
}
|
||||
|
||||
void
|
||||
S_BlockSound (void)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
S_UnblockSound (void)
|
||||
{
|
||||
}
|
||||
|
||||
plugin_t *console_client_PluginInfo (void);
|
||||
plugin_t *
|
||||
console_client_PluginInfo (void)
|
||||
|
|
|
@ -903,6 +903,7 @@ SV_SpawnServer (const char *server)
|
|||
int i;
|
||||
edict_t *ent;
|
||||
|
||||
S_BlockSound ();
|
||||
// let's not have any servers with no name
|
||||
if (hostname->string[0] == 0)
|
||||
Cvar_Set (hostname, "UNNAMED");
|
||||
|
@ -974,6 +975,7 @@ SV_SpawnServer (const char *server)
|
|||
if (!sv.worldmodel) {
|
||||
Con_Printf ("Couldn't spawn server %s\n", sv.modelname);
|
||||
sv.active = false;
|
||||
S_UnblockSound ();
|
||||
return;
|
||||
}
|
||||
sv.models[1] = sv.worldmodel;
|
||||
|
@ -1038,4 +1040,5 @@ SV_SpawnServer (const char *server)
|
|||
SV_SendServerinfo (host_client);
|
||||
|
||||
Con_DPrintf ("Server spawned.\n");
|
||||
S_UnblockSound ();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue