From c176caeb05c2264654b764e4d010561da60c24fc Mon Sep 17 00:00:00 2001
From: Sean Dague
Date: Thu, 10 Apr 2008 13:53:06 +0000
Subject: moved fields to properties for UserDataProfile, which was actually a
 little more work than I expected given the copious use of out params.

---
 OpenSim/Region/ClientStack/ClientView.cs           | 10 +++---
 .../Region/ClientStack/RegionApplicationBase.cs    |  4 +--
 .../Communications/Local/LocalLoginService.cs      | 30 ++++++++--------
 .../Communications/Local/LocalUserServices.cs      |  2 +-
 .../Region/Communications/OGS1/OGS1UserServices.cs | 40 +++++++++++-----------
 OpenSim/Region/DataSnapshot/LandSnapshot.cs        |  2 +-
 .../Environment/Modules/AvatarProfilesModule.cs    | 22 ++++++------
 OpenSim/Region/Environment/Modules/VoiceModule.cs  |  2 +-
 .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs    |  2 +-
 .../AsyncCommandPlugins/SensorRepeat.cs            |  2 +-
 10 files changed, 58 insertions(+), 58 deletions(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index a91987f..e8c3f7c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -3100,11 +3100,11 @@ namespace OpenSim.Region.ClientStack
                          {
                              AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = Packet.PropertiesData;
                              UserProfileData UserProfile = new UserProfileData();
-                             UserProfile.UUID = AgentId;
-                             UserProfile.profileAboutText = Helpers.FieldToUTF8String(Properties.AboutText);
-                             UserProfile.profileFirstText = Helpers.FieldToUTF8String(Properties.FLAboutText);
-                             UserProfile.profileFirstImage = Properties.FLImageID;
-                             UserProfile.profileImage = Properties.ImageID;
+                             UserProfile.Id = AgentId;
+                             UserProfile.ProfileAboutText = Helpers.FieldToUTF8String(Properties.AboutText);
+                             UserProfile.ProfileFirstText = Helpers.FieldToUTF8String(Properties.FLAboutText);
+                             UserProfile.ProfileFirstImage = Properties.FLImageID;
+                             UserProfile.ProfileImage = Properties.ImageID;
 
                              handlerUpdateAvatarProperties(this, UserProfile);
                          }
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 4dd58f2..e91cab5 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -149,8 +149,8 @@ namespace OpenSim.Region.ClientStack
 
             if (masterAvatar != null)
             {
-                m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.UUID.ToString() + "]");
-                scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
+                m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.Id.ToString() + "]");
+                scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.Id;
             }
             else
             {
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 4632716..d1d3e22 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Communications.Local
                 profile = m_userManager.GetUserProfile(firstname, lastname);
                 if (profile != null)
                 {
-                    m_Parent.InventoryService.CreateNewUserInventory(profile.UUID);
+                    m_Parent.InventoryService.CreateNewUserInventory(profile.Id);
                 }
 
                 return profile;
@@ -107,17 +107,17 @@ namespace OpenSim.Region.Communications.Local
             else
             {
                 m_log.Info(
-                    "[LOGIN]: Authenticating " + profile.username + " " + profile.surname);
+                    "[LOGIN]: Authenticating " + profile.FirstName + " " + profile.SurName);
                
                 if (!password.StartsWith("$1$"))
                     password = "$1$" + Util.Md5Hash(password);
 
                 password = password.Remove(0, 3); //remove $1$
 
-                string s = Util.Md5Hash(password + ":" + profile.passwordSalt);
+                string s = Util.Md5Hash(password + ":" + profile.PasswordSalt);
 
-                bool loginresult = (profile.passwordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
-                            || profile.passwordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase));
+                bool loginresult = (profile.PasswordHash.Equals(s.ToString(), StringComparison.InvariantCultureIgnoreCase)
+                            || profile.PasswordHash.Equals(password, StringComparison.InvariantCultureIgnoreCase));
                 return loginresult;
             }
         }
