示例#1
0
 public void StartWebServer(int port)
 {
     _webServer = new WebServerHost();
     _webServer.FallbackToRandomPort = true;
     _webServer.Port    = port;
     _webServer.Handler = Handler;
     _webServer.Start();
     Console.WriteLine($"Listening on http://localhost:{_webServer.Port}/");
 }
示例#2
0
 public void StartWebServer(int port, bool bindToAny)
 {
     _webServer = new WebServerHost();
     _webServer.FallbackToRandomPort = true;
     _webServer.Port      = port;
     _webServer.Handler   = Handler;
     _webServer.BindToAny = bindToAny;
     _webServer.Start();
     _logger.WriteLine($"Listening on http://{(bindToAny ? "*" : "localhost")}:{_webServer.Port}/");
 }
        public static void Start()
        {
            DatabaseHost.Connect("mongodb://localhost");

            WebServer  = new WebServerHost();
            GameServer = new GameServerHost();

            WebServer.Start();
            GameServer.Start();

            Thread.Sleep(-1);
        }