Пример #1
0
        public void UnRegisterOperationErrorMsgHandler(UInt16 appCode, UInt16 funcCode, OperateErrorHandler handler)
        {
            int id = PackageUtils.GetProtocolID(appCode, funcCode);

            if (!oprationErrorHandlerMap.ContainsKey(id))
            {
                Logger.LogError("id not found in handlerDic : " + id.ToString());
                return;
            }
            oprationErrorHandlerMap[id] = (OperateErrorHandler)oprationErrorHandlerMap[id] - handler;
        }
Пример #2
0
        public void RegisterOperationErrorMsgHandler(UInt16 appCode, UInt16 funcCode, OperateErrorHandler handler)
        {
            int id = PackageUtils.GetProtocolID(appCode, funcCode);

            if (handler == null)
            {
                Logger.LogWarning("msg handler is null: " + id);
                return;
            }

            if (!oprationErrorHandlerMap.ContainsKey(id))
            {
                oprationErrorHandlerMap[id] = null;
            }
            oprationErrorHandlerMap[id] = (OperateErrorHandler)oprationErrorHandlerMap[id] + handler;
        }