public void SetModule(ILogicModule m)
 {
     if (m == null)
         throw new ArgumentNullException("ILogicModule");
     module = (TradeAge.Server.Interface.ServerLogic.ILogin)m;
     if (module == null)
     {
         throw new NullReferenceException(string.Format("{0} not TradeAge.Server.Interface.ServerLogic.ILogin", m.GetType().FullName));
     }
 }
Exemple #2
0
        /// <summary>
        /// 将方法注册到消息系统里
        /// </summary>
        /// <param name="module"></param>
        void Register(ILogicModule module)
        {
            var type = module.GetType();

            var createCode = new CreateReadCode(type);
            var proxy = createCode.CreateCodeAndBuilder();
            if (proxy == null)
            {
                Logs.Error("模块 {0} 无法进行消息代理生成。", type.Name);
                return;
            }

            proxy.PacketHandlerManager = packetHandlerManager;
            proxy.SetModule(module);
            proxy.Init();
        }
        /// <summary>
        /// 将方法注册到消息系统里
        /// </summary>
        /// <param name="module"></param>
        void Register(ILogicModule module)
        {
            var type = module.GetType();

            var createCode = new CreateReadCode(type);
            var proxy      = createCode.CreateCodeAndBuilder();

            if (proxy == null)
            {
                Logs.Error("模块 {0} 无法进行消息代理生成。", type.Name);
                return;
            }

            proxy.PacketHandlerManager = packetHandlerManager;
            proxy.SetModule(module);
            proxy.Init();
        }
 public void SetModule(ILogicModule m)
 {
     if (m == null)
     {
         throw new ArgumentNullException("ILogicModule");
     }
     module = (TradeAge.Server.Interface.ServerLogic.ILogin)m;
     if (module == null)
     {
         throw new NullReferenceException(string.Format("{0} not TradeAge.Server.Interface.ServerLogic.ILogin", m.GetType().FullName));
     }
 }