public GameEngineManager(string snapshotJson, string templateJson, int targetUpdatesPerSecond) { // allocate the engine // TODO: examine the maybe, make sure the game actually loaded _gameEngine = GameEngineFactory.CreateEngine(snapshotJson, templateJson).Value; // create the event monitors CreateEventMonitors(_gameEngine.EventNotifier); _networkContext = NetworkContext.CreateServer(new Player("test-player"), ""); _turnGame = new AutomaticTurnGame(_networkContext, targetUpdatesPerSecond); }
/// <summary> /// Host a new lobby. /// </summary> /// <param name="player">The player that is creating the server.</param> /// <param name="settings">The settings to use for the lobby.</param> /// <returns>A lobby host if successful.</returns> public static LobbyHost CreateLobby(Player player, LobbySettings settings) { NetworkContext context = NetworkContext.CreateServer(player, settings.Password); return(new LobbyHost(context, settings.MapManager, settings.SerializedMap)); }