예제 #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 LinkObjects()
 {
     #region Link Objects Together
     #region LINK FACTORY FIRST!
     MasterObjectFactory.LinkMasterFactory();
     #endregion
     #region Link Interacting Components
     Connection.SetPacketProcessor(PacketProcessor.Server.Process);
     #endregion
     #region LINK UI LAST!
     UserInterface.Initialise();
     OpenYSServerModeUserInterface.CreateWindow();
     OpenYSServerModeUserInterface.LinkDebug();
     OpenYSServerModeUserInterface.LinkConsole();
     #endregion
     OpenYSServerModeUserInterface.Show();
     #endregion
 }
예제 #4
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();
        }