Пример #1
0
 private static void MainProgram()
 {
     Console.AddInformationMessage("Testing Interface Ready");
     Console.AddInformationMessage("----");
     SettingsHandler.LoadAll();
     OpenYSServerModeUserInterface.WaitForClose();
 }
Пример #2
0
        private static void MainProgram()
        {
            Console.AddInformationMessage("Starting OpenYS Version: " + DeveloperAttributes.DeveloperInfo.BuildVersion);

            #region Load Settings
            Console.AddInformationMessage("Loading Settings...");
            SettingsHandler.LoadAll();
            Console.AddInformationMessage("Settings Loading Complete.");
            #endregion
            #region Load MetaData
            Console.AddInformationMessage("Loading YSFlight MetaData from \"" + Settings.YSFlight.Directory + "\".");
            Metadata.LoadAll();
            Console.AddInformationMessage("YSFlight Metadata Loading Complete.");
            #endregion
            #region Load World
            Console.AddInformationMessage("Loading World from Field: \"" + Settings.Options.FieldName + "\".");
            World.Load(Settings.Options.FieldName);
            Console.AddInformationMessage("World Loading Complete!");
            #endregion
            #region Start Server
            Console.AddInformationMessage("Starting OpenYS Server...");
            Server.Start();
            Console.AddInformationMessage("OpenYS Server Startup Complete. Now listening for clients on Port " + Settings.Server.ListeningPorts.TCP);
            #endregion

            Console.AddInformationMessage("--------");

            OpenYSServerModeUserInterface.WaitForClose();
            OpenYSPacketInspectorUserInterface.CloseWindow();

            Server.Stop();
        }
Пример #3
0
        private static void MainProgram()
        {
            #region Debug Tests
            //Debug.AddCrashMessage(new Exception("CRASH TEST"), "CRASH TEST");
            //Debug.AddErrorMessage(new Exception("ERROR TEST"), "ERROR TEST");
            //Debug.AddWarningMessage("WARNING TEST");
            //Debug.AddDetailMessage("DETAIL TEST");
            //Debug.AddSummaryMessage("SUMMARY TEST");
            #endregion

            #region Load World
            Console.AddInformationMessage("Loading World");

            Metadata.LoadAll();

            World.Load(Settings.Options.FieldName);

            Console.AddInformationMessage("World Loading Complete!");
            #endregion

            OpenYSServerModeUserInterface.ClearAllMessages();

            #region Start Server
            Console.AddInformationMessage("Starting Proxy Server...");
            Server.Start(IsProxyMode: true);
            Console.AddInformationMessage("Now Listening on Port 7915!");
            Console.AddInformationMessage("Clients will be sent to:" + SettingsLibrary.Settings.Server.ProxyServer.DestinationAddress.ToString() + ":" + SettingsLibrary.Settings.Server.ProxyServer.DestinationPort + "!");
            #endregion

            Console.AddInformationMessage("");

            OpenYSServerModeUserInterface.WaitForClose();
            OpenYSPacketInspectorUserInterface.CloseWindow();

            Server.Stop();
        }