Example #1
0
        public void AnalysePacket(BlueSheep.Engine.Types.Message msg, byte[] packetdatas)
        {
            using (BigEndianReader reader = new BigEndianReader(packetdatas))
            {
                msg.Deserialize(reader);
            }
            switch ((int)msg.ProtocolID)
            {
                case 226:
                    MapComplementaryInformationsDataMessage packet = (MapComplementaryInformationsDataMessage)msg;
                    //if (this.GoAnalyser((int)packet.SubAreaId))
                    //{
                    foreach (GameRolePlayActorInformations informations in packet.actors)
                    {
                        GameRolePlayCharacterInformations infos;
                        if (!(informations is GameRolePlayCharacterInformations))
                            continue;
                        else
                            infos = (GameRolePlayCharacterInformations)informations;
                        if (this.GoAgro(infos))
                        {
                            Agression(informations.contextualId);
                        }
                        if (this.IsGoingToRun(infos))
                        {
                            if (this.Disconnecting.Checked)
                            {
                                account.SocketManager.DisconnectFromGUI();
                            }
                            else if (this.UsingItem.Checked && (this.UsedItem.Text.Length > 0))
                            {
                                Run();
                            }
                        }
                    }

                    break;
                case 5632:
                    GameRolePlayShowActorMessage npacket = (GameRolePlayShowActorMessage)msg;
                    GameRolePlayCharacterInformations infoCharacter = npacket.informations as GameRolePlayCharacterInformations;
                    if (this.GoAgro(infoCharacter))
                    {
                        Agression(infoCharacter.contextualId);
                    }
                    if (this.IsGoingToRun(infoCharacter))
                    {
                        if (this.Disconnecting.Checked)
                        {
                            account.SocketManager.DisconnectFromGUI();
                        }
                        else if (this.UsingItem.Checked && (this.UsedItem.Text.Length > 0))
                        {
                            Run();
                        }
                    }
                    break;

            }
        }