@@ -127,18 +127,18 @@ namespace OpenSim.Region.Communications.Local
             ulong currentRegion = 0;
             if (startLocationRequest == "last")
             {
-                currentRegion = theUser.currentAgent.currentHandle;
+                currentRegion = theUser.CurrentAgent.currentHandle;
             }
             else if (startLocationRequest == "home")
             {
-                currentRegion = theUser.homeRegion;
+                currentRegion = theUser.HomeRegion;
             }
             else
             {
                 m_log.Info("[LOGIN]: Got Custom Login URL, but can't process it");
                 // LocalBackEndServices can't possibly look up a region by name :(
                 // TODO: Parse string in the following format: 'uri:RegionName&X&Y&Z'
-                currentRegion = theUser.currentAgent.currentHandle;
+                currentRegion = theUser.CurrentAgent.currentHandle;
             }
 
             RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion);
@@ -147,10 +147,10 @@ namespace OpenSim.Region.Communications.Local
             {
                 response.Home = "{'region_handle':[r" + (reg.RegionLocX * Constants.RegionSize).ToString() + ",r" +
                                 (reg.RegionLocY * Constants.RegionSize).ToString() + "], " +
-                                "'position':[r" + theUser.homeLocation.X.ToString() + ",r" +
-                                theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "], " +
-                                "'look_at':[r" + theUser.homeLocation.X.ToString() + ",r" +
-                                theUser.homeLocation.Y.ToString() + ",r" + theUser.homeLocation.Z.ToString() + "]}";
+                                "'position':[r" + theUser.HomeLocation.X.ToString() + ",r" +
+                                theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "], " +
+                                "'look_at':[r" + theUser.HomeLocation.X.ToString() + ",r" +
+                                theUser.HomeLocation.Y.ToString() + ",r" + theUser.HomeLocation.Z.ToString() + "]}";
                 string capsPath = Util.GetRandomCapsPath();
                 response.SimAddress = reg.ExternalEndPoint.Address.ToString();
                 response.SimPort = (uint) reg.ExternalEndPoint.Port;
@@ -164,12 +164,12 @@ namespace OpenSim.Region.Communications.Local
                     "[CAPS]: Sending new CAPS seed url {0} to client {1}", 
                     response.SeedCapability, response.AgentID);                
 
-                theUser.currentAgent.currentRegion = reg.RegionID;
-                theUser.currentAgent.currentHandle = reg.RegionHandle;
+                theUser.CurrentAgent.currentRegion = reg.RegionID;
+                theUser.CurrentAgent.currentHandle = reg.RegionHandle;
 
                 LoginResponse.BuddyList buddyList = new LoginResponse.BuddyList();
 
-                response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.UUID)); 
+                response.BuddList = ConvertFriendListItem(m_userManager.GetUserFriendList(theUser.Id)); 
 
                 Login _login = new Login();
                 //copy data to login object
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index c31367f..00514e8 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Communications.Local
             }
             else
             {
-                m_inventoryService.CreateNewUserInventory(profile.UUID);
+                m_inventoryService.CreateNewUserInventory(profile.Id);
             }
 
             return profile;
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 79e323a..9796cf4 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -60,24 +60,24 @@ namespace OpenSim.Region.Communications.OGS1
             }
 
             UserProfileData userData = new UserProfileData();
