public override void Received(VirtualClient virtualClient)
        {
            UInt16 packetSize = (UInt16)(Size - Marshal.SizeOf <SSyncPositionPacket>());

            if (packetSize > 0)
            {
                virtualClient.DequeueReceivedData(packetSize);
            }
        }
Exemple #2
0
        public override void Received(VirtualClient virtualClient)
        {
            UInt16 packetLength = (UInt16)(Size - Marshal.SizeOf <SQuestInfoPacket>());

            byte[]          packetBytes = virtualClient.DequeueReceivedData(packetLength);
            QuestPacketType type        = QuestPacketType.QUEST_PACKET_TYPE_NONE;

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_IS_BEGIN) > 0)
            {
                if ((QuestPacketType)virtualClient.DequeueReceivedData(1).First() != 0)
                {
                    type = QuestPacketType.QUEST_PACKET_TYPE_BEGIN;
                }
                else
                {
                    type = QuestPacketType.QUEST_PACKET_TYPE_END;
                }
            }
            else
            {
                type = QuestPacketType.QUEST_PACKET_TYPE_UPDATE;
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_TITLE) > 0)
            {
                virtualClient.DequeueReceivedData(31);
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_CLOCK_NAME) > 0)
            {
                virtualClient.DequeueReceivedData(17);
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_CLOCK_VALUE) > 0)
            {
                virtualClient.DequeueReceivedData(4);
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_COUNTER_NAME) > 0)
            {
                virtualClient.DequeueReceivedData(17);
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_COUNTER_VALUE) > 0)
            {
                virtualClient.DequeueReceivedData(4);
            }

            if ((Flag & (byte)QuestAttributes.QUEST_SEND_ICON_FILE) > 0)
            {
                virtualClient.DequeueReceivedData(25);
            }
        }
        public override void Received(VirtualClient virtualClient)
        {
            UInt16 packetSize = (UInt16)(Size - Marshal.SizeOf <SNPCPositionPacket>());

            byte[] packetBytes = virtualClient.DequeueReceivedData(packetSize);

            List <NPCPosition> npcPositions = new List <NPCPosition>(Count);
            int npcPositionSize             = Marshal.SizeOf <NPCPosition>();

            for (int i = 0; i < npcPositionSize * Count; i = i + npcPositionSize)
            {
                byte[] npcPositionBytes = new byte[npcPositionSize];
                Array.Copy(packetBytes, i, npcPositionBytes, 0, npcPositionSize);
                GCHandle    handle      = GCHandle.Alloc(npcPositionBytes, GCHandleType.Pinned);
                NPCPosition npcPosition = (NPCPosition)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(NPCPosition));
                handle.Free();
                npcPositions.Add(npcPosition);
            }
        }
Exemple #4
0
        public override void Received(VirtualClient virtualClient)
        {
            UInt16 packetSize = (UInt16)(Size - Marshal.SizeOf <SLandListPacket>());

            byte[] packetBytes = virtualClient.DequeueReceivedData(packetSize);
        }
Exemple #5
0
        public override void Received(VirtualClient virtualClient)
        {
            UInt16 packetLength = (UInt16)(Size - Marshal.SizeOf <SScriptPacket>());

            byte[] packetBytes = virtualClient.DequeueReceivedData(packetLength);
        }