public virtual void Combine(IMsgFactory factory) { if (groupId != factory.groupId) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "groupId不同,不能合并"); return; } MsgFactory_Auto fsrc = factory as MsgFactory_Auto; if (fsrc == null) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "MsgFactory类型非法,合并失败"); return; } ToolsNet.CombineDict <CMD_Command, MsgItem>(_dictItem, fsrc._dictItem, false); }
public virtual void Combine(IMsgFactory fact) { if (fact.groupId != groupId) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "groupId不同,不能合并"); return; } MsgFactory_Manual factory = fact as MsgFactory_Manual; if (factory == null) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "MsgFactory类型非法,合并失败"); return; } ToolsNet.CombineDict <CMD_Command, CreateInstance_req>(_dictCreateReq, factory._dictCreateReq, false); ToolsNet.CombineDict <CMD_Command, CreateInstance_respNtf>(_dictCreateRespNtf, factory._dictCreateRespNtf, false); }
public virtual void UnCombine(IMsgFactory factory) { if (groupId != factory.groupId) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "groupId不同,不需要取消合并"); return; } MsgFactory_Auto fsrc = factory as MsgFactory_Auto; if (fsrc == null) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "MsgFactory类型非法,取消合并失败"); return; } foreach (var keyItem in fsrc._dictItem.Keys) { this._dictItem.Remove(keyItem); } }
public virtual void UnCombine(IMsgFactory fact) { if (fact.groupId != groupId) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "groupId不同,不能取消合并"); return; } MsgFactory_Manual factory = fact as MsgFactory_Manual; if (factory == null) { Debug.LogWarning("<color=orange>[Warning]</color>---" + "MsgFactory类型非法,取消合并失败"); return; } foreach (var keyItem in factory._dictCreateReq.Keys) { this._dictCreateReq.Remove(keyItem); } foreach (var keyItem in factory._dictCreateRespNtf.Keys) { this._dictCreateRespNtf.Remove(keyItem); } }
public KKBaseListener(MessageQueueHandler queue, IMsgFactory factory) { _queue = queue; _factory = factory; }
/// <summary> /// 反初始化 /// 建议在连接断开之后进行调用 /// </summary> public virtual void UnInit(IMsgFactory mainFactory) { mainFactory.UnCombine(factory); UnRegisterNetMsg(); }
/// <summary> /// 初始化,请在建立连接之前进行调用以注册网络消息结构 /// </summary> public virtual void Init(IMsgFactory mainFactory) { RegisterNetMsg(); mainFactory.Combine(factory); }