diff options
author | Charles Krinke | 2008-04-16 03:55:21 +0000 |
---|---|---|
committer | Charles Krinke | 2008-04-16 03:55:21 +0000 |
commit | bf7e7b2c57d9b1d7d00f76bbae41093eaf267921 (patch) | |
tree | 31ab1bc76ee105b67225857850fd59073da0d131 /OpenSim/Region/Environment/Scenes | |
parent | * A tweak of the caps system so that new caps have random paths instead of a ... (diff) | |
download | opensim-SC_OLD-bf7e7b2c57d9b1d7d00f76bbae41093eaf267921.zip opensim-SC_OLD-bf7e7b2c57d9b1d7d00f76bbae41093eaf267921.tar.gz opensim-SC_OLD-bf7e7b2c57d9b1d7d00f76bbae41093eaf267921.tar.bz2 opensim-SC_OLD-bf7e7b2c57d9b1d7d00f76bbae41093eaf267921.tar.xz |
Thank you very much, Kmeisthax for:
This patch makes the "Show in Search" checkbox on the viewer work. Additionally, I also discovered that show-in-search objects use the JointWheel flag, so this patch currently uses that flag. LibSL needs to add a flag to enum LLObject.ObjectFlags, "IncludeSearch = 32768" so we aren't using a legacy flag.
Additionally this patch also contains a small fix to BaseHTTPServer that lets the response content-type to be something other than text/html. For some reason this didn't get submitted with the DataSnapshot merge.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/InnerScene.cs | 44 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 2 |
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 | ||