public static void SelectedServerDataExtendedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     SelectedServerDataExtendedMessage msg = (SelectedServerDataExtendedMessage)message;
     using (BigEndianReader reader = new BigEndianReader(packetDatas))
     {
         msg.Deserialize(reader);
     }
     //account.Log(new BotTextInformation(selectedServerDataExtendedMessage.address + " " + (int)selectedServerDataExtendedMessage.port));
     account.Ticket = msg.ticket;
     account.HumanCheck = new HumanCheck(account);
     account.SocketManager.IsChangingServer = true;
     if (!account.IsMITM)
     {
         account.Log(new ConnectionTextInformation("Connexion au serveur " + BlueSheep.Common.Data.I18N.GetText((int)GameData.GetDataObject(D2oFileEnum.Servers, msg.serverId).Fields["nameId"])), 0);
         account.SocketManager.Connect(new ConnectionInformations(msg.address, (int)msg.port, "de jeu"));
         account.loginstate = "de jeu";
     }
     else
     {
         SelectedServerDataExtendedMessage nmsg = new SelectedServerDataExtendedMessage(
         msg.ssl, msg.canCreateNewCharacter, msg.serverId, "127.0.0.1", msg.port, msg.ticket, msg.serverIds);
         using (BigEndianWriter writer = new BigEndianWriter())
         {
             nmsg.Serialize(writer);
             MessagePackaging pack = new MessagePackaging(writer);
             pack.Pack((int)nmsg.ProtocolID);
             account.SocketManager.SendToDofusClient(pack.Writer.Content);
             //account.SocketManager.DisconnectFromDofusClient();
             account.SocketManager.DisconnectServer("42 packet handling.");
             account.SocketManager.ListenDofus();
             account.Wait(100, 200);
         }
         account.Log(new ConnectionTextInformation("Connexion au serveur " + BlueSheep.Common.Data.I18N.GetText((int)GameData.GetDataObject(D2oFileEnum.Servers, msg.serverId).Fields["nameId"])), 0);
         account.SocketManager.Connect(new ConnectionInformations(msg.address, (int)msg.port, "de jeu"));
         account.loginstate = "de jeu";
     }
 }
Exemple #2
0
        public static void PopupWarningMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            PopupWarningMessage msg = (PopupWarningMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.Log(new ErrorTextInformation("[FROM " + msg.author + " ] : " + msg.content),0);
            account.Log(new BotTextInformation("You has been locked for " + msg.lockDuration + ". Stopping BlueSheep actions while blocked..."),0);
            account.Log(new ErrorTextInformation("Y a un popup sur l'écran, surement un modo :s"), 0);
             account.Wait(msg.lockDuration, msg.lockDuration);
            //account.SocketManager.Disconnect("Alerte au modo ! Alerte au modo !");
        }
        public static void PartyMemberInFightMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            PartyMemberInFightMessage msg = (PartyMemberInFightMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (msg.fightMap.mapId == account.Map.Id && msg.memberName == account.MyGroup.GetMaster().CharacterBaseInformations.name)
            {
                account.Wait(500, 1500);
                using (BigEndianWriter writer = new BigEndianWriter())
                {
                    GameFightJoinRequestMessage msg2 = new GameFightJoinRequestMessage(msg.memberId, msg.fightId);
                    account.SocketManager.Send(msg2);
                }
            }
        }
Exemple #4
0
        public static void ExchangeStartedWithPodsMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            ExchangeStartedWithPodsMessage msg = (ExchangeStartedWithPodsMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.GestItemsUC.ListenerBox.Checked)
                return;
            List<int> items = account.GestItemsUC.GetItemsToTransfer();
            account.Inventory.TransferItems(items);
            account.Wait(2000, 3000);
            account.Inventory.ExchangeReady();
        }