示例#1
0
        public static void ObtainedItemMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            ObtainedItemMessage msg = (ObtainedItemMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.Gather.resourceName == "Unknown")
            {
                return;
            }
            account.SetStatus(Status.None);
            account.Log(new ActionTextInformation("Ressource récoltée : " + account.Gather.resourceName + " +" + msg.baseQuantity), 3);
            if (account.Gather.Stats.ContainsKey(account.Gather.resourceName))
            {
                account.Gather.Stats[account.Gather.resourceName] += msg.baseQuantity;
            }
            else
            {
                account.Gather.Stats.Add(account.Gather.resourceName, msg.baseQuantity);
            }
            account.Gather.Current_Job.ActualizeStats(account.Gather.Stats);
            if (account.PerformGather() == false && account.Path != null)
            {
                account.Path.PerformActionsStack();
            }
        }
示例#2
0
        public static void ObtainedItemMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            ObtainedItemMessage msg = (ObtainedItemMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            if (account.Gather.Current_El == null)
            {
                return;
            }
            account.Log(new ActionTextInformation("Ressource récoltée : " + account.Gather.resourceName + " +" + msg.BaseQuantity), 3);
            if (account.Gather.Stats.ContainsKey(account.Gather.resourceName))
            {
                account.Gather.Stats[account.Gather.resourceName] += (int)msg.BaseQuantity;
            }
            else
            {
                account.Gather.Stats.Add(account.Gather.resourceName, (int)msg.BaseQuantity);
            }
            account.Gather.Current_Job.ActualizeStats(account.Gather.Stats);
        }