static void Main(string[] args) { using (var gameCtx = ContextBase.GetInstance <GameContext>()) using (var gameWPDListener = new WPDGameListener()) using (var ISC = new ISCServer()) using (var gameServer = new PhotonGameServer()) using (DatabaseService.GetContext()) using (var loginServerClient = new ISCClient()) { gameCtx.AddService(gameServer); gameCtx.AddService(loginServerClient); gameWPDListener.StartListening(); ISC.Start(); gameServer.Start(); gameCtx.SetStatus("Connecting to ISC..."); loginServerClient.Connect(); gameCtx.SetStatus("Listening"); while (true) { string inp = Console.ReadLine(); if (inp.Equals("exit")) { break; } } loginServerClient.Disconnect(); gameServer.Stop(); ISC.Stop(); gameWPDListener.StopListening(); } }
/// <inheritdoc /> protected override void Initialize() { this._logger.LogInformation("Connection to ISC server on {0}:{1}...", this._worldConfiguration.ISC.Host, this._worldConfiguration.ISC.Port); InterClient = new ISCClient(this._worldConfiguration); InterClient.Connect(); //TODO: Implement this log inside OnStarted method when will be available. this._logger.LogInformation("'{0}' world server is started and listen on {1}:{2}.", InterClient.WorldConfiguration.Name, this.Configuration.Host, this.Configuration.Port); }