示例#1
0
        public Packet?HandlePacket(Packet rawPacket)
        {
            var filteredPacket = packetHandler.Filter(rawPacket);

            if (!filteredPacket.HasValue)
            {
                return(null);
            }
            rawPacket = filteredPacket.Value;

            if (rawPacket.Id == PacketDefinitions.MoveRequest.Id)
            {
                packetHandler.Publish <MoveRequest>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.TalkRequest.Id)
            {
                packetHandler.Publish <TalkRequest>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SpeechRequest.Id)
            {
                packetHandler.Publish <SpeechRequest>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.TargetCursor.Id)
            {
                packetHandler.Publish <TargetCursorPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.GumpMenuSelection.Id)
            {
                packetHandler.Publish <GumpMenuSelectionRequest>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.DoubleClick.Id)
            {
                packetHandler.Publish <DoubleClickRequest>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.RequestSkills.Id)
            {
                packetHandler.Publish <SkillRequest>(rawPacket);
            }

            return(rawPacket);
        }
示例#2
0
 public Packet?FilterInput(Packet rawPacket) => packetHandler.Filter(rawPacket);