aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs15
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs20
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs35
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs2
-rw-r--r--OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs75
6 files changed, 124 insertions, 40 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index c88142a..aaa331b 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
217 217
218 scene.EventManager.OnNewClient += OnNewClient; 218 scene.EventManager.OnNewClient += OnNewClient;
219 scene.EventManager.OnClientClosed += OnClientClosed; 219 scene.EventManager.OnClientClosed += OnClientClosed;
220// scene.EventManager.OnMakeRootAgent += OnMakeRootAgent; 220 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
221 scene.EventManager.OnClientLogin += OnClientLogin; 221 scene.EventManager.OnClientLogin += OnClientLogin;
222 } 222 }
223 223
@@ -362,18 +362,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
362 m_NeedsListOfOnlineFriends.Add(agentID); 362 m_NeedsListOfOnlineFriends.Add(agentID);
363 } 363 }
364 364
365 public void IsNpwRoot(ScenePresence sp) 365 public void IsNowRoot(ScenePresence sp)
366 { 366 {
367 RecacheFriends(sp.ControllingClient); 367 OnMakeRootAgent(sp);
368
369 lock (m_NeedsToNotifyStatus)
370 {
371 if (m_NeedsToNotifyStatus.Remove(sp.UUID))
372 {
373 // Inform the friends that this user is online. This can only be done once the client is a Root Agent.
374 StatusChange(sp.UUID, true);
375 }
376 }
377 } 368 }
378 369
379 public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client) 370 public virtual bool SendFriendsOnlineIfNeeded(IClientAPI client)
diff --git a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
index b735c61..543410e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Groups/GroupsModule.cs
@@ -182,11 +182,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
182 m_ClientMap.Add(client.AgentId, client); 182 m_ClientMap.Add(client.AgentId, client);
183 } 183 }
184 } 184 }
185
186 GroupMembershipData[] updateGroups = new GroupMembershipData[1];
187 updateGroups[0] = osGroup;
188
189 client.SendGroupMembership(updateGroups);
190 } 185 }
191 186
192 private void OnAgentDataUpdateRequest(IClientAPI remoteClient, 187 private void OnAgentDataUpdateRequest(IClientAPI remoteClient,
@@ -237,6 +232,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Groups
237 remote_client.SendGroupNameReply(groupUUID, groupnamereply); 232 remote_client.SendGroupNameReply(groupUUID, groupnamereply);
238 } 233 }
239 234
235 public GroupMembershipData[] GetMembershipData(UUID agentID)
236 {
237 GroupMembershipData[] updateGroups = new GroupMembershipData[1];
238 updateGroups[0] = osGroup;
239 return updateGroups;
240 }
241
242 public GroupMembershipData GetActiveMembershipData(UUID agentID)
243 {
244 return osGroup;
245 }
246
240 private void OnClientClosed(UUID agentID, Scene scene) 247 private void OnClientClosed(UUID agentID, Scene scene)
241 { 248 {
242 lock (m_ClientMap) 249 lock (m_ClientMap)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index 4119f90..4d7c25b 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -306,9 +306,21 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
306 /// 306 ///
307 /// RezObject 307 /// RezObject
308 /// 308 ///
309 public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, 309 // compatibility do not use
310 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 310 public override SceneObjectGroup RezObject(
311 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 311 IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
312 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
313 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
314 {
315 return RezObject(remoteClient, itemID, UUID.Zero, RayEnd, RayStart,
316 RayTargetID, BypassRayCast, RayEndIsIntersection,
317 RezSelected, RemoveItem, fromTaskID, attachment);
318 }
319
320 public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID,
321 UUID groupID, Vector3 RayEnd, Vector3 RayStart,
322 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
323 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
312 { 324 {
313 m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID); 325 m_log.DebugFormat("[HGScene]: RezObject itemID={0} fromTaskID={1}", itemID, fromTaskID);
314 326
@@ -331,7 +343,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
331 //} 343 //}
332 344
333 // OK, we're done fetching. Pass it up to the default RezObject 345 // OK, we're done fetching. Pass it up to the default RezObject
334 SceneObjectGroup sog = base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 346 SceneObjectGroup sog = base.RezObject(remoteClient, itemID, groupID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
335 RezSelected, RemoveItem, fromTaskID, attachment); 347 RezSelected, RemoveItem, fromTaskID, attachment);
336 348
337 return sog; 349 return sog;
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 8c560e5..00e2670 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -818,12 +818,22 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
818 818
819 return item; 819 return item;
820 } 820 }
821 821 // compatibility do not use
822 public virtual SceneObjectGroup RezObject( 822 public virtual SceneObjectGroup RezObject(
823 IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, 823 IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart,
824 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 824 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
825 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 825 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
826 { 826 {
827 return RezObject(remoteClient, itemID, UUID.Zero, RayEnd, RayStart,
828 RayTargetID, BypassRayCast, RayEndIsIntersection,
829 RezSelected, RemoveItem, fromTaskID, attachment);
830 }
831
832 public virtual SceneObjectGroup RezObject(
833 IClientAPI remoteClient, UUID itemID, UUID rezGroupID, Vector3 RayEnd, Vector3 RayStart,
834 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
835 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
836 {
827// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID); 837// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
828 InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID); 838 InventoryItemBase item = m_Scene.InventoryService.GetItem(remoteClient.AgentId, itemID);
829 839
@@ -835,16 +845,28 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
835 item.Owner = remoteClient.AgentId; 845 item.Owner = remoteClient.AgentId;
836 846
837 return RezObject( 847 return RezObject(
838 remoteClient, item, item.AssetID, 848 remoteClient, item, rezGroupID, item.AssetID,
839 RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, 849 RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection,
840 RezSelected, RemoveItem, fromTaskID, attachment); 850 RezSelected, RemoveItem, fromTaskID, attachment);
841 } 851 }
842 852 // compatility
843 public virtual SceneObjectGroup RezObject( 853 public virtual SceneObjectGroup RezObject(
844 IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart, 854 IClientAPI remoteClient, InventoryItemBase item, UUID assetID, Vector3 RayEnd, Vector3 RayStart,
845 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 855 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
846 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 856 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
847 { 857 {
858 return RezObject(remoteClient, item, UUID.Zero, assetID,
859 RayEnd, RayStart, RayTargetID,
860 BypassRayCast, RayEndIsIntersection,
861 RezSelected, RemoveItem, fromTaskID, attachment);
862 }
863
864 public virtual SceneObjectGroup RezObject(
865 IClientAPI remoteClient, InventoryItemBase item, UUID groupID, UUID assetID,
866 Vector3 RayEnd, Vector3 RayStart, UUID RayTargetID,
867 byte BypassRayCast, bool RayEndIsIntersection,
868 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
869 {
848 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); 870 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
849 871
850 if (rezAsset == null) 872 if (rezAsset == null)
@@ -986,6 +1008,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
986 group.IsAttachment = true; 1008 group.IsAttachment = true;
987 } 1009 }
988 1010
1011 group.SetGroup(groupID, remoteClient);
1012
989 // If we're rezzing an attachment then don't ask 1013 // If we're rezzing an attachment then don't ask
990 // AddNewSceneObject() to update the client since 1014 // AddNewSceneObject() to update the client since
991 // we'll be doing that later on. Scheduling more than 1015 // we'll be doing that later on. Scheduling more than
@@ -995,12 +1019,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
995 m_Scene.AddNewSceneObject(group, true, false); 1019 m_Scene.AddNewSceneObject(group, true, false);
996 1020
997 if (!attachment) 1021 if (!attachment)
1022 {
998 group.AbsolutePosition = pos + veclist[i]; 1023 group.AbsolutePosition = pos + veclist[i];
999 1024
1000 group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
1001
1002 if (!attachment)
1003 {
1004 // Fire on_rez 1025 // Fire on_rez
1005 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1); 1026 group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
1006 rootPart.ParentGroup.ResumeScripts(); 1027 rootPart.ParentGroup.ResumeScripts();
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index 172b864..b31d4df 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
166 166
167 SceneObjectGroup so 167 SceneObjectGroup so
168 = m_iam.RezObject( 168 = m_iam.RezObject(
169 m_tc, item1Id, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false); 169 m_tc, item1Id, UUID.Zero, Vector3.Zero, Vector3.Zero, UUID.Zero, 1, false, false, false, UUID.Zero, false);
170 170
171 Assert.That(so, Is.Not.Null); 171 Assert.That(so, Is.Not.Null);
172 172
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 6f10f51..959829c 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1060,27 +1060,80 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
1060 /// <param name="maxY"></param> 1060 /// <param name="maxY"></param>
1061 public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 1061 public void RequestMapBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
1062 { 1062 {
1063 m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag); 1063// m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag);
1064 1064
1065 GetAndSendBlocks(remoteClient, minX, minY, maxX, maxY, flag); 1065 GetAndSendBlocks(remoteClient, minX, minY, maxX, maxY, flag);
1066 } 1066 }
1067 1067
1068 private const double SPAMBLOCKTIMEms = 300000; // 5 minutes
1069 private Dictionary<UUID,double> spamBlocked = new Dictionary<UUID,double>();
1070
1068 protected virtual List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag) 1071 protected virtual List<MapBlockData> GetAndSendBlocks(IClientAPI remoteClient, int minX, int minY, int maxX, int maxY, uint flag)
1069 { 1072 {
1070 MapBlockRequestData req = new MapBlockRequestData(); 1073 // anti spam because of FireStorm 4.7.7 absurd request repeat rates
1074 // possible others
1071 1075
1072 req.client = remoteClient; 1076 double now = Util.GetTimeStampMS();
1073 req.minX = minX; 1077 UUID agentID = remoteClient.AgentId;
1074 req.maxX = maxX;
1075 req.minY = minY;
1076 req.maxY = maxY;
1077 req.flags = flag;
1078 1078
1079 lock (m_mapBlockRequestEvent) 1079 lock (m_mapBlockRequestEvent)
1080 { 1080 {
1081 if (!m_mapBlockRequests.ContainsKey(remoteClient.AgentId)) 1081 if(spamBlocked.ContainsKey(agentID))
1082 m_mapBlockRequests[remoteClient.AgentId] = new Queue<MapBlockRequestData>(); 1082 {
1083 m_mapBlockRequests[remoteClient.AgentId].Enqueue(req); 1083 if(spamBlocked[agentID] < now &&
1084 (!m_mapBlockRequests.ContainsKey(agentID) ||
1085 m_mapBlockRequests[agentID].Count == 0 ))
1086 {
1087 spamBlocked.Remove(agentID);
1088 m_log.DebugFormat("[WoldMapModule] RequestMapBlocks release spammer {0}", agentID);
1089 }
1090 else
1091 return new List<MapBlockData>();
1092 }
1093 else
1094 {
1095 // ugly slow expire spammers
1096 if(spamBlocked.Count > 0)
1097 {
1098 UUID k = UUID.Zero;
1099 bool expireone = false;
1100 foreach(UUID k2 in spamBlocked.Keys)
1101 {
1102 if(spamBlocked[k2] < now &&
1103 (!m_mapBlockRequests.ContainsKey(k2) ||
1104 m_mapBlockRequests[k2].Count == 0 ))
1105 {
1106 m_log.DebugFormat("[WoldMapModule] RequestMapBlocks release spammer {0}", k2);
1107 k = k2;
1108 expireone = true;
1109 }
1110 break; // doing one at a time
1111 }
1112 if(expireone)
1113 spamBlocked.Remove(k);
1114 }
1115 }
1116
1117// m_log.DebugFormat("[WoldMapModule] RequestMapBlocks {0}={1}={2}={3} {4}", minX, minY, maxX, maxY, flag);
1118
1119 MapBlockRequestData req = new MapBlockRequestData();
1120
1121 req.client = remoteClient;
1122 req.minX = minX;
1123 req.maxX = maxX;
1124 req.minY = minY;
1125 req.maxY = maxY;
1126 req.flags = flag;
1127
1128 if (!m_mapBlockRequests.ContainsKey(agentID))
1129 m_mapBlockRequests[agentID] = new Queue<MapBlockRequestData>();
1130 if(m_mapBlockRequests[agentID].Count < 150 )
1131 m_mapBlockRequests[agentID].Enqueue(req);
1132 else
1133 {
1134 spamBlocked[agentID] = now + SPAMBLOCKTIMEms;
1135 m_log.DebugFormat("[WoldMapModule] RequestMapBlocks blocking spammer {0} for {1} s",agentID, SPAMBLOCKTIMEms/1000.0);
1136 }
1084 m_mapBlockRequestEvent.Set(); 1137 m_mapBlockRequestEvent.Set();
1085 } 1138 }
1086 1139