Exemplo n.º 1
0
        public void GetOutfits(VM vm, VMGLOutfitOwner owner, uint ownerPID, VMAsyncGetOutfitsCallback callback)
        {
            Host.InBackground(() =>
            {
                using (var db = DAFactory.Get)
                {
                    var outfits = owner == VMGLOutfitOwner.OBJECT ? db.Outfits.GetByObjectId(ownerPID) : db.Outfits.GetByAvatarId(ownerPID);
                    callback(
                        outfits.Select(x =>
                    {
                        var outfit = new VMGLOutfit()
                        {
                            asset_id       = x.asset_id,
                            outfit_id      = x.outfit_id,
                            sale_price     = x.sale_price,
                            purchase_price = x.purchase_price,
                            outfit_type    = x.outfit_type,
                            outfit_source  = x.outfit_source == Database.DA.Outfits.DbOutfitSource.cas ? VMGLOutfitSource.cas : VMGLOutfitSource.rack
                        };

                        if (x.avatar_owner != null && x.avatar_owner.HasValue)
                        {
                            outfit.owner_type = VMGLOutfitOwner.AVATAR;
                            outfit.owner_id   = x.avatar_owner.Value;
                        }
                        else if (x.object_owner != null && x.object_owner.HasValue)
                        {
                            outfit.owner_type = VMGLOutfitOwner.OBJECT;
                            outfit.owner_id   = x.object_owner.Value;
                        }

                        return(outfit);
                    }).ToArray()
                        );
                }
            });
        }
Exemplo n.º 2
0
 public void GetOutfits(VM vm, VMGLOutfitOwner owner, uint ownerPID, VMAsyncGetOutfitsCallback callback)
 {
     callback(new VMGLOutfit[0]);
 }