Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        public Packet?HandlePacket(Packet rawPacket)
        {
            var filteredPacket = FilterInput(rawPacket);

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

            if (rawPacket.Id == PacketDefinitions.AddMultipleItemsInContainer.Id)
            {
                packetHandler.Publish <AddMultipleItemsInContainerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.AddItemToContainer.Id)
            {
                packetHandler.Publish <AddItemToContainerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.DeleteObject.Id)
            {
                packetHandler.Publish <DeleteObjectPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.ObjectInfo.Id)
            {
                packetHandler.Publish <ObjectInfoPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.DrawObject.Id)
            {
                packetHandler.Publish <DrawObjectPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.TargetCursor.Id)
            {
                packetHandler.Publish <TargetCursorPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.CharacterMoveAck.Id)
            {
                packetHandler.Publish <CharacterMoveAckPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.CharMoveRejection.Id)
            {
                packetHandler.Publish <CharMoveRejectionPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.DrawGamePlayer.Id)
            {
                packetHandler.Publish <DrawGamePlayerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SpeechMessage.Id)
            {
                packetHandler.Publish <SpeechMessagePacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SendSpeech.Id)
            {
                packetHandler.Publish <SendSpeechPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.CharacterLocaleAndBody.Id)
            {
                packetHandler.Publish <CharLocaleAndBodyPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.UpdatePlayer.Id)
            {
                packetHandler.Publish <UpdatePlayerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.UpdateCurrentHealth.Id)
            {
                packetHandler.Publish <UpdateCurrentHealthPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.UpdateCurrentMana.Id)
            {
                packetHandler.Publish <UpdateCurrentManaPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.UpdateCurrentStamina.Id)
            {
                packetHandler.Publish <UpdateCurrentStaminaPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SendGumpMenuDialog.Id)
            {
                packetHandler.Publish <SendGumpMenuDialogPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.WornItem.Id)
            {
                packetHandler.Publish <WornItemPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.StatusBarInfo.Id)
            {
                packetHandler.Publish <StatusBarInfoPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SendSkills.Id)
            {
                packetHandler.Publish <SendSkillsPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.RejectMoveItemRequest.Id)
            {
                packetHandler.Publish <RejectMoveItemRequestPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.ClilocMessage.Id)
            {
                packetHandler.Publish <ClilocMessagePacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.ClilocMessageAffix.Id)
            {
                packetHandler.Publish <ClilocMessageAffixPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.AllowRefuseAttack.Id)
            {
                packetHandler.Publish <AllowRefuseAttackPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.DrawContainer.Id)
            {
                packetHandler.Publish <DrawContainerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.PauseClient.Id)
            {
                packetHandler.Publish <PauseClientPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.PersonalLightLevel.Id)
            {
                packetHandler.Publish <PersonalLightLevelPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.OverallLightLevel.Id)
            {
                packetHandler.Publish <OverallLightLevelPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.PlaySoundEffect.Id)
            {
                packetHandler.Publish <PlaySoundEffectPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.QuestArrow.Id)
            {
                packetHandler.Publish <QuestArrowPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.OpenDialogBox.Id)
            {
                packetHandler.Publish <OpenDialogBoxPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.GraphicalEffect.Id)
            {
                packetHandler.Publish <GraphicalEffectPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.SecondAgeObjectInformation.Id)
            {
                packetHandler.Publish <SecondAgeObjectInformationPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.CompressedGump.Id)
            {
                packetHandler.Publish <CompressedGumpPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.MapMessage.Id)
            {
                packetHandler.Publish <MapMessagePacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.ServerListing.Id)
            {
                packetHandler.Publish <ServerListingPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.GameServerList.Id)
            {
                packetHandler.Publish <GameServerListPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.RunUOProtocolExtension.Id)
            {
                packetHandler.Publish <RunUOProtocolExtensionPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.ConnectToGameServer.Id)
            {
                packetHandler.Publish <ConnectToGameServerPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.CharactersStartingLocations.Id)
            {
                packetHandler.Publish <CharactersStartingLocationsPacket>(rawPacket);
            }
            else if (rawPacket.Id == PacketDefinitions.EnableLockedClientFeatures.Id)
            {
                packetHandler.Publish <EnableLockedClientFeaturesPacket>(rawPacket);
            }

            return(rawPacket);
        }