示例#1
0
        public static void NpcDialogCreationMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            LeaveDialogMessage msg = (LeaveDialogMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.SetStatus(Status.None);
        }
示例#2
0
        public static void GameContextRemoveElementMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            ExchangeStartOkNpcShopMessage msg = (ExchangeStartOkNpcShopMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.SetStatus(Status.Exchanging);
        }
示例#3
0
        public static void LeaveDialogMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            NpcDialogCreationMessage msg = (NpcDialogCreationMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            account.Npc.Id = msg.npcId;
            account.Npc.Entity = account.MapData.Npcs.FirstOrDefault((npc) => npc.contextualId == msg.npcId);
            account.SetStatus(Status.Speaking);
        }
示例#4
0
 public static void HelloConnectMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     account.SetStatus(Status.None);
     if (!account.IsMITM)
     {
         HelloConnectMessage helloConnectMessage = (HelloConnectMessage)message;
         using (BigEndianReader reader = new BigEndianReader(packetDatas))
         {
             helloConnectMessage.Deserialize(reader);
         }
         sbyte[] credentials = RSAKey.Encrypt(helloConnectMessage.key,
         account.AccountName,
         account.AccountPassword,
         helloConnectMessage.salt);
         IdentificationMessage msg = new IdentificationMessage(GameConstants.AutoConnect, GameConstants.UseCertificate, GameConstants.UseLoginToken, new Common.Protocol.Types.VersionExtended(GameConstants.Major, GameConstants.Minor, GameConstants.Release, GameConstants.Revision, GameConstants.Patch, GameConstants.BuildType, GameConstants.Install, GameConstants.Technology), GameConstants.Lang, credentials, GameConstants.ServerID, GameConstants.SessionOptionalSalt, new System.Collections.Generic.List<short>() );
         account.SocketManager.Send(msg);
     }
     account.Log(new ConnectionTextInformation("Identification en cours."), 0);
 }
示例#5
0
 public static void GameFightPlacementPossiblePositionsMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     GameFightPlacementPossiblePositionsMessage msg = (GameFightPlacementPossiblePositionsMessage)message;
     using (BigEndianReader reader = new BigEndianReader(packetDatas))
     {
         msg.Deserialize(reader);
     }
     account.SetStatus(Status.Fighting);
     account.FightData.UpdateTurn(0);
     if (account.Fight != null)
     {
         account.Fight.PlaceCharacter(msg.positionsForChallengers.ToList());
     }
     if (account.WithItemSetBox.Checked == true)
     {
         sbyte id = (sbyte)account.PresetStartUpD.Value;
         InventoryPresetUseMessage msg2 = new InventoryPresetUseMessage((sbyte)(id - 1));
         account.SocketManager.Send(msg2);
         account.Log(new ActionTextInformation("Equipement rapide numero " + Convert.ToString(id)), 5);
     }
     GameFightReadyMessage nmsg = new GameFightReadyMessage(true);
     account.SocketManager.Send(nmsg);
     account.Log(new BotTextInformation("Send Ready !"), 5);
 }
示例#6
0
 public static void GameEntitiesDispositionMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
 {
     GameEntitiesDispositionMessage msg = (GameEntitiesDispositionMessage)message;
     using (BigEndianReader reader = new BigEndianReader(packetDatas))
     {
         msg.Deserialize(reader);
     }
     if (account.Fight != null)
     {
         msg.dispositions.ToList().ForEach(d =>
         {
             account.FightData.UpdateFighterCell(d.id, d.cellId);
         });
     }
     account.SetStatus(Status.Fighting);
 }
示例#7
0
        public static void InteractiveUseEndedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            InteractiveUseEndedMessage msg = (InteractiveUseEndedMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.Gather.Id == -1)
                return;
            account.SetStatus(Status.None);
            account.Gather.Id = -1;
            if (account.Path != null)
                account.Path.PerformFlag();
        }