public void PersistSkillInTraining()
        {
            ResponseCache.Clear();
            SkillQueue skillqueue = EveApi.GetSkillQueue(56456, 4564356, "asdf");

            ResponseCache.Save("ResponseCache.xml");
            ResponseCache.Clear();
            ResponseCache.Load("ResponseCache.xml");
            SkillQueue cached = EveApi.GetSkillQueue(4563456, 36456, "asdf");

            //Test the Cache Time
            Assert.AreEqual(skillqueue.CachedUntilLocal, cached.CachedUntilLocal);

            //Attributes of the first skill in the queue
            Assert.AreEqual(cached.SkillList[0].QueuePosition, skillqueue.SkillList[0].QueuePosition);
            Assert.AreEqual(cached.SkillList[0].TrainingTypeId, skillqueue.SkillList[0].TrainingTypeId);
            Assert.AreEqual(cached.SkillList[0].TrainingToLevel, skillqueue.SkillList[0].TrainingToLevel);
            Assert.AreEqual(cached.SkillList[0].TrainingStartSP, skillqueue.SkillList[0].TrainingStartSP);
            Assert.AreEqual(cached.SkillList[0].TrainingEndSP, skillqueue.SkillList[0].TrainingEndSP);
            Assert.AreEqual(cached.SkillList[0].TrainingStartTime, skillqueue.SkillList[0].TrainingStartTime);
            Assert.AreEqual(cached.SkillList[0].TrainingEndTime, skillqueue.SkillList[0].TrainingEndTime);
            Assert.AreEqual(cached.SkillList[0].TrainingStartTimeLocal, skillqueue.SkillList[0].TrainingStartTimeLocal);
            Assert.AreEqual(cached.SkillList[0].TrainingEndTimeLocal, skillqueue.SkillList[0].TrainingEndTimeLocal);

            //Attributes of the second skill in the queue
            Assert.AreEqual(cached.SkillList[1].QueuePosition, skillqueue.SkillList[1].QueuePosition);
            Assert.AreEqual(cached.SkillList[1].TrainingTypeId, skillqueue.SkillList[1].TrainingTypeId);
            Assert.AreEqual(cached.SkillList[1].TrainingToLevel, skillqueue.SkillList[1].TrainingToLevel);
            Assert.AreEqual(cached.SkillList[1].TrainingStartSP, skillqueue.SkillList[1].TrainingStartSP);
            Assert.AreEqual(cached.SkillList[1].TrainingEndSP, skillqueue.SkillList[1].TrainingEndSP);
            Assert.AreEqual(cached.SkillList[1].TrainingStartTime, skillqueue.SkillList[1].TrainingStartTime);
            Assert.AreEqual(cached.SkillList[1].TrainingEndTime, skillqueue.SkillList[1].TrainingEndTime);
            Assert.AreEqual(cached.SkillList[1].TrainingStartTimeLocal, skillqueue.SkillList[1].TrainingStartTimeLocal);
            Assert.AreEqual(cached.SkillList[1].TrainingEndTimeLocal, skillqueue.SkillList[1].TrainingEndTimeLocal);
        }
        public void GetSkillInTraining()
        {
            ResponseCache.Clear();
            SkillQueue skillqueue = EveApi.GetSkillQueue(456456, 456436, "asdf");

            SkillQueue.Skill skill0 = skillqueue.SkillList[0];
            SkillQueue.Skill skill1 = skillqueue.SkillList[1];

            //Attributes of the first skill in the queue
            Assert.AreEqual(1, skill0.QueuePosition);
            Assert.AreEqual(11441, skill0.TrainingTypeId);
            Assert.AreEqual(3, skill0.TrainingToLevel);
            Assert.AreEqual(7072, skill0.TrainingStartSP);
            Assert.AreEqual(40000, skill0.TrainingEndSP);
            Assert.AreEqual(new DateTime(2009, 03, 18, 02, 01, 06), skill0.TrainingStartTime);
            Assert.AreEqual(new DateTime(2009, 03, 18, 15, 19, 21), skill0.TrainingEndTime);
            Assert.AreEqual(new DateTime(2009, 03, 17, 21, 01, 06), skill0.TrainingStartTimeLocal);
            Assert.AreEqual(new DateTime(2009, 03, 18, 10, 19, 21), skill0.TrainingEndTimeLocal);

            //Attributes of the second skill in the queue
            Assert.AreEqual(2, skill1.QueuePosition);
            Assert.AreEqual(20533, skill1.TrainingTypeId);
            Assert.AreEqual(4, skill1.TrainingToLevel);
            Assert.AreEqual(112000, skill1.TrainingStartSP);
            Assert.AreEqual(633542, skill1.TrainingEndSP);
            Assert.AreEqual(new DateTime(2009, 03, 18, 15, 19, 21), skill1.TrainingStartTime);
            Assert.AreEqual(new DateTime(2009, 03, 30, 03, 16, 14), skill1.TrainingEndTime);
            Assert.AreEqual(new DateTime(2009, 03, 18, 10, 19, 21), skill1.TrainingStartTimeLocal);
            Assert.AreEqual(new DateTime(2009, 03, 29, 22, 16, 14), skill1.TrainingEndTimeLocal);
        }
Exemple #3
0
        public override void action(IrcConnection connection, string channel)
        {
            IList <Character> characters = IrcBot.mySession.CreateCriteria <Character>().List <Character>();

            foreach (Character character in characters)
            {
                //Get their skillQueue, and determine if time remaining is less than 24 hours.
                SkillQueue skillQueue = null;
                try
                {
                    skillQueue = EveApi.GetSkillQueue(character.api.apiUserId, character.apiCharacterId, character.api.apiKeyId);
                }
                catch (FormatException)
                {
                    continue;
                }
                catch (Exception)
                {
                    continue;
                }
                if (skillQueue == null)
                {
                    continue;
                }
                DateTime tomorrow = DateTime.Now + new TimeSpan(24, 0, 0);//24 hours

                if (skillQueue.SkillList.Length > 0)
                {
                    if (skillQueue.SkillList.Last().TrainingEndTimeLocal < tomorrow) // If the skill finishes before tomorrow.
                    {
                        connection.privmsg(channel, "Character " + character.characterName + " has less than 24 hours remaining in his skill queue");
                    }
                }
            }
        }
Exemple #4
0
        public static void SkillQueueExample()
        {
            SkillQueue skillQueue = EveApi.GetSkillQueue(1234, 1234, "apiKey");

            foreach (SkillQueue.Skill skill in skillQueue.SkillList)
            {
                Console.WriteLine("Queue Position: {0}", skill.QueuePosition);
                Console.WriteLine("Skill ID: {0}", skill.TrainingTypeId);
                Console.WriteLine("Skill Level: {0}", skill.TrainingToLevel);
                Console.WriteLine("Start SP: {0}", skill.TrainingStartSP);
                Console.WriteLine("End SP: {0}", skill.TrainingEndSP);
                Console.WriteLine("StartTime: {0}", skill.TrainingStartTime);
                Console.WriteLine("EndTime: {0}", skill.TrainingEndTime);
                Console.WriteLine("Start Local: {0}", skill.TrainingStartTimeLocal);
                Console.WriteLine("End Local: {0}", skill.TrainingEndTimeLocal);
                Console.WriteLine("");
            }
        }