コード例 #1
0
 /// <summary>
 ///     Updates an inventory item with item (updates based on ID)
 /// </summary>
 /// <param name="item">The updated item</param>
 public void updateInventoryItem(InventoryItemBase item)
 {
     if (ExistsItem(item.ID))
     {
         manager.Update(item);
     }
     else
     {
         m_log.ErrorFormat("[NHIBERNATE] Attempted to add Inventory Item {0} that already exists", item.ID);
     }
 }
コード例 #2
0
        public void StoreRegionSettings(RegionSettings rs)
        {
            RegionSettings oldRegionSettings = (RegionSettings)manager.Get(typeof(RegionSettings), rs.RegionUUID);

            if (oldRegionSettings != null)
            {
                manager.Update(rs);
            }
            else
            {
                manager.Insert(rs);
            }
        }
コード例 #3
0
 override public bool UpdateUserProfile(UserProfileData profile)
 {
     if (ExistsUser(profile.ID))
     {
         manager.Update(profile);
         return(true);
     }
     else
     {
         m_log.ErrorFormat("[NHIBERNATE] Attempted to update User {0} {1} that doesn't exist, updating instead", profile.FirstName, profile.SurName);
         AddNewUserProfile(profile);
         return(true);
     }
 }
コード例 #4
0
        /*
         * private void SetAgentData(UUID uuid, UserAgentData agent)
         * {
         *  UserAgentData old = (UserAgentData)manager.Load(typeof(UserAgentData), uuid);
         *  if (old != null)
         *  {
         *      m_log.InfoFormat("[NHIBERNATE] SetAgentData deleting old: {0} ",uuid);
         *      manager.Delete(old);
         *  }
         *  if (agent != null)
         *  {
         *      m_log.InfoFormat("[NHIBERNATE] SetAgentData: {0} ", agent.ProfileID);
         *      manager.Save(agent);
         *  }
         * }
         */

        override public bool UpdateUserProfile(UserProfileData profile)
        {
            if (ExistsUser(profile.ID))
            {
                manager.Update(profile);
                // Agent should not be saved according to BasicUserTest.T015_UserPersistency()
                // SetAgentData(profile.ID, profile.CurrentAgent);
                return(true);
            }
            else
            {
                m_log.ErrorFormat("[NHIBERNATE] Attempted to update User {0} {1} that doesn't exist, updating instead", profile.FirstName, profile.SurName);
                AddNewUserProfile(profile);
                return(true);
            }
        }
コード例 #5
0
 public override DataResponse UpdateProfile(RegionProfileData profile)
 {
     if (manager.Get(typeof(RegionProfileData), profile.Uuid) != null)
     {
         manager.Update(profile);
         return(DataResponse.RESPONSE_OK);
     }
     else
     {
         return(DataResponse.RESPONSE_ERROR);
     }
 }
コード例 #6
0
 override public void UpdateAsset(AssetBase asset)
 {
     m_log.InfoFormat("[NHIBERNATE] updating asset {0}", asset.FullID);
     manager.Update(asset);
 }