From ddaa90d270c9bd10c74cf89b29b45963719f9b60 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 15 Sep 2008 19:02:34 +0000 Subject: * refactor: collapse UpdateUserProfileProperties() into existing UpdateUserProfile * the methods were identical except that the Properties one did a check for the user profile beforehand. However, every caller was doing this already anyway. --- .../Region/Communications/OGS1/OGS1UserServices.cs | 51 ++++++++++------------ .../Avatar/Profiles/AvatarProfilesModule.cs | 3 +- OpenSim/Region/Environment/Scenes/Scene.cs | 4 +- 3 files changed, 27 insertions(+), 31 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs index 0ca85d2..28177d0 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs @@ -475,38 +475,32 @@ namespace OpenSim.Region.Communications.OGS1 throw new Exception("The method or operation is not implemented."); } - // TODO - public bool UpdateUserProfile(UserProfileData data) - { - return false; - } - - public bool UpdateUserProfileProperties(UserProfileData UserProfile) + public bool UpdateUserProfile(UserProfileData userProfile) { m_log.Debug("[OGS1 USER SERVICES]: Asking UserServer to update profile."); Hashtable param = new Hashtable(); - param["avatar_uuid"] = UserProfile.ID.ToString(); - //param["AllowPublish"] = UserProfile.ToString(); - param["FLImageID"] = UserProfile.FirstLifeImage.ToString(); - param["ImageID"] = UserProfile.Image.ToString(); + param["avatar_uuid"] = userProfile.ID.ToString(); + //param["AllowPublish"] = userProfile.ToString(); + param["FLImageID"] = userProfile.FirstLifeImage.ToString(); + param["ImageID"] = userProfile.Image.ToString(); //param["MaturePublish"] = MaturePublish.ToString(); - param["AboutText"] = UserProfile.AboutText; - param["FLAboutText"] = UserProfile.FirstLifeAboutText; - //param["ProfileURL"] = UserProfile.ProfileURL.ToString(); - - param["home_region"] = UserProfile.HomeRegion.ToString(); - param["home_region_id"] = UserProfile.HomeRegionID.ToString(); - - param["home_pos_x"] = UserProfile.HomeLocationX.ToString(); - param["home_pos_y"] = UserProfile.HomeLocationY.ToString(); - param["home_pos_z"] = UserProfile.HomeLocationZ.ToString(); - param["home_look_x"] = UserProfile.HomeLookAtX.ToString(); - param["home_look_y"] = UserProfile.HomeLookAtY.ToString(); - param["home_look_z"] = UserProfile.HomeLookAtZ.ToString(); - param["user_flags"] = UserProfile.UserFlags.ToString(); - param["god_level"] = UserProfile.GodLevel.ToString(); - param["custom_type"] = UserProfile.CustomType.ToString(); - param["partner"] = UserProfile.Partner.ToString(); + param["AboutText"] = userProfile.AboutText; + param["FLAboutText"] = userProfile.FirstLifeAboutText; + //param["ProfileURL"] = userProfile.ProfileURL.ToString(); + + param["home_region"] = userProfile.HomeRegion.ToString(); + param["home_region_id"] = userProfile.HomeRegionID.ToString(); + + param["home_pos_x"] = userProfile.HomeLocationX.ToString(); + param["home_pos_y"] = userProfile.HomeLocationY.ToString(); + param["home_pos_z"] = userProfile.HomeLocationZ.ToString(); + param["home_look_x"] = userProfile.HomeLookAtX.ToString(); + param["home_look_y"] = userProfile.HomeLookAtY.ToString(); + param["home_look_z"] = userProfile.HomeLookAtZ.ToString(); + param["user_flags"] = userProfile.UserFlags.ToString(); + param["god_level"] = userProfile.GodLevel.ToString(); + param["custom_type"] = userProfile.CustomType.ToString(); + param["partner"] = userProfile.Partner.ToString(); IList parameters = new ArrayList(); parameters.Add(param); @@ -535,6 +529,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.Warn("[GRID]: Unable to update user profile, UserServer didn't understand me!"); return false; } + return true; } diff --git a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs index f9c0dcf..b1cf802 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Profiles/AvatarProfilesModule.cs @@ -134,7 +134,8 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Profiles { return; } - if (m_scene.CommsManager.UserService.UpdateUserProfileProperties(Profile)) + + if (m_scene.CommsManager.UserService.UpdateUserProfile(Profile)) { RequestAvatarProperty(remoteClient, newProfile.ID); } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 7116904..2a736fb 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -2254,7 +2254,7 @@ namespace OpenSim.Region.Environment.Scenes return; } UserProfile.HomeRegionID = info.RegionID; - CommsManager.UserService.UpdateUserProfileProperties(UserProfile); + CommsManager.UserService.UpdateUserProfile(UserProfile); } else { @@ -2355,7 +2355,7 @@ namespace OpenSim.Region.Environment.Scenes UserProfile.HomeRegion = RegionInfo.RegionHandle; UserProfile.HomeLocation = position; UserProfile.HomeLookAt = lookAt; - CommsManager.UserService.UpdateUserProfileProperties(UserProfile); + CommsManager.UserService.UpdateUserProfile(UserProfile); remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); } -- cgit v1.1