mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
* Added AvatarPicker in Standalone mode. Works for finding avatar to ban, manually trying to add a friend (with the add button) or useful to those who are curious which usernames have visited your standalone sim. Important for future development :D.
* Grid mode always returns 0 results until the Grid Communications portion is done.
This commit is contained in:
@@ -29,6 +29,7 @@ using System.Collections.Generic;
|
||||
using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.UserManagement;
|
||||
using OpenSim.Framework.Console;
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes
|
||||
@@ -155,5 +156,43 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ProcessAvatarPickerRequest(IClientAPI client, LLUUID avatarID, LLUUID RequestID, string query)
|
||||
{
|
||||
//EventManager.TriggerAvatarPickerRequest();
|
||||
|
||||
|
||||
List<AvatarPickerAvatar> AvatarResponses = new List<AvatarPickerAvatar>();
|
||||
AvatarResponses = CommsManager.GenerateAgentPickerRequestResponse(RequestID, query);
|
||||
|
||||
AvatarPickerReplyPacket replyPacket = new AvatarPickerReplyPacket();
|
||||
AvatarPickerReplyPacket.DataBlock[] searchData = new AvatarPickerReplyPacket.DataBlock[AvatarResponses.Count];
|
||||
AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock();
|
||||
|
||||
agentData.AgentID = avatarID;
|
||||
agentData.QueryID = RequestID;
|
||||
replyPacket.AgentData = agentData;
|
||||
byte[] bytes = new byte[AvatarResponses.Count * 32];
|
||||
|
||||
int i = 0;
|
||||
foreach (AvatarPickerAvatar item in AvatarResponses)
|
||||
{
|
||||
LLUUID translatedIDtem = item.AvatarID;
|
||||
searchData[i] = new AvatarPickerReplyPacket.DataBlock();
|
||||
searchData[i].AvatarID = translatedIDtem;
|
||||
searchData[i].FirstName = Helpers.StringToField((string)item.firstName);
|
||||
searchData[i].LastName = Helpers.StringToField((string)item.lastName);
|
||||
i++;
|
||||
|
||||
}
|
||||
if (AvatarResponses.Count == 0)
|
||||
{
|
||||
searchData = new AvatarPickerReplyPacket.DataBlock[0];
|
||||
}
|
||||
replyPacket.Data = searchData;
|
||||
client.SendAvatarPickerReply(replyPacket);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,10 +38,10 @@ using OpenSim.Framework;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Framework.Communications.Cache;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Region.Environment.LandManagement;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Region.Capabilities;
|
||||
using OpenSim.Region.Environment.Interfaces;
|
||||
using OpenSim.Region.Environment.LandManagement;
|
||||
using OpenSim.Region.Environment.Modules;
|
||||
using OpenSim.Region.Environment.Scenes.Scripting;
|
||||
using OpenSim.Region.Environment.Types;
|
||||
@@ -732,7 +732,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
client.OnRemoveTaskItem += RemoveTaskInventory;
|
||||
|
||||
client.OnGrabObject += ProcessObjectGrab;
|
||||
|
||||
client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
|
||||
|
||||
EventManager.TriggerOnNewClient(client);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,11 @@ using libsecondlife;
|
||||
using libsecondlife.Packets;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Framework.Console;
|
||||
using OpenSim.Framework.Communications;
|
||||
using OpenSim.Region.Environment.Types;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
|
||||
|
||||
namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
public partial class ScenePresence : EntityBase
|
||||
@@ -274,6 +276,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
m_controllingClient.OnAgentRequestSit += HandleAgentRequestSit;
|
||||
m_controllingClient.OnAgentSit += HandleAgentSit;
|
||||
m_controllingClient.OnSetAlwaysRun += HandleSetAlwaysRun;
|
||||
|
||||
// ControllingClient.OnStartAnim += new StartAnim(this.SendAnimPack);
|
||||
// ControllingClient.OnChildAgentStatus += new StatusChange(this.ChildStatusChange);
|
||||
//ControllingClient.OnStopMovement += new GenericCall2(this.StopMovement);
|
||||
@@ -1227,5 +1230,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
{
|
||||
m_controllingClient.SendWearables(m_wearables, m_wearablesSerial++);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user