Пример #1
0
        public override void Run()
        {
            if (!(this.Owner is IObjectDetailController))
            {
                return;
            }
            IObjectDetailController detailPresenter = (IObjectDetailController)this.Owner;

            if (!detailPresenter.SaveAndClose())
            {
                return;
            }


            //notify listview focus added row
            ObjectAddedMessage msg = new ObjectAddedMessage();

            msg.ObjectID   = detailPresenter.ObjectId;
            msg.ObjectName = detailPresenter.ObjectName;
            EventAggregationManager.SendMessage <ObjectAddedMessage>(msg);

            //notify related Module to Refresh.
            NotifyRelatedMessage relatedMsg = new NotifyRelatedMessage();

            relatedMsg.ObjectName = detailPresenter.ObjectName;
            EventAggregationManager.SendMessage <NotifyRelatedMessage>(relatedMsg);
        }
Пример #2
0
        public static void ObjectAddedMessageTreatment(Message message, byte[] packetDatas, AccountUC account)
        {
            ObjectAddedMessage msg = (ObjectAddedMessage)message;

            using (BigEndianReader reader = new BigEndianReader(packetDatas))
            {
                msg.Deserialize(reader);
            }
            ObjectItem item = msg.Object;

            Core.Inventory.Item i = new Core.Inventory.Item(item.Effects, item.ObjectGID, item.Position, (int)item.Quantity, (int)item.ObjectUID, account);
            account.Inventory.Items.Add(i);
            string[] row1 = { i.GID.ToString(), i.UID.ToString(), i.Name, i.Quantity.ToString(), i.Type.ToString(), i.Price.ToString() };
            System.Windows.Forms.ListViewItem li = new System.Windows.Forms.ListViewItem(row1);
            li.ToolTipText = i.Description;
            account.AddItem(li, account.LVItems);
            if (i.Type == "Sac de ressource")
            {
                foreach (JobUC uc in account.JobsUC)
                {
                    if (uc.OpenBagCb.Checked)
                    {
                        account.Inventory.UseItem(i.UID);
                        account.Log(new ActionTextInformation("Ouverture automatique d'un sac de récolte : " + i.Name), 2);
                    }
                }
            }
            if (account.Running != null)
            {
                foreach (Pet pet in account.petsList)
                {
                    pet.SetFood();
                }
            }
        }
Пример #3
0
 private void HandleObjectAddedMessage(IAccount account, ObjectAddedMessage message)
 {
     account.Character.Inventory.Objects.Add(message.Object);
     if (Enum.IsDefined(typeof(CharacterInventoryPositionEnum), (int)message.Object.Position))
     {
         UpdateEquipment();
     }
 }
Пример #4
0
 public void Update(ObjectAddedMessage msg)
 {
     if (msg == null)
     {
         throw new ArgumentNullException("msg");
     }
     AddItem(new Item(msg.@object));
 }
Пример #5
0
 private void ObjectAddedMessageHandler(DofusClient client, ObjectAddedMessage message)
 {
     client.Account.Character.Inventory.Add(message.Object);
 }
Пример #6
0
 public static Task HandleObjectAddedMessage(Account account, ObjectAddedMessage message)
 => Task.Run(() => account.Game.Character.Inventory.Update(message));
Пример #7
0
 private void HandleObjectAddedMessage(IAccount account, ObjectAddedMessage message)
 {
     account.Character.Inventory.Objects.Add(message.Object);
 }
Пример #8
0
 public static void HandleObjectAddedMessage(Bot bot, ObjectAddedMessage message)
 {
     bot.Character.Inventory.Update(message);
 }