Esempio n. 1
0
        public static void JobExperienceMultiUpdateMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            JobExperienceMultiUpdateMessage msg = (JobExperienceMultiUpdateMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            foreach (JobExperience i in msg.experiencesUpdate)
            {
                foreach (Core.Job.Job j in account.Jobs)
                {
                    if (i.jobId == j.Id)
                    {
                        j.Level            = i.jobLevel;
                        j.XP               = (int)i.jobXP;
                        j.XpLevelFloor     = (int)i.jobXpLevelFloor;
                        j.XpNextLevelFloor = (int)i.jobXpNextLevelFloor;
                        break;
                    }
                }
            }
            account.ActualizeJobs();
            foreach (JobUC j in account.JobsUC)
            {
                j.populateTreeview();
            }
        }
        private void JobExperienceMultiUpdateMessageHandler(DofusClient Client, JobExperienceMultiUpdateMessage Message)
        {
            // See how jobLevel is not good...

            //Message.ExperiencesUpdate.ForEach(Job =>
            //{
            //    Client.Logger.Log(D2OParsing.GetJobName(Job.JobId) + " | Level: " + Job.JobLevel + " | Exp: " + Job.JobXP);
            //});
        }
Esempio n. 3
0
        public async Task Update(JobExperienceMultiUpdateMessage message)
        {
            // Ugly fix
            while (!_jobsInitialized)
            {
                await Task.Delay(50);
            }

            for (int i = 0; i < message.ExperiencesUpdate.Count; i++)
            {
                Jobs.FirstOrDefault(j => j.Id == message.ExperiencesUpdate[i].JobId)?.Update(message.ExperiencesUpdate[i]);
            }

            JobsUpdated?.Invoke();
        }
Esempio n. 4
0
        public static void HandleJobExperienceMultiUpdateMessage(Bot bot, JobExperienceMultiUpdateMessage message)
        {
            foreach (var update in message.experiencesUpdate)
            {
                var job = bot.Character.GetJob(update.jobId);

                if (job == null)
                {
                    logger.Warn("Cannot update job {0} experience because it's not found", update.jobId);
                }
                else
                {
                    job.Update(update);
                }
            }
        }
Esempio n. 5
0
 private void HandleJobExperienceMultiUpdateMessage(IAccount account, JobExperienceMultiUpdateMessage message)
 {
     _account.Character.Jobs = message.ExperiencesUpdate;
 }
Esempio n. 6
0
 public static Task HandleJobExperienceMultiUpdateMessage(Account account, JobExperienceMultiUpdateMessage message)
 => Task.Run(async() => await account.Game.Character.Jobs.Update(message));
Esempio n. 7
0
 private void JobExperienceMultiUpdateMessageHandler(DofusClient client, JobExperienceMultiUpdateMessage message)
 {
     client.Account.Character.Jobs = message.ExperiencesUpdate;
 }