Example #1
0
        //Main function
        private static void Main()
        {
            Console.Title = ("SERVER V." + s_version);
            Console.WriteLine("SERVER   V." + s_version);
            Console.WriteLine("CRYPTO   V." + c_version);
            Console.WriteLine("DATABASE V." + d_version);
            Console.WriteLine();

            //Initialize the logger
            BaseAccessors.BALog = new Logger();
            InitLogger();

            //Initialize the encryption
            BaseAccessors.BAEncryption = new data_management.encryption();

            //Initialize the database
            BaseAccessors.BADatabase = new Database();
            BaseAccessors.BADatabase.Init();
            BaseAccessors.BADatabase.Read();

            //Starts the network manager
            NetMan = new NetworkManager(port);
            NetMan.Initialize();

            while (true)
            {
                System.Threading.Thread.Sleep(600000);
            }
        }
Example #2
0
        private static void LoadServerBackground(Object param)
        {
            Migrations.MigrationRunner.MigrateDatabase();

            System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(LoadDatasBackground));
            t.Name = "Data Load Thread";
            t.Start();

            resetEvent.WaitOne();

            ServerConsole.WriteLine("Initializing TCP...");

            NetworkManager.Initialize();
            NetworkManager.TcpListener.Listen(System.Net.IPAddress.Any, Settings.GamePort);

            ServerConsole.WriteLine("Server loaded!");

            if (LoadComplete != null)
            {
                LoadComplete(null, EventArgs.Empty);
            }
        }
Example #3
0
        private static void LoadServerBackground(Object param)
        {
            Forms.LoadingUI         loading = param as Forms.LoadingUI;
            System.Threading.Thread t       = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(LoadDatasBackground));
            t.Name = "Data Load Thread";
            t.Start(loading);

            resetEvent.WaitOne();

            Globals.MainUI = new Forms.MainUI();

            loading.UpdateStatus("Initializing TCP...");

            NetworkManager.Initialize();
            NetworkManager.TcpListener.Listen(System.Net.IPAddress.Any, Settings.GamePort);

            loading.Close(true);

            if (LoadComplete != null)
            {
                LoadComplete(null, EventArgs.Empty);
            }
        }