public static BaseGame StartPVEGame(List <IGamePlayer> player, int mapIndex, eRoomType roomType, eTeamType teamType, eGameType gameType, int timeType) { try { int index = MapMgr.GetMapIndex(mapIndex, (byte)roomType, m_serverId); index = 1072; Map map = MapMgr.CloneMap(index); if (map != null) { PVEGame game = new PVEGame(m_gameId++, player, map, roomType, teamType, gameType, timeType); lock (m_games) { m_games.Add(game); } game.Prepare(); return(game); } else { return(null); } } catch (Exception e) { log.Error("Create game error:", e); return(null); } }
public bool SetMap(int mapId) { if (GameState == eGameState.Playing) { return(false); } Map map = MapMgr.CloneMap(mapId); if (map != null) { m_map = map; return(true); } return(false); }