Exemplo n.º 1
0
        public static void Init()
        {
            if (Initialized)
            {
                return;
            }

            ReqOplParent = PacketHandlers.GetExtendedHandler(0x10);
            PacketHandlers.RegisterExtended(ReqOplParent.PacketID, ReqOplParent.Ingame, OnQueryProperties);

            ReqBatchOplParent = PacketHandlers.GetHandler(0xD6);

            PacketHandlers.Register(
                ReqBatchOplParent.PacketID,
                ReqBatchOplParent.Length,
                ReqBatchOplParent.Ingame,
                OnBatchQueryProperties);

            PacketHandlers.Register6017(
                ReqBatchOplParent.PacketID,
                ReqBatchOplParent.Length,
                ReqBatchOplParent.Ingame,
                OnBatchQueryProperties);

            OutParent0xD6 = OutgoingPacketOverrides.GetHandler(0xD6);
            OutgoingPacketOverrides.Register(0xD6, OnEncode0xD6);

            Initialized = true;
        }
Exemplo n.º 2
0
        public static void Init()
        {
            if (Initialized)
            {
                return;
            }

            ReqOplParent = PacketHandlers.GetExtendedHandler(0x10);
            PacketHandlers.RegisterExtended(ReqOplParent.PacketID, ReqOplParent.Ingame, OnQueryProperties);

            ReqBatchOplParent = PacketHandlers.GetHandler(0xD6);

            bool is6017 = (PacketHandlers.Get6017Handler(0xD6) != null);

            PacketHandlers.Register(
                ReqBatchOplParent.PacketID, ReqBatchOplParent.Length, ReqBatchOplParent.Ingame, OnBatchQueryProperties);

            if (is6017)
            {
                PacketHandlers.Register6017(
                    ReqBatchOplParent.PacketID, ReqBatchOplParent.Length, ReqBatchOplParent.Ingame, OnBatchQueryProperties);
            }

            OutParent0xD6 = OutgoingPacketOverrides.GetHandler(0xD6);
            OutgoingPacketOverrides.Register(0xD6, true, OnEncode0xD6);

            Initialized = true;

            PollTimer.FromSeconds(10.0, FreeCache);
        }