mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 05:45:37 +08:00
minor changes on profiles module; add some .trim() to create user avatar
names
This commit is contained in:
@@ -244,7 +244,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
|
||||
public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID toAgent, List<GroupChatListAgentUpdateData> updates)
|
||||
{
|
||||
osUTF8 sb = StartEvent("ChatterBoxSessionAgentListUpdates",1024);
|
||||
osUTF8 sb = StartEvent("ChatterBoxSessionAgentListUpdates");
|
||||
LLSDxmlEncode2.AddMap("agent_updates",sb);
|
||||
foreach (GroupChatListAgentUpdateData up in updates)
|
||||
{
|
||||
|
||||
@@ -557,26 +557,22 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
return;
|
||||
}
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
|
||||
parameters.Add("creatorId", OSD.FromUUID(targetID));
|
||||
OSD Params = (OSD)parameters;
|
||||
if(!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
|
||||
OSDMap parameters= new OSDMap() {{"creatorId", OSD.FromUUID(targetID) }};
|
||||
OSD osdtmp = parameters;
|
||||
if(!rpc.JsonRpcRequest(ref osdtmp, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAvatarClassifiedReply(targetID, classifieds);
|
||||
return;
|
||||
}
|
||||
|
||||
parameters = (OSDMap)Params;
|
||||
|
||||
if(!parameters.ContainsKey("result") || parameters["result"] == null)
|
||||
parameters = (OSDMap)osdtmp;
|
||||
if(!parameters.TryGetValue("result", out osdtmp) || !(osdtmp is OSDArray))
|
||||
{
|
||||
remoteClient.SendAvatarClassifiedReply(targetID, classifieds);
|
||||
return;
|
||||
}
|
||||
|
||||
OSDArray list = (OSDArray)parameters["result"];
|
||||
|
||||
OSDArray list = (OSDArray)osdtmp;
|
||||
foreach(OSD map in list)
|
||||
{
|
||||
OSDMap m = (OSDMap)map;
|
||||
@@ -658,14 +654,14 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
return;
|
||||
}
|
||||
|
||||
object Ad = (object)ad;
|
||||
if(!rpc.JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString()))
|
||||
object Adobject = ad;
|
||||
if(!rpc.JsonRpcRequest(ref Adobject, "classifieds_info_query", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
"Error getting classified info", false);
|
||||
return;
|
||||
}
|
||||
ad = (UserClassifiedAdd) Ad;
|
||||
ad = (UserClassifiedAdd) Adobject;
|
||||
|
||||
if(ad.CreatorId.IsZero())
|
||||
return;
|
||||
@@ -759,13 +755,13 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
OSDMap parameters = new OSDMap {{"creatorId", OSD.FromUUID(creatorId)}};
|
||||
OSD Params = (OSD)parameters;
|
||||
if (!rpc.JsonRpcRequest(ref Params, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
|
||||
OSD osdtmp = parameters;
|
||||
if (!rpc.JsonRpcRequest(ref osdtmp, "avatarclassifiedsrequest", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Error fetching classifieds", false);
|
||||
return;
|
||||
}
|
||||
parameters = (OSDMap)Params;
|
||||
parameters = (OSDMap)osdtmp;
|
||||
OSDArray list = (OSDArray)parameters["result"];
|
||||
bool exists = list.Cast<OSDMap>().Where(map => map.ContainsKey("classifieduuid"))
|
||||
.Any(map => map["classifieduuid"].AsUUID().Equals(queryclassifiedID));
|
||||
@@ -783,7 +779,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
remoteClient.SendAvatarClassifiedReply(remoteClient.AgentId, uce.classifiedsLists);
|
||||
return;
|
||||
}
|
||||
// money.ApplyCharge(remoteClient.AgentId, queryclassifiedPrice, MoneyTransactionType.ClassifiedCharge);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -804,9 +799,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
ad.ParcelId = p.currentParcelUUID;
|
||||
|
||||
object Ad = ad;
|
||||
|
||||
OSD.SerializeMembers(Ad);
|
||||
|
||||
if(!rpc.JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Error updating classified", false);
|
||||
@@ -828,7 +820,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
uce.classifiedsLists = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -842,7 +833,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
/// </param>
|
||||
public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
|
||||
{
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
if(string.IsNullOrWhiteSpace(serverURI))
|
||||
@@ -858,13 +848,11 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
if(!UUID.TryParse(queryClassifiedID.ToString(), out classifiedId))
|
||||
return;
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
parameters.Add("classifiedId", OSD.FromUUID(classifiedId));
|
||||
OSD Params = (OSD)parameters;
|
||||
OSD Params = new OSDMap() {{ "classifiedId", OSD.FromUUID(classifiedId) }};
|
||||
if(!rpc.JsonRpcRequest(ref Params, "classified_delete", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
"Error classified delete", false);
|
||||
"Error deleting classified", false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -878,8 +866,6 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
uce.classifiedsLists = null;
|
||||
}
|
||||
}
|
||||
|
||||
parameters = (OSDMap)Params;
|
||||
}
|
||||
#endregion Classified
|
||||
|
||||
@@ -943,23 +929,22 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
return;
|
||||
}
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
parameters.Add("creatorId", OSD.FromUUID(targetId));
|
||||
OSD Params = (OSD)parameters;
|
||||
if(!rpc.JsonRpcRequest(ref Params, "avatarpicksrequest", serverURI, UUID.Random().ToString()))
|
||||
OSDMap parameters= new OSDMap() {{"creatorId", OSD.FromUUID(targetId)}};
|
||||
OSD osdtmp = parameters;
|
||||
if(!rpc.JsonRpcRequest(ref osdtmp, "avatarpicksrequest", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAvatarPicksReply(targetId, picks);
|
||||
return;
|
||||
}
|
||||
|
||||
parameters = (OSDMap)Params;
|
||||
if(!parameters.ContainsKey("result") || parameters["result"] == null)
|
||||
parameters = (OSDMap)osdtmp;
|
||||
if(!parameters.TryGetValue("result", out osdtmp) || !(osdtmp is OSDArray))
|
||||
{
|
||||
remoteClient.SendAvatarPicksReply(targetId, picks);
|
||||
return;
|
||||
}
|
||||
OSDArray list = (OSDArray)parameters["result"];
|
||||
|
||||
OSDArray list = (OSDArray)osdtmp;
|
||||
foreach(OSD map in list)
|
||||
{
|
||||
OSDMap m = (OSDMap)map;
|
||||
@@ -1086,7 +1071,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString());
|
||||
//m_log.DebugFormat("[PROFILES]: PickInfoRequest: {0} : {1}", pick.Name.ToString(), pick.SnapshotId.ToString());
|
||||
|
||||
lock(m_profilesCache)
|
||||
{
|
||||
@@ -1137,7 +1122,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
/// </param>
|
||||
public void PickInfoUpdate(IClientAPI remoteClient, UUID pickID, UUID creatorID, bool topPick, string name, string desc, UUID snapshotID, int sortOrder, bool enabled)
|
||||
{
|
||||
m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString());
|
||||
//m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString());
|
||||
|
||||
UserProfilePick pick = new UserProfilePick();
|
||||
string serverURI = string.Empty;
|
||||
@@ -1217,7 +1202,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
pick.Desc,pick.SnapshotId,pick.ParcelName,pick.OriginalName,pick.SimName,
|
||||
posGlobal,pick.SortOrder,pick.Enabled);
|
||||
|
||||
m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString());
|
||||
//m_log.DebugFormat("[PROFILES]: Finish PickInfoUpdate {0} {1}", pick.Name, pick.PickId.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1448,22 +1433,20 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
/// </param>
|
||||
public void AvatarInterestsUpdate(IClientAPI remoteClient, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages)
|
||||
{
|
||||
|
||||
UserProfileProperties prop = new UserProfileProperties();
|
||||
|
||||
prop.UserId = remoteClient.AgentId;
|
||||
prop.WantToMask = (int)wantmask;
|
||||
prop.WantToText = wanttext;
|
||||
prop.SkillsMask = (int)skillsmask;
|
||||
prop.SkillsText = skillstext;
|
||||
prop.Language = languages;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
if(string.IsNullOrWhiteSpace(serverURI))
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out string serverURI);
|
||||
if (string.IsNullOrWhiteSpace(serverURI))
|
||||
return;
|
||||
|
||||
object Param = prop;
|
||||
object Param = new UserProfileProperties()
|
||||
{
|
||||
UserId = remoteClient.AgentId,
|
||||
WantToMask = (int)wantmask,
|
||||
WantToText = wanttext,
|
||||
SkillsMask = (int)skillsmask,
|
||||
SkillsText = skillstext,
|
||||
Language = languages
|
||||
};
|
||||
|
||||
if(!rpc.JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage(
|
||||
|
||||
@@ -591,6 +591,8 @@ namespace OpenSim.Services.UserAccountService
|
||||
/// <param name="model"></param>
|
||||
public UserAccount CreateUser(UUID scopeID, UUID principalID, string firstName, string lastName, string password, string email, string model = "")
|
||||
{
|
||||
firstName = firstName.Trim();
|
||||
lastName = lastName.Trim();
|
||||
UserAccount account = GetUserAccount(UUID.Zero, firstName, lastName);
|
||||
if (null == account)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user