-            userData.username = (string) data["firstname"];
-            userData.surname = (string) data["lastname"];
-            userData.UUID = new LLUUID((string) data["uuid"]);
-            userData.userInventoryURI = (string) data["server_inventory"];
-            userData.userAssetURI = (string) data["server_asset"];
-            userData.profileFirstText = (string) data["profile_firstlife_about"];
-            userData.profileFirstImage = new LLUUID((string) data["profile_firstlife_image"]);
-            userData.profileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]);
-            userData.profileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
-            userData.profileAboutText = (string)data["profile_about"];
-            userData.profileImage = new LLUUID((string) data["profile_image"]);
-            userData.lastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
-            userData.homeRegion = Convert.ToUInt64((string) data["home_region"]);
-            userData.homeLocation =
+            userData.FirstName = (string) data["firstname"];
+            userData.SurName = (string) data["lastname"];
+            userData.Id = new LLUUID((string) data["uuid"]);
+            userData.UserInventoryURI = (string) data["server_inventory"];
+            userData.UserAssetURI = (string) data["server_asset"];
+            userData.ProfileFirstText = (string) data["profile_firstlife_about"];
+            userData.ProfileFirstImage = new LLUUID((string) data["profile_firstlife_image"]);
+            userData.ProfileCanDoMask = Convert.ToUInt32((string) data["profile_can_do"]);
+            userData.ProfileWantDoMask = Convert.ToUInt32(data["profile_want_do"]);
+            userData.ProfileAboutText = (string)data["profile_about"];
+            userData.ProfileImage = new LLUUID((string) data["profile_image"]);
+            userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
+            userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]);
+            userData.HomeLocation =
                 new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]),
                               (float) Convert.ToDecimal((string) data["home_coordinates_y"]),
                               (float) Convert.ToDecimal((string) data["home_coordinates_z"]));
-            userData.homeLookAt =
+            userData.HomeLookAt =
                 new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]),
                               (float) Convert.ToDecimal((string) data["home_look_y"]),
                               (float) Convert.ToDecimal((string) data["home_look_z"]));
