Ejemplo n.º 1
0
        public void RunServerTest()
        {
            string[]  args     = null;  // TODO: 初始化为适当的值
            BaseWorld world    = null;  // TODO: 初始化为适当的值
            bool      expected = false; // TODO: 初始化为适当的值
            bool      actual;

            actual = OneServer.RunServer(args, world);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        /// <param name="args"></param>
        private static void Main(string[] strArgs)
        {
            //////////////////////////////////////////////////////////////////////////
            // 初始化参数

            InitServerArguments(strArgs);

            //////////////////////////////////////////////////////////////////////////
            // 初始化一些工作

            OneServer.EventConfigServer   += new ConfigServerEventHandler(ProcessServer.ConfigServer);
            OneServer.EventInitOnceServer += new InitOnceServerEventHandler(ProcessServer.InitOnceServer);
            OneServer.EventExitServer     += new ExitServerEventHandler(ProcessServer.ExitServer);

            OneServer.EventCommandLineInfo     += new CommandLineInfoEventHandler(ProcessServer.CommandLineInfo);
            OneServer.EventCommandLineDisposal += new CommandLineDisposalEventHandler(ProcessServer.CommandLineDisposal);

            Program.RealmServerMessagePump.EventNetStateCreate += new EventHandler <NetStateInitEventArgs>(ProcessNet.RealmInitializeNetState);
            Program.RealmServerMessagePump.EventProcessReceive += new EventHandler <NetStateEventArgs>(ProcessNet.RealmProcessReceive);
            Program.RealmServerMessagePump.AddListener(Program.RealmServerListener);

            Program.AuthServerMessagePump.EventNetStateCreate += new EventHandler <NetStateInitEventArgs>(ProcessNet.AuthInitializeNetState);
            Program.AuthServerMessagePump.EventProcessReceive += new EventHandler <NetStateEventArgs>(ProcessNet.AuthProcessReceive);
            Program.AuthServerMessagePump.AddListener(Program.AuthServerListener);

            ProcessServer.WowZoneCluster.World.AddMessagePump(Program.RealmServerMessagePump);
            ProcessServer.WowZoneCluster.World.AddMessagePump(Program.AuthServerMessagePump);

            ProcessServer.WowZoneCluster.World.EventInitOnceWorld += new EventHandler <BaseWorldEventArgs>(ProcessServer.WowZoneCluster.World.InitOnceWorld);
            ProcessServer.WowZoneCluster.World.EventEndSlice      += new EventHandler <BaseWorldEventArgs>(ProcessServer.WowZoneCluster.World.WorldSlice);

            //////////////////////////////////////////////////////////////////////////
            // 开始运行服务

            OneServer.RunServer(strArgs, ProcessServer.WowZoneCluster.World);
        }