Merge branch 'master' into careminster-presence-refactor
commit
4fbdcb95a0
|
@ -30,7 +30,12 @@ using System.Data;
|
|||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
|
|
|
@ -33,7 +33,12 @@ using System.Reflection;
|
|||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Data.Sqlite;
|
||||
using log4net;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -33,7 +33,11 @@ using System.Threading;
|
|||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -30,7 +30,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
@ -105,10 +109,17 @@ namespace OpenSim.Data.SQLite
|
|||
{
|
||||
EstateSettings es = new EstateSettings();
|
||||
es.OnSave += StoreEstateSettings;
|
||||
IDataReader r = null;
|
||||
try
|
||||
{
|
||||
r = cmd.ExecuteReader();
|
||||
}
|
||||
catch (SqliteException)
|
||||
{
|
||||
m_log.Error("[SQLITE]: There was an issue loading the estate settings. This can happen the first time running OpenSimulator with CSharpSqlite the first time. OpenSimulator will probably crash, restart it and it should be good to go.");
|
||||
}
|
||||
|
||||
IDataReader r = cmd.ExecuteReader();
|
||||
|
||||
if (r.Read())
|
||||
if (r != null && r.Read())
|
||||
{
|
||||
foreach (string name in FieldList)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -31,7 +31,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -30,7 +30,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
|
|
|
@ -30,7 +30,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
|
|
|
@ -32,7 +32,11 @@ using System.Drawing;
|
|||
using System.IO;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework;
|
||||
|
|
|
@ -31,7 +31,11 @@ using System.Collections.Generic;
|
|||
using System.Data;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -27,7 +27,11 @@
|
|||
|
||||
using System;
|
||||
using System.Data;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
|
||||
namespace OpenSim.Data.SQLite
|
||||
{
|
||||
|
|
|
@ -29,7 +29,11 @@ using System;
|
|||
using System.Data;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using Mono.Data.Sqlite;
|
||||
#if CSharpSqlite
|
||||
using Community.CsharpSqlite.Sqlite;
|
||||
#else
|
||||
using Mono.Data.Sqlite;
|
||||
#endif
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
|
|
@ -91,6 +91,9 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
|||
if (part.ParentGroup.IsDeleted)
|
||||
return;
|
||||
|
||||
if (part.OwnerID != client.AgentId && (!m_scene.Permissions.IsGod(client.AgentId)))
|
||||
return;
|
||||
|
||||
part = part.ParentGroup.RootPart;
|
||||
|
||||
part.ObjectSaleType = saleType;
|
||||
|
@ -258,4 +261,4 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1748,7 +1748,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
part.PhysActor
|
||||
= m_scene.PhysicsScene.AddPrimShape(
|
||||
part.Name,
|
||||
string.Format("{0}/{1}", part.Name, part.UUID),
|
||||
pbs,
|
||||
part.AbsolutePosition,
|
||||
part.Scale,
|
||||
|
|
|
@ -1560,7 +1560,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
try
|
||||
{
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
Name,
|
||||
string.Format("{0}/{1}", Name, UUID),
|
||||
Shape,
|
||||
AbsolutePosition,
|
||||
Scale,
|
||||
|
@ -4396,7 +4396,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
// It's not phantom anymore. So make sure the physics engine get's knowledge of it
|
||||
PhysActor = m_parentGroup.Scene.PhysicsScene.AddPrimShape(
|
||||
Name,
|
||||
string.Format("{0}/{1}", Name, UUID),
|
||||
Shape,
|
||||
AbsolutePosition,
|
||||
Scale,
|
||||
|
|
|
@ -291,9 +291,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the asset uuid associated with a gesture
|
||||
/// </summary>
|
||||
/// <param name="gestureUuid"></param>
|
||||
/// <param name="assetUuids"></param>
|
||||
protected void GetGestureAssetUuids(UUID gestureUuid, IDictionary<UUID, AssetType> assetUuids)
|
||||
{
|
||||
AssetBase assetBase = GetAsset(gestureUuid);
|
||||
if (null == assetBase)
|
||||
return;
|
||||
|
||||
MemoryStream ms = new MemoryStream(assetBase.Data);
|
||||
StreamReader sr = new StreamReader(ms);
|
||||
|
|
|
@ -170,7 +170,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
private bool m_lastUpdateSent;
|
||||
|
||||
public IntPtr Body = IntPtr.Zero;
|
||||
public String m_primName;
|
||||
public String Name { get; private set; }
|
||||
private Vector3 _target_velocity;
|
||||
public d.Mass pMass;
|
||||
|
||||
|
@ -188,6 +188,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size,
|
||||
Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical, CollisionLocker dode)
|
||||
{
|
||||
Name = primName;
|
||||
m_vehicle = new ODEDynamics();
|
||||
//gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
|
||||
ode = dode;
|
||||
|
@ -195,7 +196,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
{
|
||||
pos = new Vector3(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f),
|
||||
parent_scene.GetTerrainHeightAtXY(((float)Constants.RegionSize * 0.5f), ((float)Constants.RegionSize * 0.5f)) + 0.5f);
|
||||
m_log.Warn("[PHYSICS]: Got nonFinite Object create Position");
|
||||
m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Position for {0}", Name);
|
||||
}
|
||||
_position = pos;
|
||||
m_taintposition = pos;
|
||||
|
@ -212,7 +213,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (!pos.IsFinite())
|
||||
{
|
||||
size = new Vector3(0.5f, 0.5f, 0.5f);
|
||||
m_log.Warn("[PHYSICS]: Got nonFinite Object create Size");
|
||||
m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Size for {0}", Name);
|
||||
}
|
||||
|
||||
if (size.X <= 0) size.X = 0.01f;
|
||||
|
@ -225,7 +226,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (!QuaternionIsFinite(rotation))
|
||||
{
|
||||
rotation = Quaternion.Identity;
|
||||
m_log.Warn("[PHYSICS]: Got nonFinite Object create Rotation");
|
||||
m_log.WarnFormat("[PHYSICS]: Got nonFinite Object create Rotation for {0}", Name);
|
||||
}
|
||||
|
||||
_orientation = rotation;
|
||||
|
@ -246,7 +247,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (m_isphysical)
|
||||
m_targetSpace = _parent_scene.space;
|
||||
}
|
||||
m_primName = primName;
|
||||
|
||||
m_taintadd = true;
|
||||
_parent_scene.AddPhysicsActorTaint(this);
|
||||
// don't do .add() here; old geoms get recycled with the same hash
|
||||
|
@ -304,7 +305,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
{
|
||||
prev_geom = prim_geom;
|
||||
prim_geom = geom;
|
||||
//Console.WriteLine("SetGeom to " + prim_geom + " for " + m_primName);
|
||||
//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name);
|
||||
if (prim_geom != IntPtr.Zero)
|
||||
{
|
||||
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
|
||||
|
@ -857,7 +858,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Error("[PHYSICS]: MESH LOCKED");
|
||||
m_log.ErrorFormat("[PHYSICS]: MESH LOCKED FOR {0}", Name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -874,7 +875,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
|
||||
public void ProcessTaints(float timestep)
|
||||
{
|
||||
//Console.WriteLine("ProcessTaints for " + m_primName);
|
||||
//Console.WriteLine("ProcessTaints for " + Name);
|
||||
if (m_taintadd)
|
||||
{
|
||||
changeadd(timestep);
|
||||
|
@ -945,7 +946,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
else
|
||||
{
|
||||
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.)");
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1036,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
// prim is the child
|
||||
public void ParentPrim(OdePrim prim)
|
||||
{
|
||||
//Console.WriteLine("ParentPrim " + m_primName);
|
||||
//Console.WriteLine("ParentPrim " + Name);
|
||||
if (this.m_localID != prim.m_localID)
|
||||
{
|
||||
if (Body == IntPtr.Zero)
|
||||
|
@ -1071,18 +1072,20 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
d.MassTranslate(ref m2, Position.X - prm.Position.X, Position.Y - prm.Position.Y, Position.Z - prm.Position.Z);
|
||||
d.MassAdd(ref pMass, ref m2);
|
||||
}
|
||||
|
||||
foreach (OdePrim prm in childrenPrim)
|
||||
{
|
||||
|
||||
{
|
||||
prm.m_collisionCategories |= CollisionCategories.Body;
|
||||
prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
|
||||
|
||||
if (prm.prim_geom == IntPtr.Zero)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to link one of the linkset elements. No geom yet");
|
||||
m_log.WarnFormat(
|
||||
"[PHYSICS]: Unable to link one of the linkset elements {0} for parent {1}. No geom yet",
|
||||
prm.Name, prim.Name);
|
||||
continue;
|
||||
}
|
||||
//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + m_primName);
|
||||
//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name);
|
||||
d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
|
||||
d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
|
||||
|
||||
|
@ -1111,7 +1114,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Debug("[PHYSICS]:I ain't got no boooooooooddy, no body");
|
||||
m_log.DebugFormat("[PHYSICS]: {0} ain't got no boooooooooddy, no body", Name);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1130,7 +1133,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
m_collisionCategories |= CollisionCategories.Body;
|
||||
m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
|
||||
|
||||
//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + m_primName);
|
||||
//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
|
||||
d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
|
||||
//Console.WriteLine(" Post GeomSetCategoryBits 2");
|
||||
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
||||
|
@ -1373,7 +1376,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name);
|
||||
ode.dunlock(_parent_scene.world);
|
||||
return;
|
||||
}
|
||||
|
@ -1388,7 +1391,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name);
|
||||
ode.dunlock(_parent_scene.world);
|
||||
return;
|
||||
}
|
||||
|
@ -1404,7 +1407,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name);
|
||||
ode.dunlock(_parent_scene.world);
|
||||
return;
|
||||
}
|
||||
|
@ -1421,7 +1424,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
catch (AccessViolationException)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Unable to create physics proxy for object");
|
||||
m_log.WarnFormat("[PHYSICS]: Unable to create physics proxy for object {0}", Name);
|
||||
ode.dunlock(_parent_scene.world);
|
||||
return;
|
||||
}
|
||||
|
@ -1444,7 +1447,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
if (_parent_scene.needsMeshing(_pbs))
|
||||
{
|
||||
// Don't need to re-enable body.. it's done in SetMesh
|
||||
_mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
|
||||
_mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical);
|
||||
// createmesh returns null when it's a shape that isn't a cube.
|
||||
// m_log.Debug(m_localID);
|
||||
}
|
||||
|
@ -1473,7 +1476,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
}
|
||||
|
||||
_parent_scene.geom_name_map[prim_geom] = this.m_primName;
|
||||
_parent_scene.geom_name_map[prim_geom] = this.Name;
|
||||
_parent_scene.actor_name_map[prim_geom] = (PhysicsActor)this;
|
||||
|
||||
changeSelectedStatus(timestep);
|
||||
|
@ -1524,7 +1527,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Body Still null after enableBody(). This is a crash scenario.");
|
||||
m_log.WarnFormat("[PHYSICS]: Body for {0} still null after enableBody(). This is a crash scenario.", Name);
|
||||
}
|
||||
}
|
||||
//else
|
||||
|
@ -1573,7 +1576,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
//Console.WriteLine("Move " + m_primName);
|
||||
//Console.WriteLine("Move " + Name);
|
||||
if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009
|
||||
// NON-'VEHICLES' are dealt with here
|
||||
// if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f))
|
||||
|
@ -1605,7 +1608,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
|
||||
if (m_usePID)
|
||||
{
|
||||
//Console.WriteLine("PID " + m_primName);
|
||||
//Console.WriteLine("PID " + Name);
|
||||
// KF - this is for object move? eg. llSetPos() ?
|
||||
//if (!d.BodyIsEnabled(Body))
|
||||
//d.BodySetForce(Body, 0f, 0f, 0f);
|
||||
|
@ -1677,7 +1680,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
// Hover PID Controller needs to be mutually exlusive to MoveTo PID controller
|
||||
if (m_useHoverPID && !m_usePID)
|
||||
{
|
||||
//Console.WriteLine("Hover " + m_primName);
|
||||
//Console.WriteLine("Hover " + Name);
|
||||
|
||||
// If we're using the PID controller, then we have no gravity
|
||||
fz = (-1 * _parent_scene.gravityz) * m_mass;
|
||||
|
@ -1803,7 +1806,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
{ // is not physical, or is not a body or is selected
|
||||
// _zeroPosition = d.BodyGetPosition(Body);
|
||||
return;
|
||||
//Console.WriteLine("Nothing " + m_primName);
|
||||
//Console.WriteLine("Nothing " + Name);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1891,10 +1894,10 @@ Console.WriteLine(" JointCreateFixed");
|
|||
catch (System.AccessViolationException)
|
||||
{
|
||||
prim_geom = IntPtr.Zero;
|
||||
m_log.Error("[PHYSICS]: PrimGeom dead");
|
||||
m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name);
|
||||
}
|
||||
}
|
||||
//Console.WriteLine("changePhysicsStatus for " + m_primName);
|
||||
//Console.WriteLine("changePhysicsStatus for " + Name);
|
||||
changeadd(2f);
|
||||
}
|
||||
if (childPrim)
|
||||
|
@ -2063,7 +2066,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
catch (System.AccessViolationException)
|
||||
{
|
||||
prim_geom = IntPtr.Zero;
|
||||
m_log.Error("[PHYSICS]: PrimGeom dead");
|
||||
m_log.ErrorFormat("[PHYSICS]: PrimGeom dead for {0}", Name);
|
||||
}
|
||||
prim_geom = IntPtr.Zero;
|
||||
// we don't need to do space calculation because the client sends a position update also.
|
||||
|
@ -2307,7 +2310,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got NaN Size on object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN Size on object {0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2329,7 +2332,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: NaN in Force Applied to an Object");
|
||||
m_log.WarnFormat("[PHYSICS]: NaN in Force Applied to an Object {0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2413,7 +2416,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got NaN Velocity in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN Velocity in Object {0}", Name);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2438,7 +2441,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got NaN Torque in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN Torque in Object {0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2465,7 +2468,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
_orientation = value;
|
||||
}
|
||||
else
|
||||
m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object {0}", Name);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -2505,7 +2508,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got Invalid linear force vector from Scene in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got Invalid linear force vector from Scene in Object {0}", Name);
|
||||
}
|
||||
//m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString());
|
||||
}
|
||||
|
@ -2519,7 +2522,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got Invalid Angular force vector from Scene in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got Invalid Angular force vector from Scene in Object {0}", Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2545,7 +2548,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got NaN RotationalVelocity in Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN RotationalVelocity in Object {0}", Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2560,7 +2563,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else if (m_crossingfailures == _parent_scene.geomCrossingFailuresBeforeOutofbounds)
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Too many crossing failures for: " + m_primName);
|
||||
m_log.Warn("[PHYSICS]: Too many crossing failures for: " + Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2593,7 +2596,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[PHYSICS]: Got NaN locking axis from Scene on Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN locking axis from Scene on Object {0}", Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2685,7 +2688,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
}
|
||||
|
||||
//float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation));
|
||||
//Console.WriteLine("Adiff " + m_primName + " = " + Adiff);
|
||||
//Console.WriteLine("Adiff " + Name + " = " + Adiff);
|
||||
if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02)
|
||||
&& (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02)
|
||||
&& (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02)
|
||||
|
@ -2826,7 +2829,7 @@ Console.WriteLine(" JointCreateFixed");
|
|||
m_PIDTarget = value;
|
||||
}
|
||||
else
|
||||
m_log.Warn("[PHYSICS]: Got NaN PIDTarget from Scene on Object");
|
||||
m_log.WarnFormat("[PHYSICS]: Got NaN PIDTarget from Scene on Object {0}", Name);
|
||||
}
|
||||
}
|
||||
public override bool PIDActive { set { m_usePID = value; } }
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
@ -310,9 +310,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
case ScriptBaseClass.LINK_ALL_OTHERS:
|
||||
if (m_host.ParentGroup == null)
|
||||
return new List<SceneObjectPart>();
|
||||
|
||||
|
||||
ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts);
|
||||
|
||||
|
||||
if (ret.Contains(m_host))
|
||||
ret.Remove(m_host);
|
||||
return ret;
|
||||
|
@ -320,9 +320,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
case ScriptBaseClass.LINK_ALL_CHILDREN:
|
||||
if (m_host.ParentGroup == null)
|
||||
return new List<SceneObjectPart>();
|
||||
|
||||
|
||||
ret = new List<SceneObjectPart>(m_host.ParentGroup.Parts);
|
||||
|
||||
|
||||
if (ret.Contains(m_host.ParentGroup.RootPart))
|
||||
ret.Remove(m_host.ParentGroup.RootPart);
|
||||
return ret;
|
||||
|
@ -1540,7 +1540,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
if (face == ScriptBaseClass.ALL_SIDES)
|
||||
face = SceneObjectPart.ALL_SIDES;
|
||||
|
||||
|
||||
m_host.SetFaceColor(new Vector3((float)color.x, (float)color.y, (float)color.z), face);
|
||||
}
|
||||
|
||||
|
@ -2226,7 +2226,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
//KF: Do NOT use this next line if using ODE physics engine. This need a switch based on .ini Phys Engine type
|
||||
// part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition;
|
||||
|
||||
|
||||
// So, after thinking about this for a bit, the issue with the part.ParentGroup.AbsolutePosition = part.ParentGroup.AbsolutePosition line
|
||||
// is it isn't compatible with vehicles because it causes the vehicle body to have to be broken down and rebuilt
|
||||
// It's perfectly okay when the object is not an active physical body though.
|
||||
|
@ -4338,7 +4338,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
case 1: // DATA_ONLINE (0|1)
|
||||
if (pinfo != null && pinfo.RegionID != UUID.Zero)
|
||||
reply = "1";
|
||||
else
|
||||
else
|
||||
reply = "0";
|
||||
break;
|
||||
case 2: // DATA_NAME (First Last)
|
||||
|
@ -4534,7 +4534,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return currentAnimationState;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
|
@ -4650,7 +4650,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
return;
|
||||
|
||||
// Need provisions for Group Owned here
|
||||
if (m_host.OwnerID == targetlandObj.LandData.OwnerID ||
|
||||
if (m_host.OwnerID == targetlandObj.LandData.OwnerID ||
|
||||
targetlandObj.LandData.IsGroupOwned || m_host.OwnerID == targetID)
|
||||
{
|
||||
pushAllowed = true;
|
||||
|
@ -4670,8 +4670,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if ((targetlandObj.LandData.Flags & (uint)ParcelFlags.RestrictPushObject) == (uint)ParcelFlags.RestrictPushObject)
|
||||
{
|
||||
// Need provisions for Group Owned here
|
||||
if (m_host.OwnerID == targetlandObj.LandData.OwnerID ||
|
||||
targetlandObj.LandData.IsGroupOwned ||
|
||||
if (m_host.OwnerID == targetlandObj.LandData.OwnerID ||
|
||||
targetlandObj.LandData.IsGroupOwned ||
|
||||
m_host.OwnerID == targetID)
|
||||
{
|
||||
pushAllowed = true;
|
||||
|
@ -4795,7 +4795,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
return sides;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* The new / changed functions were tested with the following LSL script:
|
||||
|
||||
|
@ -5809,7 +5809,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
flags |= ScriptBaseClass.AGENT_SITTING;
|
||||
}
|
||||
|
||||
if (agent.Animator.Animations.DefaultAnimation.AnimID
|
||||
if (agent.Animator.Animations.DefaultAnimation.AnimID
|
||||
== AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"])
|
||||
{
|
||||
flags |= ScriptBaseClass.AGENT_SITTING;
|
||||
|
@ -6190,7 +6190,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
m_host.AddScriptLPS(1);
|
||||
return World.SimulatorFPS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* particle system rules should be coming into this routine as doubles, that is
|
||||
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
|
|||
|
||||
private void SetParticleSystem(SceneObjectPart part, LSL_List rules) {
|
||||
|
||||
|
||||
|
||||
if (rules.Length == 0)
|
||||
{
|
||||
part.RemoveParticleSystem();
|
||||
|
@ -6444,7 +6444,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (m_host.PhysActor != null)
|
||||
{
|
||||
float ground = (float)llGround(new LSL_Types.Vector3(0, 0, 0));
|
||||
float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0));
|
||||
float waterLevel = (float)llWater(new LSL_Types.Vector3(0, 0, 0));
|
||||
PIDHoverType hoverType = PIDHoverType.Ground;
|
||||
if (water != 0)
|
||||
{
|
||||
|
@ -6458,7 +6458,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
height += ground;
|
||||
}
|
||||
|
||||
|
||||
m_host.SetHoverHeight((float)height, hoverType, (float)tau);
|
||||
}
|
||||
}
|
||||
|
@ -6841,19 +6841,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
if (xmlRpcRouter != null)
|
||||
{
|
||||
string ExternalHostName = m_ScriptEngine.World.RegionInfo.ExternalHostName;
|
||||
|
||||
xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID,
|
||||
m_itemID, String.Format("http://{0}:{1}/", ExternalHostName,
|
||||
|
||||
xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID,
|
||||
m_itemID, String.Format("http://{0}:{1}/", ExternalHostName,
|
||||
xmlrpcMod.Port.ToString()));
|
||||
}
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
new LSL_Integer(1),
|
||||
new LSL_String(channelID.ToString()),
|
||||
new LSL_String(UUID.Zero.ToString()),
|
||||
new LSL_String(String.Empty),
|
||||
new LSL_Integer(0),
|
||||
new LSL_String(String.Empty)
|
||||
object[] resobj = new object[]
|
||||
{
|
||||
new LSL_Integer(1),
|
||||
new LSL_String(channelID.ToString()),
|
||||
new LSL_String(UUID.Zero.ToString()),
|
||||
new LSL_String(String.Empty),
|
||||
new LSL_Integer(0),
|
||||
new LSL_String(String.Empty)
|
||||
};
|
||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams("remote_data", resobj,
|
||||
new DetectParams[0]));
|
||||
|
@ -7242,6 +7242,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
SetPrimParams(m_host, rules);
|
||||
|
||||
ScriptSleep(200);
|
||||
}
|
||||
|
||||
public void llSetLinkPrimitiveParamsFast(int linknumber, LSL_List rules)
|
||||
|
@ -7469,7 +7471,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||
part.Shape.PathCurve = (byte)Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
revolutions, radiusoffset, skew, 0);
|
||||
break;
|
||||
|
||||
|
@ -7489,7 +7491,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||
part.Shape.PathCurve = (byte)Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
revolutions, radiusoffset, skew, 1);
|
||||
break;
|
||||
|
||||
|
@ -7509,7 +7511,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
radiusoffset = (float)rules.GetLSLFloatItem(idx++);
|
||||
skew = (float)rules.GetLSLFloatItem(idx++);
|
||||
part.Shape.PathCurve = (byte)Extrusion.Curve1;
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
SetPrimitiveShapeParams(part, face, v, hollow, twist, holesize, topshear, profilecut, taper_b,
|
||||
revolutions, radiusoffset, skew, 3);
|
||||
break;
|
||||
|
||||
|
@ -7555,7 +7557,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
SetAlpha(part, alpha, face);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_FLEXIBLE:
|
||||
if (remain < 7)
|
||||
return;
|
||||
|
@ -7571,7 +7573,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
SetFlexi(part, flexi, softness, gravity, friction, wind, tension, force);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
|
||||
if (remain < 5)
|
||||
return;
|
||||
|
@ -7584,7 +7586,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
SetPointLight(part, light, lightcolor, intensity, radius, falloff);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_GLOW:
|
||||
if (remain < 2)
|
||||
return;
|
||||
|
@ -7594,7 +7596,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
SetGlow(part, face, glow);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
|
||||
if (remain < 3)
|
||||
return;
|
||||
|
@ -7605,7 +7607,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
SetShiny(part, face, shiny, bump);
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
|
||||
if (remain < 2)
|
||||
return;
|
||||
|
@ -7613,7 +7615,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
bool st = rules.GetLSLIntegerItem(idx++);
|
||||
SetFullBright(part, face , st);
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_MATERIAL:
|
||||
if (remain < 1)
|
||||
return;
|
||||
|
@ -7623,7 +7625,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
part.Material = Convert.ToByte(mat);
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_PHANTOM:
|
||||
if (remain < 1)
|
||||
return;
|
||||
|
@ -7638,7 +7640,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
part.ScriptSetPhantomStatus(phantom);
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_PHYSICS:
|
||||
if (remain < 1)
|
||||
return;
|
||||
|
@ -7652,7 +7654,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
part.ScriptSetPhysicsStatus(physics);
|
||||
break;
|
||||
|
||||
|
||||
case (int)ScriptBaseClass.PRIM_TEMP_ON_REZ:
|
||||
if (remain < 1)
|
||||
return;
|
||||
|
@ -7778,7 +7780,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_Vector llGetRootPosition()
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y,
|
||||
return new LSL_Vector(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y,
|
||||
m_host.ParentGroup.AbsolutePosition.Z);
|
||||
}
|
||||
|
||||
|
@ -8109,8 +8111,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
res.Add(new LSL_Float((Shape.PathRevolutions * 0.015) + 1.0)); // Slightly inaccurate, because an unsigned
|
||||
// byte is being used to represent the entire
|
||||
// range of floating-point values from 1.0
|
||||
// through 4.0 (which is how SL does it).
|
||||
|
||||
// through 4.0 (which is how SL does it).
|
||||
|
||||
// float radiusoffset
|
||||
res.Add(new LSL_Float(Shape.PathRadiusOffset / 100.0));
|
||||
|
||||
|
@ -8391,104 +8393,104 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// Assuming silently fail means give back an empty list. Ideally, need to check this.
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
return new LSL_List();
|
||||
|
||||
|
||||
return GetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
|
||||
private LSL_List GetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
|
||||
|
||||
MediaEntry me = module.GetMediaEntry(m_host, face);
|
||||
|
||||
|
||||
// As per http://wiki.secondlife.com/wiki/LlGetPrimMediaParams
|
||||
if (null == me)
|
||||
return new LSL_List();
|
||||
|
||||
|
||||
LSL_List res = new LSL_List();
|
||||
|
||||
for (int i = 0; i < rules.Length; i++)
|
||||
{
|
||||
int code = (int)rules.GetLSLIntegerItem(i);
|
||||
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
|
||||
// Not implemented
|
||||
res.Add(new LSL_Integer(0));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
|
||||
if (me.Controls == MediaControls.Standard)
|
||||
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD));
|
||||
else
|
||||
res.Add(new LSL_Integer(ScriptBaseClass.PRIM_MEDIA_CONTROLS_MINI));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL:
|
||||
res.Add(new LSL_String(me.CurrentURL));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_HOME_URL:
|
||||
res.Add(new LSL_String(me.HomeURL));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
|
||||
res.Add(me.AutoLoop ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
|
||||
res.Add(me.AutoPlay ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
|
||||
res.Add(me.AutoScale ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
|
||||
res.Add(me.AutoZoom ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
|
||||
res.Add(me.InteractOnFirstClick ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
|
||||
res.Add(new LSL_Integer(me.Width));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
|
||||
res.Add(new LSL_Integer(me.Height));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
|
||||
res.Add(me.EnableWhiteList ? ScriptBaseClass.TRUE : ScriptBaseClass.FALSE);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
|
||||
string[] urls = (string[])me.WhiteList.Clone();
|
||||
|
||||
|
||||
for (int j = 0; j < urls.Length; j++)
|
||||
urls[j] = Uri.EscapeDataString(urls[j]);
|
||||
|
||||
|
||||
res.Add(new LSL_String(string.Join(", ", urls)));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
|
||||
res.Add(new LSL_Integer((int)me.InteractPermissions));
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
|
||||
res.Add(new LSL_Integer((int)me.ControlPermissions));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
public LSL_Integer llSetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
@ -8499,32 +8501,32 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// Don't perform the media check directly
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
|
||||
|
||||
return SetPrimMediaParams(face, rules);
|
||||
}
|
||||
|
||||
|
||||
private LSL_Integer SetPrimMediaParams(int face, LSL_List rules)
|
||||
{
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
|
||||
|
||||
MediaEntry me = module.GetMediaEntry(m_host, face);
|
||||
if (null == me)
|
||||
me = new MediaEntry();
|
||||
|
||||
|
||||
int i = 0;
|
||||
|
||||
|
||||
while (i < rules.Length - 1)
|
||||
{
|
||||
int code = rules.GetLSLIntegerItem(i++);
|
||||
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case ScriptBaseClass.PRIM_MEDIA_ALT_IMAGE_ENABLE:
|
||||
me.EnableAlterntiveImage = (rules.GetLSLIntegerItem(i++) != 0 ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_CONTROLS:
|
||||
int v = rules.GetLSLIntegerItem(i++);
|
||||
if (ScriptBaseClass.PRIM_MEDIA_CONTROLS_STANDARD == v)
|
||||
|
@ -8532,47 +8534,47 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
else
|
||||
me.Controls = MediaControls.Mini;
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_CURRENT_URL:
|
||||
me.CurrentURL = rules.GetLSLStringItem(i++);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_HOME_URL:
|
||||
me.HomeURL = rules.GetLSLStringItem(i++);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_LOOP:
|
||||
me.AutoLoop = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_PLAY:
|
||||
me.AutoPlay = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_SCALE:
|
||||
me.AutoScale = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_AUTO_ZOOM:
|
||||
me.AutoZoom = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_FIRST_CLICK_INTERACT:
|
||||
me.InteractOnFirstClick = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WIDTH_PIXELS:
|
||||
me.Width = (int)rules.GetLSLIntegerItem(i++);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_HEIGHT_PIXELS:
|
||||
me.Height = (int)rules.GetLSLIntegerItem(i++);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST_ENABLE:
|
||||
me.EnableWhiteList = (ScriptBaseClass.TRUE == rules.GetLSLIntegerItem(i++) ? true : false);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_WHITELIST:
|
||||
string[] rawWhiteListUrls = rules.GetLSLStringItem(i++).ToString().Split(new char[] { ',' });
|
||||
List<string> whiteListUrls = new List<string>();
|
||||
|
@ -8580,22 +8582,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
rawWhiteListUrls, delegate(string rawUrl) { whiteListUrls.Add(rawUrl.Trim()); });
|
||||
me.WhiteList = whiteListUrls.ToArray();
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_INTERACT:
|
||||
me.InteractPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
|
||||
break;
|
||||
|
||||
|
||||
case ScriptBaseClass.PRIM_MEDIA_PERMS_CONTROL:
|
||||
me.ControlPermissions = (MediaPermission)(byte)(int)rules.GetLSLIntegerItem(i++);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.SetMediaEntry(m_host, face, me);
|
||||
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
public LSL_Integer llClearPrimMedia(LSL_Integer face)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
@ -8606,16 +8608,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
// FIXME: Don't perform the media check directly
|
||||
if (face < 0 || face > m_host.GetNumberOfSides() - 1)
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
|
||||
|
||||
IMoapModule module = m_ScriptEngine.World.RequestModuleInterface<IMoapModule>();
|
||||
if (null == module)
|
||||
throw new Exception("Media on a prim functions not available");
|
||||
|
||||
|
||||
module.ClearMediaEntry(m_host, face);
|
||||
|
||||
|
||||
return ScriptBaseClass.LSL_STATUS_OK;
|
||||
}
|
||||
|
||||
|
||||
// <remarks>
|
||||
// <para>
|
||||
// The .NET definition of base 64 is:
|
||||
|
@ -8875,7 +8877,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public LSL_String llGetHTTPHeader(LSL_Key request_id, string header)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
|
||||
|
||||
if (m_UrlModule != null)
|
||||
return m_UrlModule.GetHttpHeader(new UUID(request_id), header);
|
||||
return String.Empty;
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -2247,6 +2247,8 @@
|
|||
<Reference name="OpenMetaverseTypes" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse" path="../../../bin/"/>
|
||||
<Reference name="OpenMetaverse.StructuredData" path="../../../bin/"/>
|
||||
<Reference name="Community.CsharpSqlite"/>
|
||||
<Reference name="Community.CsharpSqlite.Sqlite"/>
|
||||
<Reference name="Mono.Data.Sqlite"/>
|
||||
<Reference name="Mono.Addins" path="../../../bin/"/>
|
||||
<Reference name="log4net" path="../../../bin/"/>
|
||||
|
|
Loading…
Reference in New Issue