First stage group permissions plumbing

0.6.1-post-fixes
Melanie Thielker 2008-11-22 01:58:36 +00:00
parent 691c4bc756
commit c71863d83e
5 changed files with 47 additions and 0 deletions

View File

@ -496,6 +496,8 @@ namespace OpenSim.Framework
ulong GetGroupPowers(UUID groupID); ulong GetGroupPowers(UUID groupID);
bool IsGroupMember(UUID GroupID);
string FirstName { get; } string FirstName { get; }
string LastName { get; } string LastName { get; }

View File

@ -317,8 +317,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
get { return m_activeGroupPowers; } get { return m_activeGroupPowers; }
} }
public bool IsGroupMember(UUID groupID)
{
return m_groupPowers.ContainsKey(groupID);
}
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
if (groupID == m_activeGroupID)
return m_activeGroupPowers;
if (m_groupPowers.ContainsKey(groupID)) if (m_groupPowers.ContainsKey(groupID))
return m_groupPowers[groupID]; return m_groupPowers[groupID];
return 0; return 0;
@ -750,6 +758,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_clientPingTimer.Enabled = true; m_clientPingTimer.Enabled = true;
m_scene.AddNewClient(this, true); m_scene.AddNewClient(this, true);
RefreshGroupMembership();
} }
/// <summary> /// <summary>
@ -7129,10 +7139,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
public void SendGroupMembership(GroupMembershipData[] GroupMembership) public void SendGroupMembership(GroupMembershipData[] GroupMembership)
{ {
m_groupPowers.Clear();
AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
for (int i = 0; i < GroupMembership.Length; i++) for (int i = 0; i < GroupMembership.Length; i++)
{ {
m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
Group.AcceptNotices = GroupMembership[i].AcceptNotices; Group.AcceptNotices = GroupMembership[i].AcceptNotices;
Group.Contribution = GroupMembership[i].Contribution; Group.Contribution = GroupMembership[i].Contribution;
@ -7850,5 +7864,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
} }
#endregion #endregion
private void RefreshGroupMembership()
{
if (m_GroupsModule != null)
{
GroupMembershipData[] GroupMembership =
m_GroupsModule.GetMembershipData(AgentId);
m_groupPowers.Clear();
for (int i = 0; i < GroupMembership.Length; i++)
{
m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
}
}
}
} }
} }

View File

@ -413,6 +413,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
get { return 0; } get { return 0; }
} }
public bool IsGroupMember(UUID groupID)
{
return false;
}
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
return 0; return 0;

View File

@ -301,6 +301,11 @@ namespace OpenSim.Region.Environment.Scenes.Tests
get { return 0; } get { return 0; }
} }
public bool IsGroupMember(UUID groupID)
{
return false;
}
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
return 0; return 0;

View File

@ -311,6 +311,11 @@ namespace OpenSim.Region.Examples.SimpleModule
get { return 0; } get { return 0; }
} }
public bool IsGroupMember(UUID groupID)
{
return false;
}
public ulong GetGroupPowers(UUID groupID) public ulong GetGroupPowers(UUID groupID)
{ {
return 0; return 0;