示例#1
0
        private static void StartupServers()
        {
            _bnetServer = new MooNetServer();
            _gameServer = new GameServer();

            var bnetServerThread = new Thread(_bnetServer.Run) { IsBackground = true };
            bnetServerThread.Start();

            var gameServerThread = new Thread(_gameServer.Run) { IsBackground = true };
            gameServerThread.Start();

            // Read user input indefinitely
            // TODO: Replace with proper command parsing and execution
            /*
            while (true)
            {
                var line = Console.ReadLine();
                if (!string.Equals("quit", line, StringComparison.OrdinalIgnoreCase)
                 && !string.Equals("exit", line, StringComparison.OrdinalIgnoreCase))
                {
                    continue;
                }

                Logger.Info("Shutting down servers...");
                _bnetServer.Shutdown();
                _gameServer.Shutdown();
                break;
            }
            */
        }
示例#2
0
文件: Program.cs 项目: Jonsevc/mooege
        private static void StartupServers()
        {
            MooNetServer = new MooNetServer();
            MooNetServerThread = new Thread(MooNetServer.Run) {IsBackground = true};
            MooNetServerThread.Start();

            GameServer = new GameServer();
            GameServerThread = new Thread(GameServer.Run) { IsBackground = true };
            GameServerThread.Start();

            while (true)
            {
                var line = Console.ReadLine();
                CommandManager.Parse(line);                
            }
        }
示例#3
0
文件: Form1.cs 项目: God601/mooege
        public static void StartupServers()
        {
            Form1 pvpgn = new Form1();
            _bnetServer = new MooNetServer();
            _gameServer = new GameServer();

            var bnetServerThread = new Thread(_bnetServer.Run) { IsBackground = true };
            bnetServerThread.Start();
            pvpgn.richTextBox1.Text += "[D3GS] Bnet Server Loaded Successfuly! \n\f";
            //pvpgn.progressBar1.Value = 25;

            var gameServerThread = new Thread(_gameServer.Run) { IsBackground = true };
            gameServerThread.Start();
            pvpgn.richTextBox1.Text += "[D3GS] Game Server Loaded Successfuly! \n\f";
            //pvpgn.progressBar1.Value = 50;
        }
示例#4
0
文件: Program.cs 项目: Jonsevc/mooege
        public static void Start(string parameters) // actually server.cs should be providing us start/stop/restart methods /raist.
        {
            var startMooNetServer = false;
            var startGameServer = false;

            if (parameters.ToLower() == "help")
            {
                Console.WriteLine("start [all|mnet|gs]");
                return;
            }

            if (parameters == String.Empty || parameters == "all")
            {
                startMooNetServer = true;
                startGameServer = true;
            }

            if (parameters == "mnet") startMooNetServer = true;
            if (parameters == "gs") startGameServer = true;

            if (startMooNetServer)
            {
                if (MooNetServer == null)
                {
                    MooNetServer = new MooNetServer();
                    MooNetServerThread = new Thread(MooNetServer.Run) { IsBackground = true };
                    MooNetServerThread.Start();
                }
                else Console.WriteLine("MooNet-Server is already running");
            }

            if (startGameServer)
            {
                if (GameServer == null)
                {
                    GameServer = new GameServer();
                    GameServerThread = new Thread(GameServer.Run) { IsBackground = true };
                    GameServerThread.Start();
                }
                else Console.WriteLine("Game-Server is already running");
            }
        }
示例#5
0
文件: Program.cs 项目: Jonsevc/mooege
        public static void Stop(string parameters) // actually server.cs should be providing us start/stop/restart methods /raist.
        {
            var stopMooNetServer = false;
            var stopGameServer = false;

            if (parameters.ToLower() == "help")
            {
                Console.WriteLine("stop [all|moonet|gs]");
                return;
            }

            if(parameters==String.Empty || parameters=="all")
            {
                stopMooNetServer = true;
                stopGameServer = true;
            }

            if (parameters == "mnet") stopMooNetServer = true;
            if (parameters == "gs") stopGameServer = true;

            if (stopMooNetServer)
            {
                if (MooNetServer != null)
                {
                    Logger.Warn("Stopping MooNet-Server..");
                    MooNetServer.Shutdown();
                    MooNetServerThread.Abort();
                    MooNetServer = null;
                }
                else Console.WriteLine("MooNet-Server is already stopped");
            }

            if (stopGameServer)
            {
                if (GameServer != null)
                {
                    Logger.Warn("Stopping Game-Server..");
                    GameServer.Shutdown();
                    GameServerThread.Abort();
                    GameServer = null;
                }
                else Console.WriteLine("Game-Server is already stopped");
            }            
        }
示例#6
0
文件: Program.cs 项目: sergeev/mooege
        public static bool StopGS()
        {
            if (GameServer == null) return false;

            Logger.Warn("Stopping Game-Server..");
            GameServer.Shutdown();
            GameServerThread.Abort();
            GameServer = null;

            return true;
        }
示例#7
0
文件: Program.cs 项目: sergeev/mooege
        public static bool StartGS()
        {
            if (GameServer != null) return false;

            GameServer = new GameServer();
            GameServerThread = new Thread(GameServer.Run) { IsBackground = true, CurrentCulture = CultureInfo.InvariantCulture };
            GameServerThread.Start();

            return true;
        }
示例#8
0
        public static bool StartGS()
        {
            if (GameServer != null) return false;

            GameServer = new GameServer();
            GameServerThread = new Thread(GameServer.Run) {IsBackground = true};
            GameServerThread.Start();
            return true;
        }
示例#9
0
文件: Program.cs 项目: BuloZB/mooege
        public static void Shutdown(string parameters)
        {
            if (MooNetServer == null && GameServer == null) return;

            if (MooNetServer != null)
            {
                Logger.Warn("Shutting down MooNet-Server..");
                MooNetServer.Shutdown();
                MooNetServer = null;
            }

            if (GameServer != null)
            {
                Logger.Warn("Shutting down Game-Server..");
                GameServer.Shutdown();
                GameServer = null;
            }
        }