aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-11-22 01:58:36 +0000
committerMelanie Thielker2008-11-22 01:58:36 +0000
commitc71863d83e07f81ba17f6aeedfc7ee7079c7d762 (patch)
tree119bd4a52ee9b99866eb80550b48713198036c78
parentMantis #2442 (diff)
downloadopensim-SC_OLD-c71863d83e07f81ba17f6aeedfc7ee7079c7d762.zip
opensim-SC_OLD-c71863d83e07f81ba17f6aeedfc7ee7079c7d762.tar.gz
opensim-SC_OLD-c71863d83e07f81ba17f6aeedfc7ee7079c7d762.tar.bz2
opensim-SC_OLD-c71863d83e07f81ba17f6aeedfc7ee7079c7d762.tar.xz
First stage group permissions plumbing
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs30
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs5
-rw-r--r--OpenSim/Region/Environment/Scenes/Tests/TestClient.cs5
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs5
5 files changed, 47 insertions, 0 deletions
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index b32c7f6..8d9cdaa 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -496,6 +496,8 @@ namespace OpenSim.Framework
496 496
497 ulong GetGroupPowers(UUID groupID); 497 ulong GetGroupPowers(UUID groupID);
498 498
499 bool IsGroupMember(UUID GroupID);
500
499 string FirstName { get; } 501 string FirstName { get; }
500 502
501 string LastName { get; } 503 string LastName { get; }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index a897aa2..0b905df 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -317,8 +317,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
317 get { return m_activeGroupPowers; } 317 get { return m_activeGroupPowers; }
318 } 318 }
319 319
320 public bool IsGroupMember(UUID groupID)
321 {
322 return m_groupPowers.ContainsKey(groupID);
323 }
324
320 public ulong GetGroupPowers(UUID groupID) 325 public ulong GetGroupPowers(UUID groupID)
321 { 326 {
327 if (groupID == m_activeGroupID)
328 return m_activeGroupPowers;
329
322 if (m_groupPowers.ContainsKey(groupID)) 330 if (m_groupPowers.ContainsKey(groupID))
323 return m_groupPowers[groupID]; 331 return m_groupPowers[groupID];
324 return 0; 332 return 0;
@@ -750,6 +758,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
750 m_clientPingTimer.Enabled = true; 758 m_clientPingTimer.Enabled = true;
751 759
752 m_scene.AddNewClient(this, true); 760 m_scene.AddNewClient(this, true);
761
762 RefreshGroupMembership();
753 } 763 }
754 764
755 /// <summary> 765 /// <summary>
@@ -7129,10 +7139,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7129 7139
7130 public void SendGroupMembership(GroupMembershipData[] GroupMembership) 7140 public void SendGroupMembership(GroupMembershipData[] GroupMembership)
7131 { 7141 {
7142 m_groupPowers.Clear();
7143
7132 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket(); 7144 AgentGroupDataUpdatePacket Groupupdate = new AgentGroupDataUpdatePacket();
7133 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length]; 7145 AgentGroupDataUpdatePacket.GroupDataBlock[] Groups = new AgentGroupDataUpdatePacket.GroupDataBlock[GroupMembership.Length];
7134 for (int i = 0; i < GroupMembership.Length; i++) 7146 for (int i = 0; i < GroupMembership.Length; i++)
7135 { 7147 {
7148 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
7149
7136 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock(); 7150 AgentGroupDataUpdatePacket.GroupDataBlock Group = new AgentGroupDataUpdatePacket.GroupDataBlock();
7137 Group.AcceptNotices = GroupMembership[i].AcceptNotices; 7151 Group.AcceptNotices = GroupMembership[i].AcceptNotices;
7138 Group.Contribution = GroupMembership[i].Contribution; 7152 Group.Contribution = GroupMembership[i].Contribution;
@@ -7850,5 +7864,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7850 } 7864 }
7851 7865
7852 #endregion 7866 #endregion
7867
7868 private void RefreshGroupMembership()
7869 {
7870 if (m_GroupsModule != null)
7871 {
7872 GroupMembershipData[] GroupMembership =
7873 m_GroupsModule.GetMembershipData(AgentId);
7874
7875 m_groupPowers.Clear();
7876
7877 for (int i = 0; i < GroupMembership.Length; i++)
7878 {
7879 m_groupPowers[GroupMembership[i].GroupID] = GroupMembership[i].GroupPowers;
7880 }
7881 }
7882 }
7853 } 7883 }
7854} 7884}
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index f243987..0a27086 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -413,6 +413,11 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
413 get { return 0; } 413 get { return 0; }
414 } 414 }
415 415
416 public bool IsGroupMember(UUID groupID)
417 {
418 return false;
419 }
420
416 public ulong GetGroupPowers(UUID groupID) 421 public ulong GetGroupPowers(UUID groupID)
417 { 422 {
418 return 0; 423 return 0;
diff --git a/OpenSim/Region/Environment/Scenes/Tests/TestClient.cs b/OpenSim/Region/Environment/Scenes/Tests/TestClient.cs
index 15c6ad1..392a53b 100644
--- a/OpenSim/Region/Environment/Scenes/Tests/TestClient.cs
+++ b/OpenSim/Region/Environment/Scenes/Tests/TestClient.cs
@@ -301,6 +301,11 @@ namespace OpenSim.Region.Environment.Scenes.Tests
301 get { return 0; } 301 get { return 0; }
302 } 302 }
303 303
304 public bool IsGroupMember(UUID groupID)
305 {
306 return false;
307 }
308
304 public ulong GetGroupPowers(UUID groupID) 309 public ulong GetGroupPowers(UUID groupID)
305 { 310 {
306 return 0; 311 return 0;
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index e05ccd1..b5ab1ac 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -311,6 +311,11 @@ namespace OpenSim.Region.Examples.SimpleModule
311 get { return 0; } 311 get { return 0; }
312 } 312 }
313 313
314 public bool IsGroupMember(UUID groupID)
315 {
316 return false;
317 }
318
314 public ulong GetGroupPowers(UUID groupID) 319 public ulong GetGroupPowers(UUID groupID)
315 { 320 {
316 return 0; 321 return 0;