q3server fixes (so the start-game stuff works).
status command crashing with botclient is fixed. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@1284 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
94cebfb172
commit
99073074ba
1 changed files with 41 additions and 3 deletions
|
@ -423,6 +423,7 @@ void SV_Map_f (void)
|
|||
qboolean newunit = false;
|
||||
qboolean cinematic = false;
|
||||
qboolean waschangelevel = false;
|
||||
qboolean wasspmap = false;
|
||||
int i;
|
||||
char *startspot;
|
||||
|
||||
|
@ -436,6 +437,7 @@ void SV_Map_f (void)
|
|||
startspot = ((Cmd_Argc() == 2)?NULL:Cmd_Argv(2));
|
||||
|
||||
waschangelevel = !strcmp(Cmd_Argv(0), "changelevel");
|
||||
wasspmap = !strcmp(Cmd_Argv(0), "spmap");
|
||||
|
||||
nextserver = strchr(level, '+');
|
||||
if (nextserver)
|
||||
|
@ -482,6 +484,15 @@ void SV_Map_f (void)
|
|||
}
|
||||
else
|
||||
{
|
||||
sprintf (expanded, "maps/%s.bsp", level);
|
||||
if (!COM_FCheckExists (expanded))
|
||||
{
|
||||
//doesn't exist, so try lowercase. Q3 does this.
|
||||
for (i = 0; i < sizeof(level); i++)
|
||||
{
|
||||
if (level[i] >= 'A' && level[i] <= 'Z')
|
||||
level[i] = level[i] - 'A' + 'a';
|
||||
}
|
||||
sprintf (expanded, "maps/%s.bsp", level);
|
||||
if (!COM_FCheckExists (expanded))
|
||||
{
|
||||
|
@ -489,6 +500,7 @@ void SV_Map_f (void)
|
|||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sv.mvdrecording)
|
||||
SV_MVDStop_f();
|
||||
|
@ -525,6 +537,17 @@ void SV_Map_f (void)
|
|||
SV_SaveLevelCache(false);
|
||||
}
|
||||
|
||||
#ifdef Q3SERVER
|
||||
{
|
||||
cvar_t *gametype;
|
||||
gametype = Cvar_Get("g_gametype", "0", CVAR_LATCH, "Q3 compatability");
|
||||
if (wasspmap)
|
||||
Cvar_ForceSet(gametype, "2");
|
||||
else if (gametype->value == 2) //singleplayer
|
||||
Cvar_ForceSet(gametype, "0");
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i=0 ; i<MAX_CLIENTS ; i++) //we need to drop all q2 clients. We don't mix q1w with q2.
|
||||
{
|
||||
if (svs.clients[i].state>cs_connected) //so that we don't send a datagram
|
||||
|
@ -936,6 +959,11 @@ void SV_Status_f (void)
|
|||
else
|
||||
Con_Printf("\n");
|
||||
|
||||
if (cl->istobeloaded && cl->state == cs_zombie)
|
||||
s = "LoadZombie";
|
||||
else if (cl->protocol == SCP_BAD)
|
||||
s = "bot";
|
||||
else
|
||||
s = NET_BaseAdrToString ( cl->netchan.remote_address);
|
||||
Con_Printf (" %-16.16s", s);
|
||||
if (cl->state == cs_connected)
|
||||
|
@ -966,6 +994,8 @@ void SV_Status_f (void)
|
|||
|
||||
if (cl->istobeloaded && cl->state == cs_zombie)
|
||||
s = "LoadZombie";
|
||||
else if (cl->protocol == SCP_BAD)
|
||||
s = "bot";
|
||||
else
|
||||
s = NET_BaseAdrToString ( cl->netchan.remote_address);
|
||||
Con_Printf ("%s", s);
|
||||
|
@ -1557,6 +1587,11 @@ void SV_SetTimer_f(void)
|
|||
|
||||
void SV_SendGameCommand_f(void)
|
||||
{
|
||||
#ifdef Q3SERVER
|
||||
if (SVQ3_ConsoleCommand())
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef Q2SERVER
|
||||
if (ge)
|
||||
{
|
||||
|
@ -1614,6 +1649,9 @@ void SV_InitOperatorCommands (void)
|
|||
|
||||
Cmd_AddCommand ("killserver", SV_KillServer_f);
|
||||
Cmd_AddCommand ("map", SV_Map_f);
|
||||
#ifdef Q3SERVER
|
||||
Cmd_AddCommand ("spmap", SV_Map_f);
|
||||
#endif
|
||||
Cmd_AddCommand ("gamemap", SV_Map_f);
|
||||
Cmd_AddCommand ("changelevel", SV_Map_f);
|
||||
Cmd_AddCommand ("listmaps", SV_MapList_f);
|
||||
|
|
Loading…
Reference in a new issue