Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public override void Read(T inf, NetDataReader r)
 {
     Setter(inf, r.GetULong());
 }