GetTotalExperience() публичный статический Метод

public static GetTotalExperience ( List times ) : int>.Tuple
times List
Результат int>.Tuple
Пример #1
0
        public static void SetHuntTime(Hunt h, int clearMinutes)
        {
            var expInformation = GlobalDataManager.GetTotalExperience(TimestampManager.getLatestTimes(clearMinutes));

            h.totalExp  = expInformation.Item1;
            h.totalTime = expInformation.Item2 * 60;
        }
Пример #2
0
        public static ParseMemoryResults ParseLogResults(ReadMemoryResults res)
        {
            if (res == null)
            {
                return(null);
            }
            ParseMemoryResults o = new ParseMemoryResults();

            // first we add the new parsed damage logs to the totalDamageResults
            o.newDamage = GlobalDataManager.UpdateDamageInformation(res.damageDealt);
            // now that we have updated the damage results, fill in the DPS meter, we use damage from the last 15 minutes for this
            List <string> times = TimestampManager.getLatestTimes(15);

            GlobalDataManager.GenerateDamageResults(o.damagePerSecond, times);

            // similar to damage, we keep a totalExperienceResults list
            // first update it with the new information
            int newExperience = GlobalDataManager.UpdateExperience(res.exp);

            // now compute the experience per hour
            // we use the same formula Tibia itself does so we get the same value
            // this formula is basically, take the experience in the last 15 minutes and multiply it by 4
            o.expPerHour = GlobalDataManager.GetTotalExperience(times).Item1;

            // Parse event messages
            foreach (Tuple <Event, string> newEvent in GlobalDataManager.UpdateEventInformation(res.eventMessages))
            {
                o.newEventMessages.Add(newEvent);
            }

            // Update the look information
            foreach (string newLook in GlobalDataManager.UpdateLookInformation(res.lookMessages))
            {
                o.newLooks.Add(newLook);
            }

            // Update death information
            o.death = GlobalDataManager.UpdateDeaths(res.deaths);

            // now parse any new commands given by users
            foreach (string newCommand in GlobalDataManager.UpdateCommands(res.commands))
            {
                o.newCommands.Add(newCommand);
            }

            // check new urls
            GlobalDataManager.UpdateURLs(res.urls);


            Parser.ParseLootMessages(HuntManager.activeHunt, res.itemDrops, o.newItems, true, true);
            HuntManager.activeHunt.totalExp += newExperience;

            readWatch.Stop();
            if (newExperience == 0)
            {
                if (ticksSinceExperience < 120)
                {
                    ticksSinceExperience += readWatch.Elapsed.TotalSeconds;
                }
            }
            else
            {
                ticksSinceExperience = 0;
            }
            if (ticksSinceExperience < 120)
            {
                HuntManager.activeHunt.totalTime += readWatch.Elapsed.TotalSeconds;
            }
            readWatch.Restart();
            HuntManager.SaveHunts();
            return(o);
        }