Example #1
0
        public static void LogHarvesters()
        {
            try
            {
                var sb = new StringBuilder();

                string now        = DateTime.Now.ToString(CultureInfo.InvariantCulture);
                var    harvesters = new List <Mobile>();
                var    amounts    = new List <int>();
                // check for ore gathering
                GetSortedLists(PlayerOreHarvested, harvesters, amounts);
                int count = harvesters.Count;
                for (int i = 0; i < count; i++)
                {
                    sb.Append(now + "\t" + harvesters[i].Name + "\t" + harvesters[i].Account + "\t" + amounts[i] + "\tOre\n");
                }
                //============ same thing for logs
                GetSortedLists(PlayerLogsHarvested, harvesters, amounts);
                count = harvesters.Count;
                for (int i = 0; i < count; i++)
                {
                    sb.Append(now + "\t" + harvesters[i].Name + "\t" + harvesters[i].Account + "\t" + amounts[i] + "\tLogs\n");
                }
                //============ same thing for wool
                GetSortedLists(PlayerWoolHarvested, harvesters, amounts);
                count = harvesters.Count;
                for (int i = 0; i < count; i++)
                {
                    sb.Append(now + "\t" + harvesters[i].Name + "\t" + harvesters[i].Account + "\t" + amounts[i] + "\tWool\n");
                }
                //============ same thing for lockpickers
                GetSortedLists(PlayerLockpicking, harvesters, amounts);
                count = harvesters.Count;
                for (int i = 0; i < count; i++)
                {
                    sb.Append(now + "\t" + harvesters[i].Name + "\t" + harvesters[i].Account + "\t" + amounts[i] + "\tLockpicking\n");
                }
                LoggingCustom.LogHarvester(sb.ToString());
                LastReset = DateTime.UtcNow;
                PlayerLogsHarvested.Clear();
                PlayerOreHarvested.Clear();
            }
            catch (Exception except)
            {
                Console.WriteLine(except.Message);
                Console.WriteLine(except.StackTrace);
            }
        }