protected virtual SubscribeDelegate GetCallbackFromData(NetDataReader reader) { ulong hash = reader.GetULong(); if (!_callbacks.TryGetValue(hash, out SubscribeDelegate action)) { Logger.Log.Warn($"Unknown packet hash: {hash}"); throw new Exception("Undefined packet in NetDataReader"); } #if DEBUG if (_callbacksDebugInfo.TryGetValue(hash, out Type packetType)) { if (!packetType.IsDefined(typeof(HidePacketInDebugLogsAttribute), false)) { Logger.Log.Debug($"Packet Received: {packetType.Name}"); } } else { Logger.Log.Warn($"Packet not registered: {hash}"); } #endif return(action); }
protected virtual SubscribeDelegate GetCallbackFromData(NetDataReader reader) { var hash = reader.GetULong(); SubscribeDelegate action; if (!_callbacks.TryGetValue(hash, out action)) { throw new Exception("Undefined packet in NetDataReader"); } return(action); }
public override void Read(T inf, NetDataReader r) { Setter(inf, r.GetULong()); }