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