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);
bool IsGroupMember(UUID GroupID);
string FirstName { get; }
string LastName { get; }

View File

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

View File

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

View File

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