public void StartNewGame(string mapName, bool devMap)
{
#if ID_DEDICATED
idConsole.WriteLine("Dedicated servers cannot start singleplayer games." );
#else
if(idE.AsyncNetwork.Server.IsActive == true)
{
idConsole.WriteLine("Server running, use si_map / serverMapRestart");
return;
}
if(idE.AsyncNetwork.Client.IsActive == true)
{
idConsole.WriteLine("Client running, disconnect from server first");
return;
}
// clear the userInfo so the player starts out with the defaults
_mapSpawnData.UserInformation[0].Clear();
_mapSpawnData.PersistentPlayerInformation[0].Clear();
_mapSpawnData.ServerInformation.Clear();
_mapSpawnData.SyncedCvars.Clear();
idE.CvarSystem.CopyCvarsToDictionary(_mapSpawnData.UserInformation[0], CvarFlags.UserInfo);
idE.CvarSystem.CopyCvarsToDictionary(_mapSpawnData.ServerInformation, CvarFlags.ServerInfo);
idE.CvarSystem.CopyCvarsToDictionary(_mapSpawnData.SyncedCvars, CvarFlags.NetworkSync);
_mapSpawnData.ServerInformation.Set("si_gameType", "singleplayer");
// set the devmap key so any play testing items will be given at
// spawn time to set approximately the right weapons and ammo
if(devMap == true)
{
_mapSpawnData.ServerInformation.Set("devmap", "1");
}
MoveToNewMap(mapName);
#endif
}