예제 #1
0
 public void HandleGameEntitiesDispositionMessage(Bot bot, GameEntitiesDispositionMessage message)
 {
     if (bot == null || bot.Character == null || bot.Character.Fight == null)
     {
         logger.Error("Fight is not properly initialized.");
         return; // Can't handle the message
     }
     bot.Character.Fight.Update(message);
 }
예제 #2
0
 public static void HandleGameEntitiesDispositionMessage(Bot bot, GameEntitiesDispositionMessage message)
 {
     if (!bot.Character.IsFighting())
     {
         logger.Error("Received GameEntitiesDispositionMessage but character is not in fight !");
     }
     else
     {
         bot.Character.Fight.Update(message);
     }
 }
예제 #3
0
 private void HandleGameEntitiesDispositionMessage(IAccount account, GameEntitiesDispositionMessage message)
 {
     message.Dispositions.ToList().ForEach(d =>
     {
         var fighter = (Fighter)GetFighter(d.ObjectId);
         if (fighter != null)
         {
             fighter.CellId = d.CellId;
         }
     });
     Account.Character.Status = CharacterStatus.Fighting;
 }
예제 #4
0
        private void GameEntitiesDispositionMessageHandler(DofusClient client, GameEntitiesDispositionMessage message)
        {
            var _ListDispositions = message.Dispositions;

            foreach (var player in _ListDispositions)
            {
                if (player.ObjectId == client.Account.Character.Id)
                {
                    client.Logger.Log("Actualisation des joueurs: Vous êtes sur la cellID: " + player.CellId);
                }
            }
        }
 private void HandleMapComplementaryInformationsDataMessage(GameEntitiesDispositionMessage message, ConnectedHost source)
 {
     foreach (IdentifiedEntityDispositionInformations infos in message.dispositions)
     {
         if (infos.id == this.Id)
         {
             CellId = infos.cellId;
             break;
         }
     }
     OnUpdated();
 }
예제 #6
0
        public async Task Update(GameEntitiesDispositionMessage message)
        {
            if (!IsDoingTutorial)
            {
                return;
            }

            if (_currentStepNumber == 6)
            {
                ValidateCurrentStep();
                await Task.Delay(1000);

                _account.Network.SendMessage(new GameFightReadyMessage(true));
            }
        }
예제 #7
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);
        }
예제 #8
0
        public void Update(GameEntitiesDispositionMessage msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("msg");
            }

            foreach (IdentifiedEntityDispositionInformations disposition in msg.dispositions)
            {
                Fighter fighter = GetFighter(disposition.id);

                // seems like the client don't cares
                if (fighter != null)
                {
                    fighter.Update(disposition);
                }
            }
        }
예제 #9
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 =>
                {
                    var fighter = account.Fight.GetFighter(d.id);
                    if (fighter != null)
                    {
                        ((BFighter)fighter).CellId = d.cellId;
                    }
                });
            }
            account.SetStatus(Status.Fighting);
        }
예제 #10
0
        public void Update(GameEntitiesDispositionMessage msg)
        {
            if (msg == null)
            {
                throw new ArgumentNullException("msg");
            }

            foreach (IdentifiedEntityDispositionInformations disposition in msg.dispositions)
            {
                Fighter fighter = GetFighter(disposition.id);

                // seems like the client don't cares
                if (fighter == null)
                {
                    logger.Error(string.Format("(GameEntitiesDispositionMessage) Fight {0} not found", disposition.id));
                }
                else
                {
                    fighter.Update(disposition);
                }
            }
        }
예제 #11
0
        public void Update(GameEntitiesDispositionMessage message)
        {
            foreach (IdentifiedEntityDispositionInformations infos in message.dispositions)
            {
                foreach (FighterModel fighter in Defenders)
                {
                    if (fighter.ContextualId == infos.id)
                    {
                        fighter.CellId = infos.cellId;

                        break;
                    }
                }
                foreach (FighterModel fighter in Challengers)
                {
                    if (fighter.ContextualId == infos.id)
                    {
                        fighter.CellId = infos.cellId;
                        break;
                    }
                }
            }
        }
예제 #12
0
 public static Task HandleGameEntitiesDispositionMessage(Account account, GameEntitiesDispositionMessage message)
 => Task.Run(async() =>
 {
     account.Game.Fight.Update(message);
     await account.Extensions.CharacterCreation.Update(message);
 });
예제 #13
0
 public void Update(GameEntitiesDispositionMessage message)
 {
     message.Dispositions.ForEach(d => GetFighter(d.Id)?.Update(d));
     FightersUpdated?.Invoke();
 }
예제 #14
0
 private void HandleMapComplementaryInformationsDataMessage(GameEntitiesDispositionMessage message, ConnectedHost source)
 {
     fight.Update(message);
 }