aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs44
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs2
4 files changed, 66 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index f065bae..dba5b38 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -163,6 +163,7 @@ namespace OpenSim.Region.ClientStack
163 private ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null; 163 private ObjectDuplicateOnRay handlerObjectDuplicateOnRay = null;
164 private ObjectSelect handlerObjectSelect = null; 164 private ObjectSelect handlerObjectSelect = null;
165 private ObjectDeselect handlerObjectDeselect = null; 165 private ObjectDeselect handlerObjectDeselect = null;
166 private ObjectIncludeInSearch handlerObjectIncludeInSearch = null;
166 private UpdatePrimFlags handlerUpdatePrimFlags = null; //OnUpdatePrimFlags; 167 private UpdatePrimFlags handlerUpdatePrimFlags = null; //OnUpdatePrimFlags;
167 private UpdatePrimTexture handlerUpdatePrimTexture = null; 168 private UpdatePrimTexture handlerUpdatePrimTexture = null;
168 private UpdateVector handlerGrabObject = null; //OnGrabObject; 169 private UpdateVector handlerGrabObject = null; //OnGrabObject;
@@ -699,6 +700,7 @@ namespace OpenSim.Region.ClientStack
699 public event ObjectDeselect OnObjectDeselect; 700 public event ObjectDeselect OnObjectDeselect;
700 public event GenericCall7 OnObjectDescription; 701 public event GenericCall7 OnObjectDescription;
701 public event GenericCall7 OnObjectName; 702 public event GenericCall7 OnObjectName;
703 public event ObjectIncludeInSearch OnObjectIncludeInSearch;
702 public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; 704 public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
703 public event UpdatePrimFlags OnUpdatePrimFlags; 705 public event UpdatePrimFlags OnUpdatePrimFlags;
704 public event UpdatePrimTexture OnUpdatePrimTexture; 706 public event UpdatePrimTexture OnUpdatePrimTexture;
@@ -3791,6 +3793,22 @@ namespace OpenSim.Region.ClientStack
3791 } 3793 }
3792 3794
3793 break; 3795 break;
3796 case PacketType.ObjectIncludeInSearch:
3797 //This lets us set objects to appear in search (stuff like DataSnapshot, etc)
3798 ObjectIncludeInSearchPacket packInSearch = (ObjectIncludeInSearchPacket)Pack;
3799 handlerObjectIncludeInSearch = null;
3800
3801 foreach (ObjectIncludeInSearchPacket.ObjectDataBlock objData in packInSearch.ObjectData) {
3802 bool inSearch = objData.IncludeInSearch;
3803 uint localID = objData.ObjectLocalID;
3804
3805 handlerObjectIncludeInSearch = OnObjectIncludeInSearch;
3806
3807 if (handlerObjectIncludeInSearch != null) {
3808 handlerObjectIncludeInSearch(this, inSearch, localID);
3809 }
3810 }
3811 break;
3794 3812
3795 #endregion 3813 #endregion
3796 3814
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
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 23b3015..d5dc937 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -161,6 +161,8 @@ namespace OpenSim.Region.Examples.SimpleModule
161 public event MoneyBalanceRequest OnMoneyBalanceRequest; 161 public event MoneyBalanceRequest OnMoneyBalanceRequest;
162 public event UpdateAvatarProperties OnUpdateAvatarProperties; 162 public event UpdateAvatarProperties OnUpdateAvatarProperties;
163 163
164 public event ObjectIncludeInSearch OnObjectIncludeInSearch;
165
164 166
165#pragma warning restore 67 167#pragma warning restore 67
166 168