mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
* Avatar picker works in grid mode now.
* To test, click the communicate button, then click the 'add' button and type a name. You will get a list of closely matching avatar names. * Before this'll work on your sim in grid mode, the UGA needs to be updated. If it isn't updated, then you'll get a message on the sim console when searching like, 'got invalid queryid'.
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
*/
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using libsecondlife;
|
||||
using Nwc.XmlRpc;
|
||||
using OpenSim.Framework;
|
||||
@@ -70,6 +71,24 @@ namespace OpenSim.Grid.UserServer
|
||||
return response;
|
||||
}
|
||||
|
||||
public XmlRpcResponse AvatarPickerListtoXmlRPCResponse(LLUUID queryID, List<AvatarPickerAvatar> returnUsers)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable responseData = new Hashtable();
|
||||
// Query Result Information
|
||||
responseData["queryid"] = (string)queryID.ToStringHyphenated();
|
||||
responseData["avcount"] = (string)returnUsers.Count.ToString();
|
||||
|
||||
for (int i = 0; i < returnUsers.Count; i++)
|
||||
{
|
||||
responseData["avatarid" + i.ToString()] = returnUsers[i].AvatarID.ToStringHyphenated();
|
||||
responseData["firstname" + i.ToString()] = returnUsers[i].firstName;
|
||||
responseData["lastname" + i.ToString()] = returnUsers[i].lastName;
|
||||
}
|
||||
response.Value = responseData;
|
||||
|
||||
return response;
|
||||
}
|
||||
/// <summary>
|
||||
/// Converts a user profile to an XML element which can be returned
|
||||
/// </summary>
|
||||
@@ -113,6 +132,23 @@ namespace OpenSim.Grid.UserServer
|
||||
|
||||
#region XMLRPC User Methods
|
||||
|
||||
public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
List<AvatarPickerAvatar> returnAvatar = new List<AvatarPickerAvatar>();
|
||||
LLUUID queryID = new LLUUID(LLUUID.Zero.ToStringHyphenated());
|
||||
|
||||
if (requestData.Contains("avquery") && requestData.Contains("queryid"))
|
||||
{
|
||||
queryID = new LLUUID((string)requestData["queryid"]);
|
||||
returnAvatar = GenerateAgentPickerRequestResponse(queryID,(string)requestData["avquery"]);
|
||||
}
|
||||
|
||||
Console.WriteLine("[AVATARINFO]: Servicing Avatar Query: " + (string)requestData["avquery"]);
|
||||
return AvatarPickerListtoXmlRPCResponse(queryID,returnAvatar);
|
||||
}
|
||||
|
||||
public XmlRpcResponse XmlRPCGetUserMethodName(XmlRpcRequest request)
|
||||
{
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
|
||||
Reference in New Issue
Block a user