コード例 #1
0
ファイル: ServerLogicProtocol.cs プロジェクト: Jimlan/DogSE
        /// <summary>
        /// 注册所有模块的网络消息到包管理器里
        /// </summary>
        /// <param name="modules"></param>
        /// <param name="handlers"></param>
        public static void Register(ILogicModule[] modules, PacketHandlersBase handlers)
        {
            foreach (var m in modules)
            {
                if (m is TradeAge.Server.Interface.ServerLogic.ILogin)
                {
                    IProtoclAutoCode pac = new ILoginAccess1();
                    list.Add(pac);

                    pac.SetModule(m as TradeAge.Server.Interface.ServerLogic.ILogin);
                    pac.PacketHandlerManager = handlers;
                    pac.Init();
                }
            }
        }
コード例 #2
0
        /// <summary>
        /// 注册所有模块的网络消息到包管理器里
        /// </summary>
        /// <param name="modules"></param>
        /// <param name="handlers"></param>
        public static void Register(ILogicModule[] modules, PacketHandlersBase handlers)
        {
            foreach (var m in modules)
            {
                if (m is TradeAge.Server.Interface.ServerLogic.ILogin)
                {
                    IProtoclAutoCode pac = new ILoginAccess1();
                    list.Add(pac);

                    pac.SetModule(m as TradeAge.Server.Interface.ServerLogic.ILogin);
                    pac.PacketHandlerManager = handlers;
                    pac.Init();
                }
                if (m is TradeAge.Server.Interface.ServerLogic.IScene)
                {
                    IProtoclAutoCode pac = new ISceneAccess2();
                    list.Add(pac);

                    pac.SetModule(m as TradeAge.Server.Interface.ServerLogic.IScene);
                    pac.PacketHandlerManager = handlers;
                    pac.Init();
                }
            }
        }