mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
moved fields to properties for UserDataProfile, which was
actually a little more work than I expected given the copious use of out params.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.Communications.Local
|
||||
}
|
||||
else
|
||||
{
|
||||
m_inventoryService.CreateNewUserInventory(profile.UUID);
|
||||
m_inventoryService.CreateNewUserInventory(profile.Id);
|
||||
}
|
||||
|
||||
return profile;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user