mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 18:55:58 +08:00
take lludp out of usermanagement module
This commit is contained in:
@@ -185,7 +185,7 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
if (p != null && !p.IsDeleted)
|
||||
flags |= 0x10;
|
||||
|
||||
if(!clients.Contains(client) && client.IsActive)
|
||||
if(clients == null)
|
||||
{
|
||||
client.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType, props.FirstLifeText, flags,
|
||||
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
|
||||
@@ -195,17 +195,30 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
if (agentGroups != null)
|
||||
client.SendAvatarGroupsReply(avatarID, agentGroups);
|
||||
}
|
||||
foreach (IClientAPI cli in clients)
|
||||
else
|
||||
{
|
||||
if (!cli.IsActive)
|
||||
continue;
|
||||
cli.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType, props.FirstLifeText, flags,
|
||||
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
|
||||
if (!clients.Contains(client) && client.IsActive)
|
||||
{
|
||||
client.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType, props.FirstLifeText, flags,
|
||||
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
|
||||
|
||||
cli.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText,
|
||||
(uint)props.SkillsMask, props.SkillsText, props.Language);
|
||||
if (agentGroups != null)
|
||||
cli.SendAvatarGroupsReply(avatarID, agentGroups);
|
||||
client.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText,
|
||||
(uint)props.SkillsMask, props.SkillsText, props.Language);
|
||||
if (agentGroups != null)
|
||||
client.SendAvatarGroupsReply(avatarID, agentGroups);
|
||||
}
|
||||
foreach (IClientAPI cli in clients)
|
||||
{
|
||||
if (!cli.IsActive)
|
||||
continue;
|
||||
cli.SendAvatarProperties(props.UserId, props.AboutText, born, membershipType, props.FirstLifeText, flags,
|
||||
props.FirstLifeImageId, props.ImageId, props.WebUrl, props.PartnerId);
|
||||
|
||||
cli.SendAvatarInterestsReply(props.UserId, (uint)props.WantToMask, props.WantToText,
|
||||
(uint)props.SkillsMask, props.SkillsText, props.Language);
|
||||
if (agentGroups != null)
|
||||
cli.SendAvatarGroupsReply(avatarID, agentGroups);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
*/
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
@@ -237,51 +238,8 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
//EventManager.TriggerAvatarPickerRequest();
|
||||
|
||||
m_log.DebugFormat("[USER MANAGEMENT MODULE]: HandleAvatarPickerRequest for {0}", query);
|
||||
|
||||
List<UserData> users = GetUserData(query, 500, 1);
|
||||
|
||||
AvatarPickerReplyPacket replyPacket = (AvatarPickerReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarPickerReply);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
|
||||
AvatarPickerReplyPacket.DataBlock[] searchData =
|
||||
new AvatarPickerReplyPacket.DataBlock[users.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 (UserData item in users)
|
||||
{
|
||||
UUID translatedIDtem = item.Id;
|
||||
searchData[i] = new AvatarPickerReplyPacket.DataBlock();
|
||||
searchData[i].AvatarID = translatedIDtem;
|
||||
searchData[i].FirstName = Utils.StringToBytes((string)item.FirstName);
|
||||
searchData[i].LastName = Utils.StringToBytes((string)item.LastName);
|
||||
i++;
|
||||
}
|
||||
if (users.Count == 0)
|
||||
{
|
||||
searchData = new AvatarPickerReplyPacket.DataBlock[0];
|
||||
}
|
||||
replyPacket.Data = searchData;
|
||||
|
||||
AvatarPickerReplyAgentDataArgs agent_data = new AvatarPickerReplyAgentDataArgs();
|
||||
agent_data.AgentID = replyPacket.AgentData.AgentID;
|
||||
agent_data.QueryID = replyPacket.AgentData.QueryID;
|
||||
|
||||
List<AvatarPickerReplyDataArgs> data_args = new List<AvatarPickerReplyDataArgs>();
|
||||
for (i = 0; i < replyPacket.Data.Length; i++)
|
||||
{
|
||||
AvatarPickerReplyDataArgs data_arg = new AvatarPickerReplyDataArgs();
|
||||
data_arg.AvatarID = replyPacket.Data[i].AvatarID;
|
||||
data_arg.FirstName = replyPacket.Data[i].FirstName;
|
||||
data_arg.LastName = replyPacket.Data[i].LastName;
|
||||
data_args.Add(data_arg);
|
||||
}
|
||||
client.SendAvatarPickerReply(agent_data, data_args);
|
||||
client.SendAvatarPickerReply(RequestID, users);
|
||||
}
|
||||
|
||||
protected virtual void AddAdditionalUsers(string query, List<UserData> users)
|
||||
|
||||
Reference in New Issue
Block a user