private Dictionary <string, object> GenerateUpdateObjectPartInventoryItem(UUID primID, ObjectPartInventoryItem item) { ObjectPartInventoryItem.PermsGranterInfo grantinfo = item.PermsGranter; return(new Dictionary <string, object> { ["AssetId"] = item.AssetID, ["AssetType"] = item.AssetType, ["CreationDate"] = item.CreationDate, ["Creator"] = item.Creator, ["Description"] = item.Description, ["Flags"] = item.Flags, ["Group"] = item.Group, ["GroupOwned"] = item.IsGroupOwned, ["PrimID"] = primID, ["Name"] = item.Name, ["InventoryID"] = item.ID, ["InventoryType"] = item.InventoryType, ["LastOwner"] = item.LastOwner, ["Owner"] = item.Owner, ["BasePermissions"] = item.Permissions.Base, ["CurrentPermissions"] = item.Permissions.Current, ["EveryOnePermissions"] = item.Permissions.EveryOne, ["GroupPermissions"] = item.Permissions.Group, ["NextOwnerPermissions"] = item.Permissions.NextOwner, ["SaleType"] = item.SaleInfo.Type, ["SalePrice"] = item.SaleInfo.Price, ["SalePermMask"] = item.SaleInfo.PermMask, ["PermsGranter"] = grantinfo.PermsGranter.ToString(), ["PermsMask"] = grantinfo.PermsMask, ["DebitPermissionKey"] = grantinfo.DebitPermissionKey, ["NextOwnerAssetID"] = item.NextOwnerAssetID, ["ExperienceID"] = item.ExperienceID, ["CollisionFilterData"] = item.CollisionFilter.DbSerialization }); }
private ObjectPartInventoryItem ObjectPartInventoryItemFromDbReader(NpgsqlDataReader dbReader) { var item = new ObjectPartInventoryItem(dbReader.GetUUID("InventoryID")) { AssetID = dbReader.GetUUID("AssetID"), AssetType = dbReader.GetEnum <AssetType>("AssetType"), CreationDate = dbReader.GetDate("CreationDate"), Creator = dbReader.GetUGUI("Creator"), Description = (string)dbReader["Description"], Flags = dbReader.GetEnum <InventoryFlags>("Flags"), Group = dbReader.GetUGI("Group"), IsGroupOwned = (bool)dbReader["GroupOwned"], InventoryType = dbReader.GetEnum <InventoryType>("InventoryType"), LastOwner = dbReader.GetUGUI("LastOwner"), Name = (string)dbReader["Name"], Owner = dbReader.GetUGUI("Owner"), ParentFolderID = dbReader.GetUUID("PrimID"), NextOwnerAssetID = dbReader.GetUUID("NextOwnerAssetID"), ExperienceID = dbReader.GetUEI("ExperienceID"), CollisionFilter = new ObjectPartInventoryItem.CollisionFilterParam { DbSerialization = dbReader.GetBytes("CollisionFilterData") }, }; item.Permissions.Base = dbReader.GetEnum <InventoryPermissionsMask>("BasePermissions"); item.Permissions.Current = dbReader.GetEnum <InventoryPermissionsMask>("CurrentPermissions"); item.Permissions.EveryOne = dbReader.GetEnum <InventoryPermissionsMask>("EveryOnePermissions"); item.Permissions.Group = dbReader.GetEnum <InventoryPermissionsMask>("GroupPermissions"); item.Permissions.NextOwner = dbReader.GetEnum <InventoryPermissionsMask>("NextOwnerPermissions"); item.SaleInfo.Type = dbReader.GetEnum <InventoryItem.SaleInfoData.SaleType>("SaleType"); item.SaleInfo.Price = (int)dbReader["SalePrice"]; item.SaleInfo.PermMask = dbReader.GetEnum <InventoryPermissionsMask>("SalePermMask"); var grantinfo = new ObjectPartInventoryItem.PermsGranterInfo(); if (((string)dbReader["PermsGranter"]).Length != 0) { try { grantinfo.PermsGranter = dbReader.GetUGUI("PermsGranter"); } catch { /* no action required */ } } grantinfo.PermsMask = dbReader.GetEnum <ScriptPermissions>("PermsMask"); grantinfo.DebitPermissionKey = dbReader.GetUUID("DebitPermissionKey"); item.PermsGranter = grantinfo; return(item); }
private ObjectPartInventoryItem ObjectPartInventoryItemFromMap(Map map) { var item = new ObjectPartInventoryItem(map["InventoryID"].AsUUID) { AssetID = map["AssetID"].AsUUID, AssetType = (AssetType)map["AssetType"].AsInt, CreationDate = (Date)map["CreationDate"], Creator = new UGUI(map["Creator"].ToString()), Description = map["Description"].ToString(), Flags = (InventoryFlags)map["Flags"].AsUInt, Group = new UGI(map["Group"].ToString()), IsGroupOwned = map["GroupOwned"].AsBoolean, InventoryType = (InventoryType)map["InventoryType"].AsInt, LastOwner = new UGUI(map["LastOwner"].ToString()), Name = map["Name"].ToString(), Owner = new UGUI(map["Owner"].ToString()), ParentFolderID = map["ParentFolderID"].AsUUID, ExperienceID = new UEI(map["ExperienceID"].ToString()), CollisionFilter = new ObjectPartInventoryItem.CollisionFilterParam { DbSerialization = (BinaryData)map["CollisionFilterData"] } }; item.Permissions.Base = (InventoryPermissionsMask)map["BasePermissions"].AsUInt; item.Permissions.Current = (InventoryPermissionsMask)map["CurrentPermissions"].AsUInt; item.Permissions.EveryOne = (InventoryPermissionsMask)map["EveryOnePermissions"].AsUInt; item.Permissions.Group = (InventoryPermissionsMask)map["GroupPermissions"].AsUInt; item.Permissions.NextOwner = (InventoryPermissionsMask)map["NextOwnerPermissions"].AsUInt; item.SaleInfo.Type = (InventoryItem.SaleInfoData.SaleType)map["SaleType"].AsUInt; item.SaleInfo.Price = map["SalePrice"].AsInt; item.SaleInfo.PermMask = (InventoryPermissionsMask)map["SalePermMask"].AsInt; item.NextOwnerAssetID = map["NextOwnerAssetID"].AsUUID; var grantinfo = new ObjectPartInventoryItem.PermsGranterInfo(); if ((map["PermsGranter"].ToString()).Length != 0) { try { grantinfo.PermsGranter = new UGUI(map["PermsGranter"].ToString()); } catch { /* no action required */ } } grantinfo.PermsMask = (ScriptPermissions)map["PermsMask"].AsUInt; grantinfo.DebitPermissionKey = map["DebitPermissionKey"].AsUUID; return(item); }
private ObjectPartInventoryItem ObjectPartInventoryItemFromDbReader(MySqlDataReader dbReader) { var item = new ObjectPartInventoryItem(dbReader.GetUUID("InventoryID")) { AssetID = dbReader.GetUUID("AssetID"), AssetType = dbReader.GetEnum <AssetType>("AssetType"), CreationDate = dbReader.GetDate("CreationDate"), Creator = dbReader.GetUUI("Creator"), Description = dbReader.GetString("Description"), Flags = dbReader.GetEnum <InventoryFlags>("Flags"), Group = dbReader.GetUGI("Group"), IsGroupOwned = dbReader.GetBool("GroupOwned"), InventoryType = dbReader.GetEnum <InventoryType>("InventoryType"), LastOwner = dbReader.GetUUI("LastOwner"), Name = dbReader.GetString("Name"), Owner = dbReader.GetUUI("Owner"), ParentFolderID = dbReader.GetUUID("PrimID"), NextOwnerAssetID = dbReader.GetUUID("NextOwnerAssetID"), ExperienceID = dbReader.GetUUID("ExperienceID") }; item.Permissions.Base = dbReader.GetEnum <InventoryPermissionsMask>("BasePermissions"); item.Permissions.Current = dbReader.GetEnum <InventoryPermissionsMask>("CurrentPermissions"); item.Permissions.EveryOne = dbReader.GetEnum <InventoryPermissionsMask>("EveryOnePermissions"); item.Permissions.Group = dbReader.GetEnum <InventoryPermissionsMask>("GroupPermissions"); item.Permissions.NextOwner = dbReader.GetEnum <InventoryPermissionsMask>("NextOwnerPermissions"); item.SaleInfo.Type = dbReader.GetEnum <InventoryItem.SaleInfoData.SaleType>("SaleType"); item.SaleInfo.Price = dbReader.GetInt32("SalePrice"); item.SaleInfo.PermMask = dbReader.GetEnum <InventoryPermissionsMask>("SalePermMask"); var grantinfo = new ObjectPartInventoryItem.PermsGranterInfo(); if (((string)dbReader["PermsGranter"]).Length != 0) { try { grantinfo.PermsGranter = dbReader.GetUUI("PermsGranter"); } catch { /* no action required */ } } grantinfo.PermsMask = dbReader.GetEnum <ScriptPermissions>("PermsMask"); return(item); }