engine/EngineHostCommand.c
/*	handle a
	map <servername>
	command from the console.  Active clients are kicked off.
*/
handle a
map 
command from the console.  Active clients are kicked off.
handle a map command from the console . Active clients are kicked off .
void Host_Map_f (void)
{
	int		i;
	char	name[MAX_QPATH];
	if (cmd_source != src_command)
		return;
	cls.demonum = -1;		
	CL_Disconnect ();
	Host_ShutdownServer(false);
	key_dest = key_game;			
	Input_ActivateMouse();
	SCR_BeginLoadingPlaque();
	cls.mapstring[0] = 0;
	for (i=0 ; i<Cmd_Argc() ; i++)
	{
		strcat (cls.mapstring, Cmd_Argv(i));
		strcat (cls.mapstring, " ");
	}
	strcat (cls.mapstring, "\n");
	svs.serverflags = 0;			
	strcpy(name, Cmd_Argv(1));
	SV_SpawnServer (name);
	if (!sv.active)
		return;
	if (cls.state != ca_dedicated)
	{
		strcpy(cls.spawnparms, "");
		for (i=2 ; i<Cmd_Argc() ; i++)
		{
			strcat (cls.spawnparms, Cmd_Argv(i));
			strcat (cls.spawnparms, " ");
		}
		Cmd_ExecuteString ("connect local", src_command);
	}
}
void Host_Map_f ( void ) { int i ; char name [ MAX_QPATH ] ; if ( cmd_source != src_command ) return ; cls . demonum = -1 ; CL_Disconnect ( ) ; Host_ShutdownServer ( false ) ; key_dest = key_game ; Input_ActivateMouse ( ) ; SCR_BeginLoadingPlaque ( ) ; cls . mapstring [ 0 ] = 0 ; for ( i = 0 ; i < Cmd_Argc ( ) ; i ++ ) { strcat ( cls . mapstring , Cmd_Argv ( i ) ) ; strcat ( cls . mapstring , " " ) ; } strcat ( cls . mapstring , " \n " ) ; svs . serverflags = 0 ; strcpy ( name , Cmd_Argv ( 1 ) ) ; SV_SpawnServer ( name ) ; if ( ! sv . active ) return ; if ( cls . state != ca_dedicated ) { strcpy ( cls . spawnparms , " " ) ; for ( i = 2 ; i < Cmd_Argc ( ) ; i ++ ) { strcat ( cls . spawnparms , Cmd_Argv ( i ) ) ; strcat ( cls . spawnparms , " " ) ; } Cmd_ExecuteString ( " " , src_command ) ; } }
handle a
map <servername>
command from the console.
handle a map <servername > command from the console .
// stop demo loop in case this fails // remove console or menu // haven't completed an episode yet