mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
fix crash with Q2 server, server/client handles Q2 map checksum, server sets Q2 airaccelerate on init
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2177 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
1adb96907a
commit
e40c7f8a87
4 changed files with 30 additions and 3 deletions
|
@ -2286,6 +2286,18 @@ void CLQ2_ParseConfigString (void)
|
|||
// if (cl.refresh_prepped && strcmp(olds, s))
|
||||
CLQ2_ParseClientinfo (i-Q2CS_PLAYERSKINS, s);
|
||||
}
|
||||
else if (i == Q2CS_MAPCHECKSUM)
|
||||
{
|
||||
extern int map_checksum;
|
||||
int serverchecksum = atoi(s);
|
||||
|
||||
if (cl.worldmodel && (cl.worldmodel->fromgame == fg_quake2 || cl.worldmodel->fromgame == fg_quake3))
|
||||
{
|
||||
// the Q2 client normally exits here, however for our purposes we might as well ignore it
|
||||
if (map_checksum != serverchecksum)
|
||||
Con_Printf(S_WARNING "WARNING: Client checksum does not match server checksum (%i != %i)", map_checksum, serverchecksum);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef VM_UI
|
||||
UI_StringChanged(i);
|
||||
|
|
|
@ -2732,9 +2732,8 @@ void Cmd_WriteConfig_f(void)
|
|||
return;
|
||||
}
|
||||
|
||||
filename = va("configs/%s.cfg",filename);
|
||||
filename = va("configs/%s",filename);
|
||||
}
|
||||
COM_StripExtension(filename, fname, sizeof(fname));
|
||||
COM_DefaultExtension(fname, ".cfg", sizeof(fname));
|
||||
FS_CreatePath(filename, FS_CONFIGONLY);
|
||||
f = FS_OpenVFS(filename, "wb", FS_CONFIGONLY);
|
||||
|
|
|
@ -892,7 +892,22 @@ void SV_SpawnServer (char *server, char *startspot, qboolean noents, qboolean us
|
|||
#ifdef Q2SERVER
|
||||
else if (svs.gametype == GT_QUAKE2)
|
||||
{
|
||||
extern int map_checksum;
|
||||
extern cvar_t sv_airaccelerate;
|
||||
|
||||
memset(sv.strings.configstring, 0, sizeof(sv.strings.configstring));
|
||||
|
||||
if (deathmatch.value)
|
||||
sprintf(sv.strings.configstring[Q2CS_AIRACCEL], "%g", sv_airaccelerate.value);
|
||||
else
|
||||
strcpy(sv.strings.configstring[Q2CS_AIRACCEL], "0");
|
||||
|
||||
// init map checksum config string but only for Q2/Q3 maps
|
||||
if (sv.worldmodel->fromgame == fg_quake2 || sv.worldmodel->fromgame == fg_quake3)
|
||||
sprintf(sv.strings.configstring[Q2CS_MAPCHECKSUM], "%i", map_checksum);
|
||||
else
|
||||
strcpy(sv.strings.configstring[Q2CS_MAPCHECKSUM], "0");
|
||||
|
||||
strcpy(sv.strings.configstring[Q2CS_MODELS+1], sv.modelname);
|
||||
for (i=1; i<sv.worldmodel->numsubmodels; i++)
|
||||
{
|
||||
|
|
|
@ -1245,7 +1245,8 @@ void SV_Begin_f (void)
|
|||
return;
|
||||
}
|
||||
|
||||
host_client->edict->v->playerclass = host_client->playerclass; //make sure it's set the same as the userinfo
|
||||
if (progstype == PROG_H2)
|
||||
host_client->edict->v->playerclass = host_client->playerclass; //make sure it's set the same as the userinfo
|
||||
|
||||
for (split = host_client; split; split = split->controlled)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue