aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs44
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
2 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 0838387..ea4283f 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -1236,6 +1236,50 @@ namespace OpenSim.Region.Environment.Scenes
1236 } 1236 }
1237 } 1237 }
1238 1238
1239 public void MakeObjectSearchable(IClientAPI remoteClient, bool IncludeInSearch, uint localID)
1240 {
1241 LLUUID user = remoteClient.AgentId;
1242 LLUUID objid = null;
1243 SceneObjectPart obj = null;
1244
1245 List<EntityBase> EntityList = GetEntities();
1246 foreach (EntityBase ent in EntityList)
1247 {
1248 if (ent is SceneObjectGroup)
1249 {
1250 foreach (KeyValuePair<LLUUID, SceneObjectPart> subent in ((SceneObjectGroup)ent).Children)
1251 {
1252 if (subent.Value.LocalId == localID)
1253 {
1254 objid = subent.Key;
1255 obj = subent.Value;
1256 }
1257 }
1258 }
1259 }
1260
1261 //Protip: In my day, we didn't call them searchable objects, we called them limited point-to-point joints
1262 //aka ObjectFlags.JointWheel = IncludeInSearch
1263
1264 //Permissions model: Object can be REMOVED from search IFF:
1265 // * User owns object
1266 //use CanEditObject
1267
1268 //Object can be ADDED to search IFF:
1269 // * User owns object
1270 // * Asset/DRM permission bit "modify" is enabled
1271 //use CanEditObjectPosition
1272
1273 if (IncludeInSearch && PermissionsMngr.CanEditObject(user, objid))
1274 {
1275 obj.AddFlag(LLObject.ObjectFlags.JointWheel);
1276 }
1277 else if (!IncludeInSearch && PermissionsMngr.CanEditObjectPosition(user, objid))
1278 {
1279 obj.RemFlag(LLObject.ObjectFlags.JointWheel);
1280 }
1281 }
1282
1239 /// <summary> 1283 /// <summary>
1240 /// Duplicate the given object. 1284 /// Duplicate the given object.
1241 /// </summary> 1285 /// </summary>
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 957c75c..464926d 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1578,6 +1578,8 @@ namespace OpenSim.Region.Environment.Scenes
1578 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest; 1578 client.OnAvatarPickerRequest += ProcessAvatarPickerRequest;
1579 client.OnPacketStats += AddPacketStats; 1579 client.OnPacketStats += AddPacketStats;
1580 1580
1581 client.OnObjectIncludeInSearch += m_innerScene.MakeObjectSearchable;
1582
1581 EventManager.TriggerOnNewClient(client); 1583 EventManager.TriggerOnNewClient(client);
1582 } 1584 }
1583 1585