@@ -306,13 +306,13 @@ namespace OpenSim.Region.Communications.OGS1
         {
             m_log.Debug("[OGS1 USER SERVICES]: Asking UserServer to update profile.");
             Hashtable param = new Hashtable();
-            param["avatar_uuid"] = UserProfile.UUID.ToString();
+            param["avatar_uuid"] = UserProfile.Id.ToString();
             //param["AllowPublish"] = UserProfile.ToString();
-            param["FLImageID"] = UserProfile.profileFirstImage.ToString();
-            param["ImageID"] = UserProfile.profileImage.ToString();
+            param["FLImageID"] = UserProfile.ProfileFirstImage.ToString();
+            param["ImageID"] = UserProfile.ProfileImage.ToString();
             //param["MaturePublish"] = MaturePublish.ToString();
-            param["AboutText"] = UserProfile.profileAboutText;
-            param["FLAboutText"] = UserProfile.profileFirstText;
+            param["AboutText"] = UserProfile.ProfileAboutText;
+            param["FLAboutText"] = UserProfile.ProfileFirstText;
             //param["ProfileURL"] = UserProfile.ProfileURL.ToString();
             IList parameters = new ArrayList();
             parameters.Add(param);
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
index a8bbed1..a82f4be 100644
--- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
@@ -223,7 +223,7 @@ namespace OpenSim.Region.DataSnapshot
                             {
                                 XmlNode username = nodeFactory.CreateNode(XmlNodeType.Element, "name", "");
                                 UserProfileData userProfile = m_scene.CommsManager.UserService.GetUserProfile(userOwnerUUID);
-                                username.InnerText = userProfile.username + " " + userProfile.surname;
+                                username.InnerText = userProfile.FirstName + " " + userProfile.SurName;
                                 userblock.AppendChild(username);
                             }
                             catch (Exception)
diff --git a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
index 0ead5f7..699e68d 100644
--- a/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
+++ b/OpenSim/Region/Environment/Modules/AvatarProfilesModule.cs
@@ -90,10 +90,10 @@ namespace OpenSim.Region.Environment.Modules
             UserProfileData profile = m_scene.CommsManager.UserService.GetUserProfile(avatarID);
             if (null != profile)
             {
-                remoteClient.SendAvatarProperties(profile.UUID, profile.profileAboutText,
-                    Util.ToDateTime(profile.created).ToString(),
-                    System.String.Empty, profile.profileFirstText, profile.profileCanDoMask,
-                    profile.profileFirstImage, profile.profileImage, System.String.Empty, partner);
+                remoteClient.SendAvatarProperties(profile.Id, profile.ProfileAboutText,
+                    Util.ToDateTime(profile.Created).ToString(),
+                    System.String.Empty, profile.ProfileFirstText, profile.ProfileCanDoMask,
+                    profile.ProfileFirstImage, profile.ProfileImage, System.String.Empty, partner);
             }
             else
             {
@@ -103,15 +103,15 @@ namespace OpenSim.Region.Environment.Modules
 
         public void UpdateAvatarProperties(IClientAPI remoteClient, UserProfileData newProfile)
         {
-            UserProfileData Profile = m_scene.CommsManager.UserService.GetUserProfile(newProfile.UUID);
+            UserProfileData Profile = m_scene.CommsManager.UserService.GetUserProfile(newProfile.Id);
            
             // if it's the profile of the user requesting the update, then we change only a few things.
-            if (remoteClient.AgentId.CompareTo(Profile.UUID) == 0)
+            if (remoteClient.AgentId.CompareTo(Profile.Id) == 0)
             {
-                Profile.profileImage = newProfile.profileImage;
-                Profile.profileFirstImage = newProfile.profileFirstImage;
-                Profile.profileAboutText = newProfile.profileAboutText;
-                Profile.profileFirstText = newProfile.profileFirstText;
+                Profile.ProfileImage = newProfile.ProfileImage;
+                Profile.ProfileFirstImage = newProfile.ProfileFirstImage;
+                Profile.ProfileAboutText = newProfile.ProfileAboutText;
+                Profile.ProfileFirstText = newProfile.ProfileFirstText;
             }
             else
             {
@@ -119,7 +119,7 @@ namespace OpenSim.Region.Environment.Modules
             }
             if (m_scene.CommsManager.UserService.UpdateUserProfileProperties(Profile))
             {
-                RequestAvatarProperty(remoteClient, newProfile.UUID);
+                RequestAvatarProperty(remoteClient, newProfile.Id);
             }
         }
     }
diff --git a/OpenSim/Region/Environment/Modules/VoiceModule.cs b/OpenSim/Region/Environment/Modules/VoiceModule.cs
index b254507..8ca4698 100644
--- a/OpenSim/Region/Environment/Modules/VoiceModule.cs
+++ b/OpenSim/Region/Environment/Modules/VoiceModule.cs
@@ -180,7 +180,7 @@ namespace OpenSim.Region.Environment.Modules
                 if (null == userInfo) throw new Exception("cannot get user details");
 
                 LLSDVoiceAccountResponse voiceAccountResponse = 
-                    new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.passwordHash);
+                    new LLSDVoiceAccountResponse(voiceUser, "$1$" + userInfo.UserProfile.PasswordHash);
                 string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse);
                 m_log.DebugFormat("[CAPS][PROVISIONVOICE]: {0}", r);
                 return r;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 50bd386..a070248 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -407,7 +407,7 @@ namespace OpenSim.Region.ScriptEngine.Common
             UserProfileData profile = World.CommsManager.UserService.GetUserProfile(objecUUID);
             if (profile != null)
             {
-                string avatarname = profile.username + " " + profile.surname;
+                string avatarname = profile.FirstName + " " + profile.SurName;
                 return avatarname;
             }
             // try an scene object
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
index c025b5b..fd8dbd1 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AsyncCommandPlugins/SensorRepeat.cs
@@ -272,7 +272,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.AsyncCommandPlugin
                             UserProfileData profile = m_CmdManager.m_ScriptEngine.World.CommsManager.UserService.GetUserProfile(ent.UUID);
                             if (profile != null)
                             {
-                               avatarname = profile.username + " " + profile.surname;
+                               avatarname = profile.FirstName + " " + profile.SurName;
                             }
                             // try an scene object
                             SceneObjectPart SOP = m_CmdManager.m_ScriptEngine.World.GetSceneObjectPart(ent.UUID);
-- 
cgit v1.1