/// <summary> /// Creates a new inventory item based on item /// </summary> /// <param name="item">The item to be created</param> public void addInventoryItem(InventoryItemBase item) { if (!ExistsItem(item.ID)) { manager.Insert(item); } else { m_log.ErrorFormat("[NHIBERNATE] Attempted to add Inventory Item {0} that already exists, updating instead", item.ID); updateInventoryItem(item); } }
public void StoreRegionSettings(RegionSettings rs) { RegionSettings oldRegionSettings = (RegionSettings)manager.Get(typeof(RegionSettings), rs.RegionUUID); if (oldRegionSettings != null) { manager.Update(rs); } else { manager.Insert(rs); } }
private void Save(AssetBase asset) { AssetBase temp = (AssetBase)manager.Get(typeof(AssetBase), asset.FullID); if (temp == null) { manager.Insert(asset); } }
override public void AddNewUserProfile(UserProfileData profile) { if (profile.ID == UUID.Zero) { m_log.ErrorFormat("[NHIBERNATE] Attempted to add User {0} {1} with zero UUID, throwintg exception as this is programming error ", profile.FirstName, profile.SurName); return; } if (!ExistsUser(profile.ID)) { m_log.InfoFormat("[NHIBERNATE] AddNewUserProfile {0}", profile.ID); manager.Insert(profile); } else { m_log.ErrorFormat("[NHIBERNATE] Attempted to add User {0} {1} that already exists, updating instead", profile.FirstName, profile.SurName); UpdateUserProfile(profile); } }
public override DataResponse AddProfile(RegionProfileData profile) { if (manager.Get(typeof(RegionProfileData), profile.Uuid) == null) { manager.Insert(profile); return(DataResponse.RESPONSE_OK); } else { return(DataResponse.RESPONSE_ERROR); } }
override public void AddNewUserProfile(UserProfileData profile) { if (profile.ID == UUID.Zero) { m_log.ErrorFormat("[NHIBERNATE] Attempted to add User {0} {1} with zero UUID, throwintg exception as this is programming error ", profile.FirstName, profile.SurName); return; } if (!ExistsUser(profile.ID)) { m_log.InfoFormat("[NHIBERNATE] AddNewUserProfile {0}", profile.ID); manager.Insert(profile); // Agent should not be saved according to BasicUserTest.T015_UserPersistency() // SetAgentData(profile.ID, profile.CurrentAgent); } else { m_log.ErrorFormat("[NHIBERNATE] Attempted to add User {0} {1} that already exists, updating instead", profile.FirstName, profile.SurName); UpdateUserProfile(profile); } }
public EstateSettings LoadEstateSettings(UUID regionID) { EstateRegionLink link = LoadEstateRegionLink(regionID); // Ensure that estate settings exist for the link if (link != null) { if (manager.GetWithStatefullSession(typeof(EstateSettings), link.EstateID) == null) { // Delete broken link manager.Delete(link); link = null; } } // If estate link does not exist create estate settings and link it to region. if (link == null) { EstateSettings estateSettings = new EstateSettings(); //estateSettings.EstateOwner = UUID.Random(); //estateSettings.BlockDwell = false; object identifier = manager.Insert(estateSettings); if (identifier == null) { // Saving failed. Error is logged in the manager. return(null); } uint estateID = (uint)identifier; link = new EstateRegionLink(); link.EstateRegionLinkID = UUID.Random(); link.RegionID = regionID; link.EstateID = estateID; manager.InsertWithStatefullSession(link); } // Load estate settings according to the existing or created link. return((EstateSettings)manager.GetWithStatefullSession(typeof(EstateSettings), link.EstateID)); }