add a few methods to modify clientview group powers

LSLKeyTest
UbitUmarov 2016-07-01 18:19:09 +01:00
parent 1777324a86
commit aa744eecf2
5 changed files with 108 additions and 24 deletions

View File

@ -1473,6 +1473,9 @@ namespace OpenSim.Framework
void SendAgentDropGroup(UUID groupID); void SendAgentDropGroup(UUID groupID);
void RefreshGroupMembership(); void RefreshGroupMembership();
void UpdateGroupMembership(GroupMembershipData[] data);
void GroupMembershipRemove(UUID GroupID);
void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers);
void SendAvatarNotesReply(UUID targetID, string text); void SendAvatarNotesReply(UUID targetID, string text);
void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks); void SendAvatarPicksReply(UUID targetID, Dictionary<UUID, string> picks);
void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled); void SendPickInfoReply(UUID pickID,UUID creatorID, bool topPick, UUID parcelID, string name, string desc, UUID snapshotID, string user, string originalName, string simName, Vector3 posGlobal, int sortOrder, bool enabled);

View File

@ -2755,10 +2755,15 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendGroupMembership(GroupMembershipData[] GroupMembership) public void SendGroupMembership(GroupMembershipData[] GroupMembership)
{ {
m_groupPowers.Clear();
// maybe removed in future, use SendAgentGroupDataUpdate instead ( but make sure to update groupPowers )
AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
lock(m_groupPowers)
{
m_groupPowers.Clear();
for (int i = 0; i < GroupMembership.Length; i++) for (int i = 0; i < GroupMembership.Length; i++)
{ {
m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers; m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
@ -2771,9 +2776,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName); Group.GroupName = Util.StringToBytes256(GroupMembership[i].GroupName);
Group.GroupPowers = GroupMembership[i].GroupPowers; Group.GroupPowers = GroupMembership[i].GroupPowers;
Groups[i] = Group; Groups[i] = Group;
} }
}
Groupupdate.GroupData = Groups; Groupupdate.GroupData = Groups;
Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock(); Groupupdate.AgentData = new AgentGroupDataUpdatePacket.AgentDataBlock();
Groupupdate.AgentData.AgentID = AgentId; Groupupdate.AgentData.AgentID = AgentId;
@ -5639,9 +5644,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (groupID == ActiveGroupId) if (groupID == ActiveGroupId)
return ActiveGroupPowers; return ActiveGroupPowers;
lock(m_groupPowers)
{
if (m_groupPowers.ContainsKey(groupID)) if (m_groupPowers.ContainsKey(groupID))
return m_groupPowers[groupID]; return m_groupPowers[groupID];
}
return 0; return 0;
} }
@ -12951,6 +12958,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
#endregion #endregion
public void RefreshGroupMembership() public void RefreshGroupMembership()
{
lock(m_groupPowers)
{ {
if (m_GroupsModule != null) if (m_GroupsModule != null)
{ {
@ -12968,6 +12977,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
} }
} }
}
public void UpdateGroupMembership(GroupMembershipData[] data)
{
lock(m_groupPowers)
{
m_groupPowers.Clear();
if (data != null)
{
for (int i = 0; i < data.Length; i++)
m_groupPowers[data[i].GroupID] = data[i].GroupPowers;
}
}
}
public void GroupMembershipRemove(UUID GroupID)
{
lock(m_groupPowers)
{
if(m_groupPowers.ContainsKey(GroupID))
m_groupPowers.Remove(GroupID);
}
}
public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
{
lock(m_groupPowers)
{
m_groupPowers[GroupID] = GroupPowers;
}
}
public string Report() public string Report()
{ {

View File

@ -1626,6 +1626,22 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
} }
public void UpdateGroupMembership(GroupMembershipData[] data)
{
}
public void GroupMembershipRemove(UUID GroupID)
{
}
public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
{
}
public void SendAvatarNotesReply(UUID targetID, string text) public void SendAvatarNotesReply(UUID targetID, string text)
{ {

View File

@ -1255,6 +1255,18 @@ namespace OpenSim.Region.OptionalModules.World.NPC
{ {
} }
public void UpdateGroupMembership(GroupMembershipData[] data)
{
}
public void GroupMembershipRemove(UUID GroupID)
{
}
public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
{
}
public void SendUseCachedMuteList() public void SendUseCachedMuteList()
{ {
} }

View File

@ -1281,6 +1281,18 @@ namespace OpenSim.Tests.Common
{ {
} }
public void UpdateGroupMembership(GroupMembershipData[] data)
{
}
public void GroupMembershipRemove(UUID GroupID)
{
}
public void GroupMembershipAddReplace(UUID GroupID,ulong GroupPowers)
{
}
public void SendUseCachedMuteList() public void SendUseCachedMuteList()
{ {
} }