diff options
Diffstat (limited to '')
6 files changed, 157 insertions, 142 deletions
diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index d91c36c..c8fb9da 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs | |||
@@ -91,6 +91,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
91 | if (part.ParentGroup.IsDeleted) | 91 | if (part.ParentGroup.IsDeleted) |
92 | return; | 92 | return; |
93 | 93 | ||
94 | if (part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId))) | ||
95 | return; | ||
96 | |||
94 | part = part.ParentGroup.RootPart; | 97 | part = part.ParentGroup.RootPart; |
95 | 98 | ||
96 | part.ObjectSaleType = saleType; | 99 | part.ObjectSaleType = saleType; |
@@ -258,4 +261,4 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell | |||
258 | return true; | 261 | return true; |
259 | } | 262 | } |
260 | } | 263 | } |
261 | } \ No newline at end of file | 264 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index c94a873..a9502ed 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1748,7 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1748 | 1748 | ||
1749 | part.PhysActor | 1749 | part.PhysActor |
1750 | = m_scene.PhysicsScene.AddPrimShape( | 1750 | = m_scene.PhysicsScene.AddPrimShape( |
1751 | part.Name, | 1751 | string.Format("{0}/{1}", part.Name, part.UUID), |
1752 | pbs, | 1752 | pbs, |
1753 | part.AbsolutePosition, | 1753 | part.AbsolutePosition, |
1754 | part.Scale, | 1754 | part.Scale, |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 40112c9..9bb961d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1560,7 +1560,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1560 | try | 1560 | try |
1561 | { | 1561 | { |
1562 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 1562 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( |
1563 | Name, | 1563 | string.Format("{0}/{1}", Name, UUID), |
1564 | Shape, | 1564 | Shape, |
1565 | AbsolutePosition, | 1565 | AbsolutePosition, |
1566 | Scale, | 1566 | Scale, |
@@ -4396,7 +4396,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4396 | { | 4396 | { |
4397 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it | 4397 | // It's not phantom anymore. So make sure the physics engine get's knowledge of it |
4398 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( | 4398 | PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape( |
4399 | Name, | 4399 | string.Format("{0}/{1}", Name, UUID), |
4400 | Shape, | 4400 | Shape, |
4401 | AbsolutePosition, | 4401 | AbsolutePosition, |
4402 | Scale, | 4402 | Scale, |
diff --git a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs index 65baa52..aee2d10 100644 --- a/OpenSim/Region/Framework/Scenes/UuidGatherer.cs +++ b/OpenSim/Region/Framework/Scenes/UuidGatherer.cs | |||
@@ -291,9 +291,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
291 | } | 291 | } |
292 | } | 292 | } |
293 | 293 | ||
294 | /// <summary> | ||
295 | /// Get the asset uuid associated with a gesture | ||
296 | /// </summary> | ||
297 | /// <param name="gestureUuid"></param> | ||
298 | /// <param name="assetUuids"></param> | ||
294 | protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary<UUID, AssetType> assetUuids) | 299 | protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary<UUID, AssetType> assetUuids) |
295 | { | 300 | { |
296 | AssetBase assetBase = GetAsset(gestureUuid); | 301 | AssetBase assetBase = GetAsset(gestureUuid); |
302 | if (null == assetBase) | ||
303 | return; | ||
297 | 304 | ||
298 | MemoryStream ms = new MemoryStream(assetBase.Data); | 305 | MemoryStream ms = new MemoryStream(assetBase.Data); |
299 | StreamReader sr = new StreamReader(ms); | 306 | StreamReader sr = new StreamReader(ms); |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 2e39726..daf7fb0 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -170,7 +170,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
170 | private bool m_lastUpdateSent; | 170 | private bool m_lastUpdateSent; |
171 | 171 | ||
172 | public IntPtr Body = IntPtr.Zero; | 172 | public IntPtr Body = IntPtr.Zero; |
173 | public String m_primName; | 173 | public String Name { get; private set; } |
174 | private Vector3 _target_velocity; | 174 | private Vector3 _target_velocity; |
175 | public d.Mass pMass; | 175 | public d.Mass pMass; |
176 | 176 | ||
@@ -188,6 +188,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
188 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, | 188 | public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, |
189 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) | 189 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode) |
190 | { | 190 | { |
191 | Name = primName; | ||
191 | m_vehicle = new ODEDynamics(); | 192 | m_vehicle = new ODEDynamics(); |
192 | //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); | 193 | //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); |
193 | ode = dode; | 194 | ode = dode; |
@@ -195,7 +196,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
195 | { | 196 | { |
196 | pos = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), | 197 | pos = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f), |
197 | parent_scene.GetTerrainHeightAtXY(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f)) + 0.5f); | 198 | parent_scene.GetTerrainHeightAtXY(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f)) + 0.5f); |
198 | m_log.Warn("[PHYSICS]: Got nonFinite Object create Position"); | 199 | m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Position for {0}", Name); |
199 | } | 200 | } |
200 | _position = pos; | 201 | _position = pos; |
201 | m_taintposition = pos; | 202 | m_taintposition = pos; |
@@ -212,7 +213,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
212 | if (!pos.IsFinite()) | 213 | if (!pos.IsFinite()) |
213 | { | 214 | { |
214 | size = new Vector3(0.5f, 0.5f, 0.5f); | 215 | size = new Vector3(0.5f, 0.5f, 0.5f); |
215 | m_log.Warn("[PHYSICS]: Got nonFinite Object create Size"); | 216 | m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Size for {0}", Name); |
216 | } | 217 | } |
217 | 218 | ||
218 | if (size.X <= 0) size.X = 0.01f; | 219 | if (size.X <= 0) size.X = 0.01f; |
@@ -225,7 +226,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
225 | if (!QuaternionIsFinite(rotation)) | 226 | if (!QuaternionIsFinite(rotation)) |
226 | { | 227 | { |
227 | rotation = Quaternion.Identity; | 228 | rotation = Quaternion.Identity; |
228 | m_log.Warn("[PHYSICS]: Got nonFinite Object create Rotation"); | 229 | m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Rotation for {0}", Name); |
229 | } | 230 | } |
230 | 231 | ||
231 | _orientation = rotation; | 232 | _orientation = rotation; |
@@ -246,7 +247,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
246 | if (m_isphysical) | 247 | if (m_isphysical) |
247 | m_targetSpace = _parent_scene.space; | 248 | m_targetSpace = _parent_scene.space; |
248 | } | 249 | } |
249 | m_primName = primName; | 250 | |
250 | m_taintadd = true; | 251 | m_taintadd = true; |
251 | _parent_scene.AddPhysicsActorTaint(this); | 252 | _parent_scene.AddPhysicsActorTaint(this); |
252 | // don't do .add() here; old geoms get recycled with the same hash | 253 | // don't do .add() here; old geoms get recycled with the same hash |
@@ -304,7 +305,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
304 | { | 305 | { |
305 | prev_geom = prim_geom; | 306 | prev_geom = prim_geom; |
306 | prim_geom = geom; | 307 | prim_geom = geom; |
307 | //Console.WriteLine("SetGeom to " + prim_geom + " for " + m_primName); | 308 | //Console.WriteLine("SetGeom to " + prim_geom + " for " + Name); |
308 | if (prim_geom != IntPtr.Zero) | 309 | if (prim_geom != IntPtr.Zero) |
309 | { | 310 | { |
310 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 311 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
@@ -857,7 +858,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
857 | } | 858 | } |
858 | catch (AccessViolationException) | 859 | catch (AccessViolationException) |
859 | { | 860 | { |
860 | m_log.Error("[PHYSICS]: MESH LOCKED"); | 861 | m_log.ErrorFormat("[PHYSICS]: MESH LOCKED FOR {0}", Name); |
861 | return; | 862 | return; |
862 | } | 863 | } |
863 | 864 | ||
@@ -874,7 +875,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
874 | 875 | ||
875 | public void ProcessTaints(float timestep) | 876 | public void ProcessTaints(float timestep) |
876 | { | 877 | { |
877 | //Console.WriteLine("ProcessTaints for " + m_primName); | 878 | //Console.WriteLine("ProcessTaints for " + Name); |
878 | if (m_taintadd) | 879 | if (m_taintadd) |
879 | { | 880 | { |
880 | changeadd(timestep); | 881 | changeadd(timestep); |
@@ -945,7 +946,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
945 | } | 946 | } |
946 | else | 947 | else |
947 | { | 948 | { |
948 | m_log.Error("[PHYSICS]: The scene reused a disposed PhysActor! *waves finger*, Don't be evil. A couple of things can cause this. An improper prim breakdown(be sure to set prim_geom to zero after d.GeomDestroy! An improper buildup (creating the geom failed). Or, the Scene Reused a physics actor after disposing it.)"); | 949 | m_log.ErrorFormat("[PHYSICS]: The scene reused a disposed PhysActor for {0}! *waves finger*, Don't be evil. A couple of things can cause this. An improper prim breakdown(be sure to set prim_geom to zero after d.GeomDestroy! An improper buildup (creating the geom failed). Or, the Scene Reused a physics actor after disposing it.)", Name); |
949 | } | 950 | } |
950 | } | 951 | } |
951 | 952 | ||
@@ -1035,7 +1036,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1035 | // prim is the child | 1036 | // prim is the child |
1036 | public void ParentPrim(OdePrim prim) | 1037 | public void ParentPrim(OdePrim prim) |
1037 | { | 1038 | { |
1038 | //Console.WriteLine("ParentPrim " + m_primName); | 1039 | //Console.WriteLine("ParentPrim " + Name); |
1039 | if (this.m_localID != prim.m_localID) | 1040 | if (this.m_localID != prim.m_localID) |
1040 | { | 1041 | { |
1041 | if (Body == IntPtr.Zero) | 1042 | if (Body == IntPtr.Zero) |
@@ -1071,18 +1072,20 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1071 | d.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z); | 1072 | d.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z); |
1072 | d.MassAdd(ref pMass, ref m2); | 1073 | d.MassAdd(ref pMass, ref m2); |
1073 | } | 1074 | } |
1075 | |||
1074 | foreach (OdePrim prm in childrenPrim) | 1076 | foreach (OdePrim prm in childrenPrim) |
1075 | { | 1077 | { |
1076 | |||
1077 | prm.m_collisionCategories |= CollisionCategories.Body; | 1078 | prm.m_collisionCategories |= CollisionCategories.Body; |
1078 | prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); | 1079 | prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); |
1079 | 1080 | ||
1080 | if (prm.prim_geom == IntPtr.Zero) | 1081 | if (prm.prim_geom == IntPtr.Zero) |
1081 | { | 1082 | { |
1082 | m_log.Warn("[PHYSICS]: Unable to link one of the linkset elements. No geom yet"); | 1083 | m_log.WarnFormat( |
1084 | "[PHYSICS]: Unable to link one of the linkset elements {0} for parent {1}. No geom yet", | ||
1085 | prm.Name, prim.Name); | ||
1083 | continue; | 1086 | continue; |
1084 | } | 1087 | } |
1085 | //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + m_primName); | 1088 | //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); |
1086 | d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); | 1089 | d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); |
1087 | d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); | 1090 | d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); |
1088 | 1091 | ||
@@ -1111,7 +1114,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1111 | } | 1114 | } |
1112 | else | 1115 | else |
1113 | { | 1116 | { |
1114 | m_log.Debug("[PHYSICS]:I ain't got no boooooooooddy, no body"); | 1117 | m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name); |
1115 | } | 1118 | } |
1116 | 1119 | ||
1117 | 1120 | ||
@@ -1130,7 +1133,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1130 | m_collisionCategories |= CollisionCategories.Body; | 1133 | m_collisionCategories |= CollisionCategories.Body; |
1131 | m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); | 1134 | m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); |
1132 | 1135 | ||
1133 | //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + m_primName); | 1136 | //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); |
1134 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 1137 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
1135 | //Console.WriteLine(" Post GeomSetCategoryBits 2"); | 1138 | //Console.WriteLine(" Post GeomSetCategoryBits 2"); |
1136 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); | 1139 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); |
@@ -1373,7 +1376,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1373 | } | 1376 | } |
1374 | catch (AccessViolationException) | 1377 | catch (AccessViolationException) |
1375 | { | 1378 | { |
1376 | m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); | 1379 | m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); |
1377 | ode.dunlock(_parent_scene.world); | 1380 | ode.dunlock(_parent_scene.world); |
1378 | return; | 1381 | return; |
1379 | } | 1382 | } |
@@ -1388,7 +1391,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1388 | } | 1391 | } |
1389 | catch (AccessViolationException) | 1392 | catch (AccessViolationException) |
1390 | { | 1393 | { |
1391 | m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); | 1394 | m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); |
1392 | ode.dunlock(_parent_scene.world); | 1395 | ode.dunlock(_parent_scene.world); |
1393 | return; | 1396 | return; |
1394 | } | 1397 | } |
@@ -1404,7 +1407,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1404 | } | 1407 | } |
1405 | catch (AccessViolationException) | 1408 | catch (AccessViolationException) |
1406 | { | 1409 | { |
1407 | m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); | 1410 | m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); |
1408 | ode.dunlock(_parent_scene.world); | 1411 | ode.dunlock(_parent_scene.world); |
1409 | return; | 1412 | return; |
1410 | } | 1413 | } |
@@ -1421,7 +1424,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1421 | } | 1424 | } |
1422 | catch (AccessViolationException) | 1425 | catch (AccessViolationException) |
1423 | { | 1426 | { |
1424 | m_log.Warn("[PHYSICS]: Unable to create physics proxy for object"); | 1427 | m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name); |
1425 | ode.dunlock(_parent_scene.world); | 1428 | ode.dunlock(_parent_scene.world); |
1426 | return; | 1429 | return; |
1427 | } | 1430 | } |
@@ -1444,7 +1447,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1444 | if (_parent_scene.needsMeshing(_pbs)) | 1447 | if (_parent_scene.needsMeshing(_pbs)) |
1445 | { | 1448 | { |
1446 | // Don't need to re-enable body.. it's done in SetMesh | 1449 | // Don't need to re-enable body.. it's done in SetMesh |
1447 | _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); | 1450 | _mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); |
1448 | // createmesh returns null when it's a shape that isn't a cube. | 1451 | // createmesh returns null when it's a shape that isn't a cube. |
1449 | // m_log.Debug(m_localID); | 1452 | // m_log.Debug(m_localID); |
1450 | } | 1453 | } |
@@ -1473,7 +1476,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1473 | } | 1476 | } |
1474 | } | 1477 | } |
1475 | 1478 | ||
1476 | _parent_scene.geom_name_map[prim_geom] = this.m_primName; | 1479 | _parent_scene.geom_name_map[prim_geom] = this.Name; |
1477 | _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this; | 1480 | _parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this; |
1478 | 1481 | ||
1479 | changeSelectedStatus(timestep); | 1482 | changeSelectedStatus(timestep); |
@@ -1524,7 +1527,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1524 | } | 1527 | } |
1525 | else | 1528 | else |
1526 | { | 1529 | { |
1527 | m_log.Warn("[PHYSICS]: Body Still null after enableBody(). This is a crash scenario."); | 1530 | m_log.WarnFormat("[PHYSICS]: Body for {0} still null after enableBody(). This is a crash scenario.", Name); |
1528 | } | 1531 | } |
1529 | } | 1532 | } |
1530 | //else | 1533 | //else |
@@ -1573,7 +1576,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1573 | } | 1576 | } |
1574 | else | 1577 | else |
1575 | { | 1578 | { |
1576 | //Console.WriteLine("Move " + m_primName); | 1579 | //Console.WriteLine("Move " + Name); |
1577 | if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 | 1580 | if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 |
1578 | // NON-'VEHICLES' are dealt with here | 1581 | // NON-'VEHICLES' are dealt with here |
1579 | // if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) | 1582 | // if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) |
@@ -1605,7 +1608,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1605 | 1608 | ||
1606 | if (m_usePID) | 1609 | if (m_usePID) |
1607 | { | 1610 | { |
1608 | //Console.WriteLine("PID " + m_primName); | 1611 | //Console.WriteLine("PID " + Name); |
1609 | // KF - this is for object move? eg. llSetPos() ? | 1612 | // KF - this is for object move? eg. llSetPos() ? |
1610 | //if (!d.BodyIsEnabled(Body)) | 1613 | //if (!d.BodyIsEnabled(Body)) |
1611 | //d.BodySetForce(Body, 0f, 0f, 0f); | 1614 | //d.BodySetForce(Body, 0f, 0f, 0f); |
@@ -1677,7 +1680,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1677 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller | 1680 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller |
1678 | if (m_useHoverPID && !m_usePID) | 1681 | if (m_useHoverPID && !m_usePID) |
1679 | { | 1682 | { |
1680 | //Console.WriteLine("Hover " + m_primName); | 1683 | //Console.WriteLine("Hover " + Name); |
1681 | 1684 | ||
1682 | // If we're using the PID controller, then we have no gravity | 1685 | // If we're using the PID controller, then we have no gravity |
1683 | fz = (-1 * _parent_scene.gravityz) * m_mass; | 1686 | fz = (-1 * _parent_scene.gravityz) * m_mass; |
@@ -1803,7 +1806,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1803 | { // is not physical, or is not a body or is selected | 1806 | { // is not physical, or is not a body or is selected |
1804 | // _zeroPosition = d.BodyGetPosition(Body); | 1807 | // _zeroPosition = d.BodyGetPosition(Body); |
1805 | return; | 1808 | return; |
1806 | //Console.WriteLine("Nothing " + m_primName); | 1809 | //Console.WriteLine("Nothing " + Name); |
1807 | 1810 | ||
1808 | } | 1811 | } |
1809 | } | 1812 | } |
@@ -1891,10 +1894,10 @@ Console.WriteLine(" JointCreateFixed"); | |||
1891 | catch (System.AccessViolationException) | 1894 | catch (System.AccessViolationException) |
1892 | { | 1895 | { |
1893 | prim_geom = IntPtr.Zero; | 1896 | prim_geom = IntPtr.Zero; |
1894 | m_log.Error("[PHYSICS]: PrimGeom dead"); | 1897 | m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name); |
1895 | } | 1898 | } |
1896 | } | 1899 | } |
1897 | //Console.WriteLine("changePhysicsStatus for " + m_primName); | 1900 | //Console.WriteLine("changePhysicsStatus for " + Name); |
1898 | changeadd(2f); | 1901 | changeadd(2f); |
1899 | } | 1902 | } |
1900 | if (childPrim) | 1903 | if (childPrim) |
@@ -2063,7 +2066,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2063 | catch (System.AccessViolationException) | 2066 | catch (System.AccessViolationException) |
2064 | { | 2067 | { |
2065 | prim_geom = IntPtr.Zero; | 2068 | prim_geom = IntPtr.Zero; |
2066 | m_log.Error("[PHYSICS]: PrimGeom dead"); | 2069 | m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name); |
2067 | } | 2070 | } |
2068 | prim_geom = IntPtr.Zero; | 2071 | prim_geom = IntPtr.Zero; |
2069 | // we don't need to do space calculation because the client sends a position update also. | 2072 | // we don't need to do space calculation because the client sends a position update also. |
@@ -2307,7 +2310,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2307 | } | 2310 | } |
2308 | else | 2311 | else |
2309 | { | 2312 | { |
2310 | m_log.Warn("[PHYSICS]: Got NaN Size on object"); | 2313 | m_log.WarnFormat("[PHYSICS]: Got NaN Size on object {0}", Name); |
2311 | } | 2314 | } |
2312 | } | 2315 | } |
2313 | } | 2316 | } |
@@ -2329,7 +2332,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2329 | } | 2332 | } |
2330 | else | 2333 | else |
2331 | { | 2334 | { |
2332 | m_log.Warn("[PHYSICS]: NaN in Force Applied to an Object"); | 2335 | m_log.WarnFormat("[PHYSICS]: NaN in Force Applied to an Object {0}", Name); |
2333 | } | 2336 | } |
2334 | } | 2337 | } |
2335 | } | 2338 | } |
@@ -2413,7 +2416,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2413 | } | 2416 | } |
2414 | else | 2417 | else |
2415 | { | 2418 | { |
2416 | m_log.Warn("[PHYSICS]: Got NaN Velocity in Object"); | 2419 | m_log.WarnFormat("[PHYSICS]: Got NaN Velocity in Object {0}", Name); |
2417 | } | 2420 | } |
2418 | 2421 | ||
2419 | } | 2422 | } |
@@ -2438,7 +2441,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2438 | } | 2441 | } |
2439 | else | 2442 | else |
2440 | { | 2443 | { |
2441 | m_log.Warn("[PHYSICS]: Got NaN Torque in Object"); | 2444 | m_log.WarnFormat("[PHYSICS]: Got NaN Torque in Object {0}", Name); |
2442 | } | 2445 | } |
2443 | } | 2446 | } |
2444 | } | 2447 | } |
@@ -2465,7 +2468,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2465 | _orientation = value; | 2468 | _orientation = value; |
2466 | } | 2469 | } |
2467 | else | 2470 | else |
2468 | m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object"); | 2471 | m_log.WarnFormat("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object {0}", Name); |
2469 | 2472 | ||
2470 | } | 2473 | } |
2471 | } | 2474 | } |
@@ -2505,7 +2508,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2505 | } | 2508 | } |
2506 | else | 2509 | else |
2507 | { | 2510 | { |
2508 | m_log.Warn("[PHYSICS]: Got Invalid linear force vector from Scene in Object"); | 2511 | m_log.WarnFormat("[PHYSICS]: Got Invalid linear force vector from Scene in Object {0}", Name); |
2509 | } | 2512 | } |
2510 | //m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString()); | 2513 | //m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString()); |
2511 | } | 2514 | } |
@@ -2519,7 +2522,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2519 | } | 2522 | } |
2520 | else | 2523 | else |
2521 | { | 2524 | { |
2522 | m_log.Warn("[PHYSICS]: Got Invalid Angular force vector from Scene in Object"); | 2525 | m_log.WarnFormat("[PHYSICS]: Got Invalid Angular force vector from Scene in Object {0}", Name); |
2523 | } | 2526 | } |
2524 | } | 2527 | } |
2525 | 2528 | ||
@@ -2545,7 +2548,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2545 | } | 2548 | } |
2546 | else | 2549 | else |
2547 | { | 2550 | { |
2548 | m_log.Warn("[PHYSICS]: Got NaN RotationalVelocity in Object"); | 2551 | m_log.WarnFormat("[PHYSICS]: Got NaN RotationalVelocity in Object {0}", Name); |
2549 | } | 2552 | } |
2550 | } | 2553 | } |
2551 | } | 2554 | } |
@@ -2560,7 +2563,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2560 | } | 2563 | } |
2561 | else if (m_crossingfailures == _parent_scene.geomCrossingFailuresBeforeOutofbounds) | 2564 | else if (m_crossingfailures == _parent_scene.geomCrossingFailuresBeforeOutofbounds) |
2562 | { | 2565 | { |
2563 | m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName); | 2566 | m_log.Warn("[PHYSICS]: Too many crossing failures for: " + Name); |
2564 | } | 2567 | } |
2565 | } | 2568 | } |
2566 | 2569 | ||
@@ -2593,7 +2596,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2593 | } | 2596 | } |
2594 | else | 2597 | else |
2595 | { | 2598 | { |
2596 | m_log.Warn("[PHYSICS]: Got NaN locking axis from Scene on Object"); | 2599 | m_log.WarnFormat("[PHYSICS]: Got NaN locking axis from Scene on Object {0}", Name); |
2597 | } | 2600 | } |
2598 | } | 2601 | } |
2599 | 2602 | ||
@@ -2685,7 +2688,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2685 | } | 2688 | } |
2686 | 2689 | ||
2687 | //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); | 2690 | //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); |
2688 | //Console.WriteLine("Adiff " + m_primName + " = " + Adiff); | 2691 | //Console.WriteLine("Adiff " + Name + " = " + Adiff); |
2689 | if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) | 2692 | if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) |
2690 | && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) | 2693 | && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) |
2691 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02) | 2694 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02) |
@@ -2826,7 +2829,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2826 | m_PIDTarget = value; | 2829 | m_PIDTarget = value; |
2827 | } | 2830 | } |
2828 | else | 2831 | else |
2829 | m_log.Warn("[PHYSICS]: Got NaN PIDTarget from Scene on Object"); | 2832 | m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name); |
2830 | } | 2833 | } |
2831 | } | 2834 | } |
2832 | public override bool PIDActive { set { m_usePID = value; } } | 2835 | public override bool PIDActive { set { m_usePID = value; } } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index caa39ba..e94790f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -24,7 +24,7 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
@@ -310,9 +310,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
310 | case ScriptBaseClass.LINK_ALL_OTHERS: | 310 | case ScriptBaseClass.LINK_ALL_OTHERS: |
311 | if (m_host.ParentGroup == null) | 311 | if (m_host.ParentGroup == null) |
312 | return new List<SceneObjectPart>(); | 312 | return new List<SceneObjectPart>(); |
313 | 313 | ||
314 | ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); | 314 | ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); |
315 | 315 | ||
316 | if (ret.Contains(m_host)) | 316 | if (ret.Contains(m_host)) |
317 | ret.Remove(m_host); | 317 | ret.Remove(m_host); |
318 | return ret; | 318 | return ret; |
@@ -320,9 +320,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
320 | case ScriptBaseClass.LINK_ALL_CHILDREN: | 320 | case ScriptBaseClass.LINK_ALL_CHILDREN: |
321 | if (m_host.ParentGroup == null) | 321 | if (m_host.ParentGroup == null) |
322 | return new List<SceneObjectPart>(); | 322 | return new List<SceneObjectPart>(); |
323 | 323 | ||
324 | ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); | 324 | ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts); |
325 | 325 | ||
326 | if (ret.Contains(m_host.ParentGroup.RootPart)) | 326 | if (ret.Contains(m_host.ParentGroup.RootPart)) |
327 | ret.Remove(m_host.ParentGroup.RootPart); | 327 | ret.Remove(m_host.ParentGroup.RootPart); |
328 | return ret; | 328 | return ret; |
@@ -1540,7 +1540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1540 | 1540 | ||
1541 | if (face == ScriptBaseClass.ALL_SIDES) | 1541 | if (face == ScriptBaseClass.ALL_SIDES) |
1542 | face = SceneObjectPart.ALL_SIDES; | 1542 | face = SceneObjectPart.ALL_SIDES; |
1543 | 1543 | ||
1544 | m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); | 1544 | m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face); |
1545 | } | 1545 | } |
1546 | 1546 | ||
@@ -2226,7 +2226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2226 | 2226 | ||
2227 | //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type | 2227 | //KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type |
2228 | // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; | 2228 | // part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition; |
2229 | 2229 | ||
2230 | // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line | 2230 | // So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line |
2231 | // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt | 2231 | // is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt |
2232 | // It's perfectly okay when the object is not an active physical body though. | 2232 | // It's perfectly okay when the object is not an active physical body though. |
@@ -4338,7 +4338,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4338 | case 1: // DATA_ONLINE (0|1) | 4338 | case 1: // DATA_ONLINE (0|1) |
4339 | if (pinfo != null && pinfo.RegionID != UUID.Zero) | 4339 | if (pinfo != null && pinfo.RegionID != UUID.Zero) |
4340 | reply = "1"; | 4340 | reply = "1"; |
4341 | else | 4341 | else |
4342 | reply = "0"; | 4342 | reply = "0"; |
4343 | break; | 4343 | break; |
4344 | case 2: // DATA_NAME (First Last) | 4344 | case 2: // DATA_NAME (First Last) |
@@ -4534,7 +4534,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4534 | return currentAnimationState; | 4534 | return currentAnimationState; |
4535 | } | 4535 | } |
4536 | } | 4536 | } |
4537 | 4537 | ||
4538 | return String.Empty; | 4538 | return String.Empty; |
4539 | } | 4539 | } |
4540 | 4540 | ||
@@ -4650,7 +4650,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4650 | return; | 4650 | return; |
4651 | 4651 | ||
4652 | // Need provisions for Group Owned here | 4652 | // Need provisions for Group Owned here |
4653 | if (m_host.OwnerID == targetlandObj.LandData.OwnerID || | 4653 | if (m_host.OwnerID == targetlandObj.LandData.OwnerID || |
4654 | targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID) | 4654 | targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID) |
4655 | { | 4655 | { |
4656 | pushAllowed = true; | 4656 | pushAllowed = true; |
@@ -4670,8 +4670,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4670 | if ((targetlandObj.LandData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject) | 4670 | if ((targetlandObj.LandData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject) |
4671 | { | 4671 | { |
4672 | // Need provisions for Group Owned here | 4672 | // Need provisions for Group Owned here |
4673 | if (m_host.OwnerID == targetlandObj.LandData.OwnerID || | 4673 | if (m_host.OwnerID == targetlandObj.LandData.OwnerID || |
4674 | targetlandObj.LandData.IsGroupOwned || | 4674 | targetlandObj.LandData.IsGroupOwned || |
4675 | m_host.OwnerID == targetID) | 4675 | m_host.OwnerID == targetID) |
4676 | { | 4676 | { |
4677 | pushAllowed = true; | 4677 | pushAllowed = true; |
@@ -4795,7 +4795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4795 | 4795 | ||
4796 | return sides; | 4796 | return sides; |
4797 | } | 4797 | } |
4798 | 4798 | ||
4799 | 4799 | ||
4800 | /* The new / changed functions were tested with the following LSL script: | 4800 | /* The new / changed functions were tested with the following LSL script: |
4801 | 4801 | ||
@@ -5809,7 +5809,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5809 | flags |= ScriptBaseClass.AGENT_SITTING; | 5809 | flags |= ScriptBaseClass.AGENT_SITTING; |
5810 | } | 5810 | } |
5811 | 5811 | ||
5812 | if (agent.Animator.Animations.DefaultAnimation.AnimID | 5812 | if (agent.Animator.Animations.DefaultAnimation.AnimID |
5813 | == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) | 5813 | == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) |
5814 | { | 5814 | { |
5815 | flags |= ScriptBaseClass.AGENT_SITTING; | 5815 | flags |= ScriptBaseClass.AGENT_SITTING; |
@@ -6190,7 +6190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6190 | m_host.AddScriptLPS(1); | 6190 | m_host.AddScriptLPS(1); |
6191 | return World.SimulatorFPS; | 6191 | return World.SimulatorFPS; |
6192 | } | 6192 | } |
6193 | 6193 | ||
6194 | 6194 | ||
6195 | /* particle system rules should be coming into this routine as doubles, that is | 6195 | /* particle system rules should be coming into this routine as doubles, that is |
6196 | rule[0] should be an integer from this list and rule[1] should be the arg | 6196 | rule[0] should be an integer from this list and rule[1] should be the arg |
@@ -6273,7 +6273,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6273 | 6273 | ||
6274 | private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { | 6274 | private void SetParticleSystem(SceneObjectPart part, LSL_List rules) { |
6275 | 6275 | ||
6276 | 6276 | ||
6277 | if (rules.Length == 0) | 6277 | if (rules.Length == 0) |
6278 | { | 6278 | { |
6279 | part.RemoveParticleSystem(); | 6279 | part.RemoveParticleSystem(); |
@@ -6444,7 +6444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6444 | if (m_host.PhysActor != null) | 6444 | if (m_host.PhysActor != null) |
6445 | { | 6445 | { |
6446 | float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); | 6446 | float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0)); |
6447 | float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); | 6447 | float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0)); |
6448 | PIDHoverType hoverType = PIDHoverType.Ground; | 6448 | PIDHoverType hoverType = PIDHoverType.Ground; |
6449 | if (water != 0) | 6449 | if (water != 0) |
6450 | { | 6450 | { |
@@ -6458,7 +6458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6458 | { | 6458 | { |
6459 | height += ground; | 6459 | height += ground; |
6460 | } | 6460 | } |
6461 | 6461 | ||
6462 | m_host.SetHoverHeight((float)height, hoverType, (float)tau); | 6462 | m_host.SetHoverHeight((float)height, hoverType, (float)tau); |
6463 | } | 6463 | } |
6464 | } | 6464 | } |
@@ -6841,19 +6841,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6841 | if (xmlRpcRouter != null) | 6841 | if (xmlRpcRouter != null) |
6842 | { | 6842 | { |
6843 | string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName; | 6843 | string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName; |
6844 | 6844 | ||
6845 | xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, | 6845 | xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, |
6846 | m_itemID, String.Format("http://{0}:{1}/", ExternalHostName, | 6846 | m_itemID, String.Format("http://{0}:{1}/", ExternalHostName, |
6847 | xmlrpcMod.Port.ToString())); | 6847 | xmlrpcMod.Port.ToString())); |
6848 | } | 6848 | } |
6849 | object[] resobj = new object[] | 6849 | object[] resobj = new object[] |
6850 | { | 6850 | { |
6851 | new LSL_Integer(1), | 6851 | new LSL_Integer(1), |
6852 | new LSL_String(channelID.ToString()), | 6852 | new LSL_String(channelID.ToString()), |
6853 | new LSL_String(UUID.Zero.ToString()), | 6853 | new LSL_String(UUID.Zero.ToString()), |
6854 | new LSL_String(String.Empty), | 6854 | new LSL_String(String.Empty), |
6855 | new LSL_Integer(0), | 6855 | new LSL_Integer(0), |
6856 | new LSL_String(String.Empty) | 6856 | new LSL_String(String.Empty) |
6857 | }; | 6857 | }; |
6858 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams("remote_data", resobj, | 6858 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams("remote_data", resobj, |
6859 | new DetectParams[0])); | 6859 | new DetectParams[0])); |
@@ -7242,6 +7242,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7242 | { | 7242 | { |
7243 | m_host.AddScriptLPS(1); | 7243 | m_host.AddScriptLPS(1); |
7244 | SetPrimParams(m_host, rules); | 7244 | SetPrimParams(m_host, rules); |
7245 | |||
7246 | ScriptSleep(200); | ||
7245 | } | 7247 | } |
7246 | 7248 | ||
7247 | public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) | 7249 | public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules) |
@@ -7469,7 +7471,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7469 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); | 7471 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
7470 | skew = (float)rules.GetLSLFloatItem(idx++); | 7472 | skew = (float)rules.GetLSLFloatItem(idx++); |
7471 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 7473 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
7472 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, | 7474 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, |
7473 | revolutions, radiusoffset, skew, 0); | 7475 | revolutions, radiusoffset, skew, 0); |
7474 | break; | 7476 | break; |
7475 | 7477 | ||
@@ -7489,7 +7491,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7489 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); | 7491 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
7490 | skew = (float)rules.GetLSLFloatItem(idx++); | 7492 | skew = (float)rules.GetLSLFloatItem(idx++); |
7491 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 7493 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
7492 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, | 7494 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, |
7493 | revolutions, radiusoffset, skew, 1); | 7495 | revolutions, radiusoffset, skew, 1); |
7494 | break; | 7496 | break; |
7495 | 7497 | ||
@@ -7509,7 +7511,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7509 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); | 7511 | radiusoffset = (float)rules.GetLSLFloatItem(idx++); |
7510 | skew = (float)rules.GetLSLFloatItem(idx++); | 7512 | skew = (float)rules.GetLSLFloatItem(idx++); |
7511 | part.Shape.PathCurve = (byte)Extrusion.Curve1; | 7513 | part.Shape.PathCurve = (byte)Extrusion.Curve1; |
7512 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, | 7514 | SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b, |
7513 | revolutions, radiusoffset, skew, 3); | 7515 | revolutions, radiusoffset, skew, 3); |
7514 | break; | 7516 | break; |
7515 | 7517 | ||
@@ -7555,7 +7557,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7555 | SetAlpha(part, alpha, face); | 7557 | SetAlpha(part, alpha, face); |
7556 | 7558 | ||
7557 | break; | 7559 | break; |
7558 | 7560 | ||
7559 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: | 7561 | case (int)ScriptBaseClass.PRIM_FLEXIBLE: |
7560 | if (remain < 7) | 7562 | if (remain < 7) |
7561 | return; | 7563 | return; |
@@ -7571,7 +7573,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7571 | SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force); | 7573 | SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force); |
7572 | 7574 | ||
7573 | break; | 7575 | break; |
7574 | 7576 | ||
7575 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: | 7577 | case (int)ScriptBaseClass.PRIM_POINT_LIGHT: |
7576 | if (remain < 5) | 7578 | if (remain < 5) |
7577 | return; | 7579 | return; |
@@ -7584,7 +7586,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7584 | SetPointLight(part, light, lightcolor, intensity, radius, falloff); | 7586 | SetPointLight(part, light, lightcolor, intensity, radius, falloff); |
7585 | 7587 | ||
7586 | break; | 7588 | break; |
7587 | 7589 | ||
7588 | case (int)ScriptBaseClass.PRIM_GLOW: | 7590 | case (int)ScriptBaseClass.PRIM_GLOW: |
7589 | if (remain < 2) | 7591 | if (remain < 2) |
7590 | return; | 7592 | return; |
@@ -7594,7 +7596,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7594 | SetGlow(part, face, glow); | 7596 | SetGlow(part, face, glow); |
7595 | 7597 | ||
7596 | break; | 7598 | break; |
7597 | 7599 | ||
7598 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: | 7600 | case (int)ScriptBaseClass.PRIM_BUMP_SHINY: |
7599 | if (remain < 3) | 7601 | if (remain < 3) |
7600 | return; | 7602 | return; |
@@ -7605,7 +7607,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7605 | SetShiny(part, face, shiny, bump); | 7607 | SetShiny(part, face, shiny, bump); |
7606 | 7608 | ||
7607 | break; | 7609 | break; |
7608 | 7610 | ||
7609 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: | 7611 | case (int)ScriptBaseClass.PRIM_FULLBRIGHT: |
7610 | if (remain < 2) | 7612 | if (remain < 2) |
7611 | return; | 7613 | return; |
@@ -7613,7 +7615,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7613 | bool st = rules.GetLSLIntegerItem(idx++); | 7615 | bool st = rules.GetLSLIntegerItem(idx++); |
7614 | SetFullBright(part, face , st); | 7616 | SetFullBright(part, face , st); |
7615 | break; | 7617 | break; |
7616 | 7618 | ||
7617 | case (int)ScriptBaseClass.PRIM_MATERIAL: | 7619 | case (int)ScriptBaseClass.PRIM_MATERIAL: |
7618 | if (remain < 1) | 7620 | if (remain < 1) |
7619 | return; | 7621 | return; |
@@ -7623,7 +7625,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7623 | 7625 | ||
7624 | part.Material = Convert.ToByte(mat); | 7626 | part.Material = Convert.ToByte(mat); |
7625 | break; | 7627 | break; |
7626 | 7628 | ||
7627 | case (int)ScriptBaseClass.PRIM_PHANTOM: | 7629 | case (int)ScriptBaseClass.PRIM_PHANTOM: |
7628 | if (remain < 1) | 7630 | if (remain < 1) |
7629 | return; | 7631 | return; |
@@ -7638,7 +7640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7638 | 7640 | ||
7639 | part.ScriptSetPhantomStatus(phantom); | 7641 | part.ScriptSetPhantomStatus(phantom); |
7640 | break; | 7642 | break; |
7641 | 7643 | ||
7642 | case (int)ScriptBaseClass.PRIM_PHYSICS: | 7644 | case (int)ScriptBaseClass.PRIM_PHYSICS: |
7643 | if (remain < 1) | 7645 | if (remain < 1) |
7644 | return; | 7646 | return; |
@@ -7652,7 +7654,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7652 | 7654 | ||
7653 | part.ScriptSetPhysicsStatus(physics); | 7655 | part.ScriptSetPhysicsStatus(physics); |
7654 | break; | 7656 | break; |
7655 | 7657 | ||
7656 | case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: | 7658 | case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ: |
7657 | if (remain < 1) | 7659 | if (remain < 1) |
7658 | return; | 7660 | return; |
@@ -7778,7 +7780,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7778 | public LSL_Vector llGetRootPosition() | 7780 | public LSL_Vector llGetRootPosition() |
7779 | { | 7781 | { |
7780 | m_host.AddScriptLPS(1); | 7782 | m_host.AddScriptLPS(1); |
7781 | return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, | 7783 | return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, |
7782 | m_host.ParentGroup.AbsolutePosition.Z); | 7784 | m_host.ParentGroup.AbsolutePosition.Z); |
7783 | } | 7785 | } |
7784 | 7786 | ||
@@ -8109,8 +8111,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8109 | res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned | 8111 | res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned |
8110 | // byte is being used to represent the entire | 8112 | // byte is being used to represent the entire |
8111 | // range of floating-point values from 1.0 | 8113 | // range of floating-point values from 1.0 |
8112 | // through 4.0 (which is how SL does it). | 8114 | // through 4.0 (which is how SL does it). |
8113 | 8115 | ||
8114 | // float radiusoffset | 8116 | // float radiusoffset |
8115 | res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); | 8117 | res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0)); |
8116 | 8118 | ||
@@ -8391,104 +8393,104 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8391 | // Assuming silently fail means give back an empty list. Ideally, need to check this. | 8393 | // Assuming silently fail means give back an empty list. Ideally, need to check this. |
8392 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 8394 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) |
8393 | return new LSL_List(); | 8395 | return new LSL_List(); |
8394 | 8396 | ||
8395 | return GetPrimMediaParams(face, rules); | 8397 | return GetPrimMediaParams(face, rules); |
8396 | } | 8398 | } |
8397 | 8399 | ||
8398 | private LSL_List GetPrimMediaParams(int face, LSL_List rules) | 8400 | private LSL_List GetPrimMediaParams(int face, LSL_List rules) |
8399 | { | 8401 | { |
8400 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 8402 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
8401 | if (null == module) | 8403 | if (null == module) |
8402 | throw new Exception("Media on a prim functions not available"); | 8404 | throw new Exception("Media on a prim functions not available"); |
8403 | 8405 | ||
8404 | MediaEntry me = module.GetMediaEntry(m_host, face); | 8406 | MediaEntry me = module.GetMediaEntry(m_host, face); |
8405 | 8407 | ||
8406 | // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams | 8408 | // As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams |
8407 | if (null == me) | 8409 | if (null == me) |
8408 | return new LSL_List(); | 8410 | return new LSL_List(); |
8409 | 8411 | ||
8410 | LSL_List res = new LSL_List(); | 8412 | LSL_List res = new LSL_List(); |
8411 | 8413 | ||
8412 | for (int i = 0; i < rules.Length; i++) | 8414 | for (int i = 0; i < rules.Length; i++) |
8413 | { | 8415 | { |
8414 | int code = (int)rules.GetLSLIntegerItem(i); | 8416 | int code = (int)rules.GetLSLIntegerItem(i); |
8415 | 8417 | ||
8416 | switch (code) | 8418 | switch (code) |
8417 | { | 8419 | { |
8418 | case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: | 8420 | case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: |
8419 | // Not implemented | 8421 | // Not implemented |
8420 | res.Add(new LSL_Integer(0)); | 8422 | res.Add(new LSL_Integer(0)); |
8421 | break; | 8423 | break; |
8422 | 8424 | ||
8423 | case ScriptBaseClass.PRIM_MEDIA_CONTROLS: | 8425 | case ScriptBaseClass.PRIM_MEDIA_CONTROLS: |
8424 | if (me.Controls == MediaControls.Standard) | 8426 | if (me.Controls == MediaControls.Standard) |
8425 | res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD)); | 8427 | res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD)); |
8426 | else | 8428 | else |
8427 | res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_MINI)); | 8429 | res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_MINI)); |
8428 | break; | 8430 | break; |
8429 | 8431 | ||
8430 | case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: | 8432 | case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: |
8431 | res.Add(new LSL_String(me.CurrentURL)); | 8433 | res.Add(new LSL_String(me.CurrentURL)); |
8432 | break; | 8434 | break; |
8433 | 8435 | ||
8434 | case ScriptBaseClass.PRIM_MEDIA_HOME_URL: | 8436 | case ScriptBaseClass.PRIM_MEDIA_HOME_URL: |
8435 | res.Add(new LSL_String(me.HomeURL)); | 8437 | res.Add(new LSL_String(me.HomeURL)); |
8436 | break; | 8438 | break; |
8437 | 8439 | ||
8438 | case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: | 8440 | case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: |
8439 | res.Add(me.AutoLoop ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8441 | res.Add(me.AutoLoop ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8440 | break; | 8442 | break; |
8441 | 8443 | ||
8442 | case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: | 8444 | case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: |
8443 | res.Add(me.AutoPlay ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8445 | res.Add(me.AutoPlay ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8444 | break; | 8446 | break; |
8445 | 8447 | ||
8446 | case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: | 8448 | case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: |
8447 | res.Add(me.AutoScale ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8449 | res.Add(me.AutoScale ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8448 | break; | 8450 | break; |
8449 | 8451 | ||
8450 | case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: | 8452 | case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: |
8451 | res.Add(me.AutoZoom ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8453 | res.Add(me.AutoZoom ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8452 | break; | 8454 | break; |
8453 | 8455 | ||
8454 | case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: | 8456 | case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: |
8455 | res.Add(me.InteractOnFirstClick ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8457 | res.Add(me.InteractOnFirstClick ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8456 | break; | 8458 | break; |
8457 | 8459 | ||
8458 | case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: | 8460 | case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: |
8459 | res.Add(new LSL_Integer(me.Width)); | 8461 | res.Add(new LSL_Integer(me.Width)); |
8460 | break; | 8462 | break; |
8461 | 8463 | ||
8462 | case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: | 8464 | case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: |
8463 | res.Add(new LSL_Integer(me.Height)); | 8465 | res.Add(new LSL_Integer(me.Height)); |
8464 | break; | 8466 | break; |
8465 | 8467 | ||
8466 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: | 8468 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: |
8467 | res.Add(me.EnableWhiteList ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); | 8469 | res.Add(me.EnableWhiteList ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE); |
8468 | break; | 8470 | break; |
8469 | 8471 | ||
8470 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST: | 8472 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST: |
8471 | string[] urls = (string[])me.WhiteList.Clone(); | 8473 | string[] urls = (string[])me.WhiteList.Clone(); |
8472 | 8474 | ||
8473 | for (int j = 0; j < urls.Length; j++) | 8475 | for (int j = 0; j < urls.Length; j++) |
8474 | urls[j] = Uri.EscapeDataString(urls[j]); | 8476 | urls[j] = Uri.EscapeDataString(urls[j]); |
8475 | 8477 | ||
8476 | res.Add(new LSL_String(string.Join(", ", urls))); | 8478 | res.Add(new LSL_String(string.Join(", ", urls))); |
8477 | break; | 8479 | break; |
8478 | 8480 | ||
8479 | case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: | 8481 | case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: |
8480 | res.Add(new LSL_Integer((int)me.InteractPermissions)); | 8482 | res.Add(new LSL_Integer((int)me.InteractPermissions)); |
8481 | break; | 8483 | break; |
8482 | 8484 | ||
8483 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: | 8485 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: |
8484 | res.Add(new LSL_Integer((int)me.ControlPermissions)); | 8486 | res.Add(new LSL_Integer((int)me.ControlPermissions)); |
8485 | break; | 8487 | break; |
8486 | } | 8488 | } |
8487 | } | 8489 | } |
8488 | 8490 | ||
8489 | return res; | 8491 | return res; |
8490 | } | 8492 | } |
8491 | 8493 | ||
8492 | public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) | 8494 | public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules) |
8493 | { | 8495 | { |
8494 | m_host.AddScriptLPS(1); | 8496 | m_host.AddScriptLPS(1); |
@@ -8499,32 +8501,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8499 | // Don't perform the media check directly | 8501 | // Don't perform the media check directly |
8500 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 8502 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) |
8501 | return ScriptBaseClass.LSL_STATUS_OK; | 8503 | return ScriptBaseClass.LSL_STATUS_OK; |
8502 | 8504 | ||
8503 | return SetPrimMediaParams(face, rules); | 8505 | return SetPrimMediaParams(face, rules); |
8504 | } | 8506 | } |
8505 | 8507 | ||
8506 | private LSL_Integer SetPrimMediaParams(int face, LSL_List rules) | 8508 | private LSL_Integer SetPrimMediaParams(int face, LSL_List rules) |
8507 | { | 8509 | { |
8508 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 8510 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
8509 | if (null == module) | 8511 | if (null == module) |
8510 | throw new Exception("Media on a prim functions not available"); | 8512 | throw new Exception("Media on a prim functions not available"); |
8511 | 8513 | ||
8512 | MediaEntry me = module.GetMediaEntry(m_host, face); | 8514 | MediaEntry me = module.GetMediaEntry(m_host, face); |
8513 | if (null == me) | 8515 | if (null == me) |
8514 | me = new MediaEntry(); | 8516 | me = new MediaEntry(); |
8515 | 8517 | ||
8516 | int i = 0; | 8518 | int i = 0; |
8517 | 8519 | ||
8518 | while (i < rules.Length - 1) | 8520 | while (i < rules.Length - 1) |
8519 | { | 8521 | { |
8520 | int code = rules.GetLSLIntegerItem(i++); | 8522 | int code = rules.GetLSLIntegerItem(i++); |
8521 | 8523 | ||
8522 | switch (code) | 8524 | switch (code) |
8523 | { | 8525 | { |
8524 | case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: | 8526 | case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE: |
8525 | me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false); | 8527 | me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false); |
8526 | break; | 8528 | break; |
8527 | 8529 | ||
8528 | case ScriptBaseClass.PRIM_MEDIA_CONTROLS: | 8530 | case ScriptBaseClass.PRIM_MEDIA_CONTROLS: |
8529 | int v = rules.GetLSLIntegerItem(i++); | 8531 | int v = rules.GetLSLIntegerItem(i++); |
8530 | if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v) | 8532 | if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v) |
@@ -8532,47 +8534,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8532 | else | 8534 | else |
8533 | me.Controls = MediaControls.Mini; | 8535 | me.Controls = MediaControls.Mini; |
8534 | break; | 8536 | break; |
8535 | 8537 | ||
8536 | case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: | 8538 | case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL: |
8537 | me.CurrentURL = rules.GetLSLStringItem(i++); | 8539 | me.CurrentURL = rules.GetLSLStringItem(i++); |
8538 | break; | 8540 | break; |
8539 | 8541 | ||
8540 | case ScriptBaseClass.PRIM_MEDIA_HOME_URL: | 8542 | case ScriptBaseClass.PRIM_MEDIA_HOME_URL: |
8541 | me.HomeURL = rules.GetLSLStringItem(i++); | 8543 | me.HomeURL = rules.GetLSLStringItem(i++); |
8542 | break; | 8544 | break; |
8543 | 8545 | ||
8544 | case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: | 8546 | case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP: |
8545 | me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8547 | me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8546 | break; | 8548 | break; |
8547 | 8549 | ||
8548 | case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: | 8550 | case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY: |
8549 | me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8551 | me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8550 | break; | 8552 | break; |
8551 | 8553 | ||
8552 | case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: | 8554 | case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE: |
8553 | me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8555 | me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8554 | break; | 8556 | break; |
8555 | 8557 | ||
8556 | case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: | 8558 | case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM: |
8557 | me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8559 | me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8558 | break; | 8560 | break; |
8559 | 8561 | ||
8560 | case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: | 8562 | case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT: |
8561 | me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8563 | me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8562 | break; | 8564 | break; |
8563 | 8565 | ||
8564 | case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: | 8566 | case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS: |
8565 | me.Width = (int)rules.GetLSLIntegerItem(i++); | 8567 | me.Width = (int)rules.GetLSLIntegerItem(i++); |
8566 | break; | 8568 | break; |
8567 | 8569 | ||
8568 | case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: | 8570 | case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS: |
8569 | me.Height = (int)rules.GetLSLIntegerItem(i++); | 8571 | me.Height = (int)rules.GetLSLIntegerItem(i++); |
8570 | break; | 8572 | break; |
8571 | 8573 | ||
8572 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: | 8574 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE: |
8573 | me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); | 8575 | me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false); |
8574 | break; | 8576 | break; |
8575 | 8577 | ||
8576 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST: | 8578 | case ScriptBaseClass.PRIM_MEDIA_WHITELIST: |
8577 | string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' }); | 8579 | string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' }); |
8578 | List<string> whiteListUrls = new List<string>(); | 8580 | List<string> whiteListUrls = new List<string>(); |
@@ -8580,22 +8582,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8580 | rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); }); | 8582 | rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); }); |
8581 | me.WhiteList = whiteListUrls.ToArray(); | 8583 | me.WhiteList = whiteListUrls.ToArray(); |
8582 | break; | 8584 | break; |
8583 | 8585 | ||
8584 | case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: | 8586 | case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT: |
8585 | me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); | 8587 | me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); |
8586 | break; | 8588 | break; |
8587 | 8589 | ||
8588 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: | 8590 | case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL: |
8589 | me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); | 8591 | me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++); |
8590 | break; | 8592 | break; |
8591 | } | 8593 | } |
8592 | } | 8594 | } |
8593 | 8595 | ||
8594 | module.SetMediaEntry(m_host, face, me); | 8596 | module.SetMediaEntry(m_host, face, me); |
8595 | 8597 | ||
8596 | return ScriptBaseClass.LSL_STATUS_OK; | 8598 | return ScriptBaseClass.LSL_STATUS_OK; |
8597 | } | 8599 | } |
8598 | 8600 | ||
8599 | public LSL_Integer llClearPrimMedia(LSL_Integer face) | 8601 | public LSL_Integer llClearPrimMedia(LSL_Integer face) |
8600 | { | 8602 | { |
8601 | m_host.AddScriptLPS(1); | 8603 | m_host.AddScriptLPS(1); |
@@ -8606,16 +8608,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8606 | // FIXME: Don't perform the media check directly | 8608 | // FIXME: Don't perform the media check directly |
8607 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) | 8609 | if (face < 0 || face > m_host.GetNumberOfSides() - 1) |
8608 | return ScriptBaseClass.LSL_STATUS_OK; | 8610 | return ScriptBaseClass.LSL_STATUS_OK; |
8609 | 8611 | ||
8610 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); | 8612 | IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>(); |
8611 | if (null == module) | 8613 | if (null == module) |
8612 | throw new Exception("Media on a prim functions not available"); | 8614 | throw new Exception("Media on a prim functions not available"); |
8613 | 8615 | ||
8614 | module.ClearMediaEntry(m_host, face); | 8616 | module.ClearMediaEntry(m_host, face); |
8615 | 8617 | ||
8616 | return ScriptBaseClass.LSL_STATUS_OK; | 8618 | return ScriptBaseClass.LSL_STATUS_OK; |
8617 | } | 8619 | } |
8618 | 8620 | ||
8619 | // <remarks> | 8621 | // <remarks> |
8620 | // <para> | 8622 | // <para> |
8621 | // The .NET definition of base 64 is: | 8623 | // The .NET definition of base 64 is: |
@@ -8875,7 +8877,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8875 | public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) | 8877 | public LSL_String llGetHTTPHeader(LSL_Key request_id, string header) |
8876 | { | 8878 | { |
8877 | m_host.AddScriptLPS(1); | 8879 | m_host.AddScriptLPS(1); |
8878 | 8880 | ||
8879 | if (m_UrlModule != null) | 8881 | if (m_UrlModule != null) |
8880 | return m_UrlModule.GetHttpHeader(new UUID(request_id), header); | 8882 | return m_UrlModule.GetHttpHeader(new UUID(request_id), header); |
8881 | return String.Empty; | 8883 | return String.Empty; |