Esempio n. 1
0
        public void ConsumeInventory(VM vm, uint ownerPID, uint guid, int mode, short num, VMAsyncInventoryConsumeCallback callback)
        {
            Host.InBackground(() =>
            {
                using (var db = DAFactory.Get())
                {
                    switch (mode)
                    {
                    case 0:
                        callback(true, db.Objects.ObjOfTypeInAvatarInventory(ownerPID, guid).Count);
                        return;

                    case 1:
                        if (num == 0)
                        {
                            callback(true, 0);
                        }
                        else
                        {
                            callback(db.Objects.ConsumeObjsOfTypeInAvatarInventory(ownerPID, guid, num), 0);
                            UpdateInventoryFor(vm, ownerPID);
                        }
                        return;
                    }
                }
            });
        }
Esempio n. 2
0
 public void ConsumeInventory(VM vm, uint ownerPID, uint guid, int mode, short num, VMAsyncInventoryConsumeCallback callback)
 {
     //todo: nice stub for this using database?
 }