public void RegisterFollowPacket(int msgId, OnProtocolNoticeDelegate callback) { if (!_msgNoticeHandler.ContainsKey(msgId)) { _msgNoticeHandler.Add(msgId, null); } _msgNoticeHandler[msgId] += callback; }
public void RemoveFollowPacket(int msgId, [CanBeNull] OnProtocolNoticeDelegate callback) { if (!_msgNoticeHandler.ContainsKey(msgId)) { return; } if (callback == null) { return; } _msgNoticeHandler[msgId] -= callback; if (_msgNoticeHandler[msgId] == null) { _msgNoticeHandler.Remove(msgId); } }