Restored sending group membership data via EventQueue -- this had been a regression. Took the opportunity to refactor that code, so that both Groups V2 and XmlRpcGroups can use the same function.

LSLKeyTest
Diva Canto 2016-06-19 16:27:12 -07:00
parent d51fe01ed8
commit 76ab1ed10c
6 changed files with 66 additions and 3 deletions

View File

@ -1245,7 +1245,8 @@ namespace OpenSim.Groups
SendDataUpdate(remoteClient, tellOthers); SendDataUpdate(remoteClient, tellOthers);
GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
eq.GroupMembershipData(GetRequestingAgentID(remoteClient), membershipArray);
remoteClient.RefreshGroupMembership(); remoteClient.RefreshGroupMembership();
} }

View File

@ -585,6 +585,12 @@ namespace OpenSim.Region.ClientStack.Linden
Enqueue(item, avatarID); Enqueue(item, avatarID);
} }
public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
{
OSD item = EventQueueHelper.GroupMembershipData(receiverAgent, data);
Enqueue(item, receiverAgent);
}
public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID) public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID)
{ {
OSD item = EventQueueHelper.PlacesQuery(groupUpdate); OSD item = EventQueueHelper.PlacesQuery(groupUpdate);

View File

@ -32,6 +32,8 @@ using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenMetaverse.Messages.Linden; using OpenMetaverse.Messages.Linden;
using OpenSim.Framework;
namespace OpenSim.Region.ClientStack.Linden namespace OpenSim.Region.ClientStack.Linden
{ {
public class EventQueueHelper public class EventQueueHelper
@ -364,7 +366,53 @@ namespace OpenSim.Region.ClientStack.Linden
return groupUpdate; return groupUpdate;
} }
public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
{
OSDArray AgentData = new OSDArray(1);
OSDMap AgentDataMap = new OSDMap(1);
AgentDataMap.Add("AgentID", OSD.FromUUID(receiverAgent));
AgentData.Add(AgentDataMap);
OSDArray GroupData = new OSDArray(data.Length);
OSDArray NewGroupData = new OSDArray(data.Length);
foreach (GroupMembershipData membership in data)
{
//if (receiverAgent != dataForAgentID)
//{
// if (!membership.ListInProfile)
// {
// // If we're sending group info to remoteclient about another agent,
// // filter out groups the other agent doesn't want to share.
// continue;
// }
//}
OSDMap GroupDataMap = new OSDMap(6);
OSDMap NewGroupDataMap = new OSDMap(1);
GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID));
GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers));
GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices));
GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture));
GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution));
GroupDataMap.Add("GroupName", OSD.FromString(membership.GroupName));
NewGroupDataMap.Add("ListInProfile", OSD.FromBoolean(membership.ListInProfile));
GroupData.Add(GroupDataMap);
NewGroupData.Add(NewGroupDataMap);
}
OSDMap llDataStruct = new OSDMap(3);
llDataStruct.Add("AgentData", AgentData);
llDataStruct.Add("GroupData", GroupData);
llDataStruct.Add("NewGroupData", NewGroupData);
return BuildEvent("AgentGroupDataUpdate", llDataStruct);
}
public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) public static OSD PlacesQuery(PlacesReplyPacket PlacesReply)
{ {
OSDMap placesReply = new OSDMap(); OSDMap placesReply = new OSDMap();

View File

@ -30,6 +30,7 @@ using OpenMetaverse;
using OpenMetaverse.Packets; using OpenMetaverse.Packets;
using OpenMetaverse.Messages.Linden; using OpenMetaverse.Messages.Linden;
using OpenMetaverse.StructuredData; using OpenMetaverse.StructuredData;
using OpenSim.Framework;
namespace OpenSim.Region.Framework.Interfaces namespace OpenSim.Region.Framework.Interfaces
{ {
@ -58,6 +59,7 @@ namespace OpenSim.Region.Framework.Interfaces
bool isModerator, bool textMute); bool isModerator, bool textMute);
void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID);
void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID);
void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data);
OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono);
OSD BuildEvent(string eventName, OSD eventBody); OSD BuildEvent(string eventName, OSD eventBody);
void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID); void partPhysicsProperties(uint localID, byte physhapetype, float density, float friction, float bounce, float gravmod, UUID avatarID);

View File

@ -1372,7 +1372,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
SendDataUpdate(remoteClient, tellOthers); SendDataUpdate(remoteClient, tellOthers);
GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID); GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray); IEventQueue eq = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
eq.GroupMembershipData(GetRequestingAgentID(remoteClient), membershipArray);
remoteClient.RefreshGroupMembership(); remoteClient.RefreshGroupMembership();
} }

View File

@ -162,6 +162,11 @@ namespace OpenSim.Tests.Common
AddEvent(avatarID, "GroupMembership", groupUpdate); AddEvent(avatarID, "GroupMembership", groupUpdate);
} }
public void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data)
{
AddEvent(receiverAgent, "AgentGroupDataUpdate", data);
}
public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono) public OSD ScriptRunningEvent (UUID objectID, UUID itemID, bool running, bool mono)
{ {
Console.WriteLine("ONE"); Console.WriteLine("ONE");