aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs54
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs23
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs11
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs8
6 files changed, 94 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
index 8f3eb62..a83730e 100644
--- a/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/Environment/Modules/Avatar/Groups/GroupsModule.cs
@@ -44,6 +44,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
44 private Dictionary<LLUUID, GroupList> m_grouplistmap = new Dictionary<LLUUID, GroupList>(); 44 private Dictionary<LLUUID, GroupList> m_grouplistmap = new Dictionary<LLUUID, GroupList>();
45 private Dictionary<LLUUID, GroupData> m_groupmap = new Dictionary<LLUUID, GroupData>(); 45 private Dictionary<LLUUID, GroupData> m_groupmap = new Dictionary<LLUUID, GroupData>();
46 private Dictionary<LLUUID, IClientAPI> m_iclientmap = new Dictionary<LLUUID, IClientAPI>(); 46 private Dictionary<LLUUID, IClientAPI> m_iclientmap = new Dictionary<LLUUID, IClientAPI>();
47 private Dictionary<LLUUID, GroupData> m_groupUUIDGroup = new Dictionary<LLUUID, GroupData>();
48 private LLUUID opensimulatorGroupID = new LLUUID("00000000-68f9-1111-024e-222222111123");
49
47 private List<Scene> m_scene = new List<Scene>(); 50 private List<Scene> m_scene = new List<Scene>();
48 51
49 #region IRegionModule Members 52 #region IRegionModule Members
@@ -57,6 +60,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
57 scene.EventManager.OnNewClient += OnNewClient; 60 scene.EventManager.OnNewClient += OnNewClient;
58 scene.EventManager.OnClientClosed += OnClientClosed; 61 scene.EventManager.OnClientClosed += OnClientClosed;
59 scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage; 62 scene.EventManager.OnGridInstantMessageToGroupsModule += OnGridInstantMessage;
63 lock (m_groupUUIDGroup)
64 {
65
66 GroupData OpenSimulatorGroup = new GroupData();
67 OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester";
68 OpenSimulatorGroup.GroupID = opensimulatorGroupID;
69 OpenSimulatorGroup.groupName = "OpenSimulator Testing";
70 OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.LandAllowSetHome;
71 OpenSimulatorGroup.GroupTitles.Add("OpenSimulator Tester");
72 if (!m_groupUUIDGroup.ContainsKey(opensimulatorGroupID))
73 m_groupUUIDGroup.Add(opensimulatorGroupID, OpenSimulatorGroup);
74 }
60 //scene.EventManager. 75 //scene.EventManager.
61 } 76 }
62 77
@@ -102,6 +117,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
102 // Subscribe to instant messages 117 // Subscribe to instant messages
103 client.OnInstantMessage += OnInstantMessage; 118 client.OnInstantMessage += OnInstantMessage;
104 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 119 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
120 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
105 lock (m_iclientmap) 121 lock (m_iclientmap)
106 { 122 {
107 if (!m_iclientmap.ContainsKey(client.AgentId)) 123 if (!m_iclientmap.ContainsKey(client.AgentId))
@@ -109,13 +125,18 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
109 m_iclientmap.Add(client.AgentId, client); 125 m_iclientmap.Add(client.AgentId, client);
110 } 126 }
111 } 127 }
112 GroupData OpenSimulatorGroup = new GroupData(); 128 GroupData OpenSimulatorGroup = null;
113 OpenSimulatorGroup.ActiveGroupTitle = "OpenSimulator Tester"; 129 lock (m_groupUUIDGroup)
114 OpenSimulatorGroup.GroupID = new LLUUID("00000000-68f9-1111-024e-222222111120"); 130 {
115 OpenSimulatorGroup.GroupMembers.Add(client.AgentId); 131 OpenSimulatorGroup = m_groupUUIDGroup[opensimulatorGroupID];
116 OpenSimulatorGroup.groupName = "OpenSimulator Testing"; 132 if (!OpenSimulatorGroup.GroupMembers.Contains(client.AgentId))
117 OpenSimulatorGroup.ActiveGroupPowers = GroupPowers.LandAllowSetHome; 133 {
118 OpenSimulatorGroup.GroupTitles.Add("OpenSimulator Tester"); 134 OpenSimulatorGroup.GroupMembers.Add(client.AgentId);
135 m_groupUUIDGroup[opensimulatorGroupID] = OpenSimulatorGroup;
136 }
137
138 }
139
119 lock (m_groupmap) 140 lock (m_groupmap)
120 { 141 {
121 if (!m_groupmap.ContainsKey(client.AgentId)) 142 if (!m_groupmap.ContainsKey(client.AgentId))
@@ -124,7 +145,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
124 } 145 }
125 } 146 }
126 GroupList testGroupList = new GroupList(); 147 GroupList testGroupList = new GroupList();
127 testGroupList.m_GroupList.Add(new LLUUID("00000000-68f9-1111-024e-222222111120")); 148 testGroupList.m_GroupList.Add(OpenSimulatorGroup.GroupID);
128 149
129 lock (m_grouplistmap) 150 lock (m_grouplistmap)
130 { 151 {
@@ -133,7 +154,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
133 m_grouplistmap.Add(client.AgentId, testGroupList); 154 m_grouplistmap.Add(client.AgentId, testGroupList);
134 } 155 }
135 } 156 }
136 m_log.Info("[GROUP]: Adding " + client.Name + " to OpenSimulator Tester group"); 157 m_log.Info("[GROUP]: Adding " + client.Name + " to " + OpenSimulatorGroup.groupName + " ");
137 GroupData[] updateGroups = new GroupData[1]; 158 GroupData[] updateGroups = new GroupData[1];
138 updateGroups[0] = OpenSimulatorGroup; 159 updateGroups[0] = OpenSimulatorGroup;
139 160
@@ -201,7 +222,22 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Groups
201 new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID), 222 new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID),
202 msg.binaryBucket); 223 msg.binaryBucket);
203 } 224 }
225 private void HandleUUIDGroupNameRequest(LLUUID id,IClientAPI remote_client)
226 {
227 string groupnamereply = "Unknown";
228 LLUUID groupUUID = LLUUID.Zero;
204 229
230 lock (m_groupUUIDGroup)
231 {
232 if (m_groupUUIDGroup.ContainsKey(id))
233 {
234 GroupData grp = m_groupUUIDGroup[id];
235 groupnamereply = grp.groupName;
236 groupUUID = grp.GroupID;
237 }
238 }
239 remote_client.SendGroupNameReply(groupUUID, groupnamereply);
240 }
205 private void OnClientClosed(LLUUID agentID) 241 private void OnClientClosed(LLUUID agentID)
206 { 242 {
207 lock (m_iclientmap) 243 lock (m_iclientmap)
diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
index 815a505..71ea0e4 100644
--- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs
@@ -236,6 +236,7 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
236 public event RequestAsset OnRequestAsset; 236 public event RequestAsset OnRequestAsset;
237 237
238 public event UUIDNameRequest OnNameFromUUIDRequest; 238 public event UUIDNameRequest OnNameFromUUIDRequest;
239 public event UUIDNameRequest OnUUIDGroupNameRequest;
239 240
240 public event ParcelPropertiesRequest OnParcelPropertiesRequest; 241 public event ParcelPropertiesRequest OnParcelPropertiesRequest;
241 public event ParcelDivideRequest OnParcelDivideRequest; 242 public event ParcelDivideRequest OnParcelDivideRequest;
@@ -270,6 +271,8 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
270 271
271 public event ForceReleaseControls OnForceReleaseControls; 272 public event ForceReleaseControls OnForceReleaseControls;
272 273
274 public event RequestObjectPropertiesFamily OnObjectGroupRequest;
275
273 public event DetailedEstateDataRequest OnDetailedEstateDataRequest; 276 public event DetailedEstateDataRequest OnDetailedEstateDataRequest;
274 public event SetEstateFlagsRequest OnSetEstateFlagsRequest; 277 public event SetEstateFlagsRequest OnSetEstateFlagsRequest;
275 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture; 278 public event SetEstateTerrainBaseTexture OnSetEstateTerrainBaseTexture;
@@ -756,6 +759,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC
756 public void sendLandParcelOverlay(byte[] data, int sequence_id) 759 public void sendLandParcelOverlay(byte[] data, int sequence_id)
757 { 760 {
758 } 761 }
762
763 public void SendGroupNameReply(LLUUID groupLLUID, string GroupName)
764 {
765 }
759 #endregion 766 #endregion
760 } 767 }
761} 768}
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 352fdf9..7a460a2 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -330,7 +330,30 @@ namespace OpenSim.Region.Environment.Scenes
330 330
331 331
332 } 332 }
333 public void HandleObjectGroupUpdate(
334 IClientAPI remoteClient, LLUUID GroupID, uint objectLocalID, LLUUID Garbage)
335 {
336 List<EntityBase> EntityList = GetEntities();
333 337
338 foreach (EntityBase obj in EntityList)
339 {
340 if (obj is SceneObjectGroup)
341 {
342 if (((SceneObjectGroup)obj).LocalId == objectLocalID)
343 {
344 SceneObjectGroup group = (SceneObjectGroup)obj;
345
346 if (m_parentScene.ExternalChecks.ExternalChecksCanEditObject(group.UUID, remoteClient.AgentId))
347 group.SetGroup(GroupID, remoteClient);
348 else
349 remoteClient.SendAgentAlertMessage("You don't have permission to set the group", false);
350
351 }
352 }
353 }
354
355
356 }
334 /// <summary> 357 /// <summary>
335 /// Event Handling routine for Attach Object 358 /// Event Handling routine for Attach Object
336 /// </summary> 359 /// </summary>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index a798f40..d4b85c2 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1651,6 +1651,7 @@ namespace OpenSim.Region.Environment.Scenes
1651 1651
1652 client.OnSetStartLocationRequest += SetHomeRezPoint; 1652 client.OnSetStartLocationRequest += SetHomeRezPoint;
1653 client.OnUndo += m_innerScene.HandleUndo; 1653 client.OnUndo += m_innerScene.HandleUndo;
1654 client.OnObjectGroupRequest += m_innerScene.HandleObjectGroupUpdate;
1654 1655
1655 EventManager.TriggerOnNewClient(client); 1656 EventManager.TriggerOnNewClient(client);
1656 } 1657 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 635a989..44e4c81 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -2510,5 +2510,16 @@ namespace OpenSim.Region.Environment.Scenes
2510 } 2510 }
2511 } 2511 }
2512 } 2512 }
2513 public void SetGroup(LLUUID GroupID, IClientAPI client)
2514 {
2515 lock (m_parts)
2516 {
2517 foreach (SceneObjectPart part in m_parts.Values)
2518 {
2519 part.SetGroup(GroupID, client);
2520 }
2521 }
2522 ScheduleGroupForFullUpdate();
2523 }
2513 } 2524 }
2514} 2525}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index a7b7692..a23083c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -2760,13 +2760,19 @@ namespace OpenSim.Region.Environment.Scenes
2760 public void GetProperties(IClientAPI client) 2760 public void GetProperties(IClientAPI client)
2761 { 2761 {
2762 2762
2763 client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)CreationDate, CreatorID, LLUUID.Zero, LLUUID.Zero, 2763 client.SendObjectPropertiesReply(LLUUID.Zero, (ulong)CreationDate, CreatorID, LLUUID.Zero, GroupID,
2764 LLUUID.Zero, (short)InventorySerial, LastOwnerID, UUID, OwnerID, 2764 LLUUID.Zero, (short)InventorySerial, LastOwnerID, UUID, OwnerID,
2765 ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description, 2765 ParentGroup.RootPart.TouchName, new byte[0], ParentGroup.RootPart.SitName, Name, Description,
2766 ParentGroup.RootPart.OwnerMask, ParentGroup.RootPart.NextOwnerMask, ParentGroup.RootPart.GroupMask, ParentGroup.RootPart.EveryoneMask, 2766 ParentGroup.RootPart.OwnerMask, ParentGroup.RootPart.NextOwnerMask, ParentGroup.RootPart.GroupMask, ParentGroup.RootPart.EveryoneMask,
2767 ParentGroup.RootPart.BaseMask); 2767 ParentGroup.RootPart.BaseMask);
2768 2768
2769 } 2769 }
2770 public void SetGroup(LLUUID groupID, IClientAPI client)
2771 {
2772 GroupID = groupID;
2773 GetProperties(client);
2774 m_updateFlag = 2;
2775 }
2770 2776
2771 } 2777 }
2772} 2778}