/// <summary>
 /// Starts the web server
 /// </summary>
 public static void StartWebServer()
 {
     if (WebsiteSettings.SettingsStore.EnableWebsite)
     {
         try
         {
             if (!LunaNetUtils.IsTcpPortInUse(WebsiteSettings.SettingsStore.Port))
             {
                 Server.Use(new TcpListenerAdapter(new TcpListener(IPAddress.Any, WebsiteSettings.SettingsStore.Port)));
                 Server.Use(new ExceptionHandler());
                 Server.Use(new CompressionHandler(DeflateCompressor.Default, GZipCompressor.Default));
                 Server.Use(new FileHandler());
                 Server.Use(new HttpRouter().With(string.Empty, new RestHandler <ServerInformation>(new ServerInformationRestController(), JsonResponseProvider.Default)));
                 Server.Start();
             }
             else
             {
                 LunaLog.Error("Could not start web server. Port is already in use.");
                 LunaLog.Info("You can change the web server settings inside 'Config/WebsiteSettings.xml'");
             }
         }
         catch (Exception e)
         {
             LunaLog.Error($"Could not start web server. Details: {e}");
         }
     }
 }
        /// <summary>
        /// Starts the web server
        /// </summary>
        public static void StartWebServer()
        {
            if (WebsiteSettings.SettingsStore.EnableWebsite)
            {
                try
                {
                    if (!LunaNetUtils.IsTcpPortInUse(WebsiteSettings.SettingsStore.Port))
                    {
                        IPAddress listenAddress;
                        if (!string.IsNullOrEmpty(WebsiteSettings.SettingsStore.ListenAddress))
                        {
                            // Custom ListenAddress for web server, parse it
                            if (!IPAddress.TryParse(WebsiteSettings.SettingsStore.ListenAddress, out listenAddress))
                            {
                                // Parsing failed, fall back to IPAddress.Any
                                LunaLog.Warning(
                                    "Could not parse ListenAddress for web server, falling back to 0.0.0.0");
                            }
                        }
                        else
                        {
                            // ListenAddress unset for web server, try the one of the game server
                            IPAddress.TryParse(ConnectionSettings.SettingsStore.ListenAddress, out listenAddress);
                        }

                        listenAddress ??= IPAddress.Any;
                        var listener = new TcpListener(listenAddress, WebsiteSettings.SettingsStore.Port);
                        // Listen on dual-stack for the unspecified address in IPv6 format ([::]).
                        if (listenAddress.Equals(IPAddress.IPv6Any))
                        {
                            listener.Server.DualMode = true;
                        }

                        Server.Use(new TcpListenerAdapter(listener));
                        Server.Use(new ExceptionHandler());
                        Server.Use(new CompressionHandler(DeflateCompressor.Default, GZipCompressor.Default));
                        Server.Use(new FileHandler());
                        Server.Use(new HttpRouter().With(string.Empty, new RestHandler <ServerInformation>(new ServerInformationRestController(), JsonResponseProvider.Default)));
                        Server.Start();
                    }
                    else
                    {
                        LunaLog.Error("Could not start web server. Port is already in use.");
                        LunaLog.Info("You can change the web server settings inside 'Config/WebsiteSettings.xml'");
                    }
                }
                catch (Exception e)
                {
                    LunaLog.Error($"Could not start web server. Details: {e}");
                }
            }
        }