Implements llGetObjectDetails()

0.6.0-stable
alondria 2008-03-21 20:04:52 +00:00
parent 45ea156804
commit 181c5ab7d7
3 changed files with 95 additions and 0 deletions

View File

@ -1843,6 +1843,11 @@ namespace OpenSim.Region.ScriptEngine.Common
return m_LSL_Functions.llStringTrim(src, type); return m_LSL_Functions.llStringTrim(src, type);
} }
public LSL_Types.list llGetObjectDetails(string id, LSL_Types.list args)
{
return m_LSL_Functions.llGetObjectDetails(id, args);
}
// //
// OpenSim Functions // OpenSim Functions
// //
@ -2339,6 +2344,15 @@ namespace OpenSim.Region.ScriptEngine.Common
public const int DEBUG_CHANNEL = 0x7FFFFFFF; public const int DEBUG_CHANNEL = 0x7FFFFFFF;
public const int PUBLIC_CHANNEL = 0x00000000; public const int PUBLIC_CHANNEL = 0x00000000;
public const int OBJECT_NAME = 1;
public const int OBJECT_DESC = 2;
public const int OBJECT_POS = 3;
public const int OBJECT_ROT = 4;
public const int OBJECT_VELOCITY = 5;
public const int OBJECT_OWNER = 6;
public const int OBJECT_GROUP = 7;
public const int OBJECT_CREATOR = 8;
// Can not be public const? // Can not be public const?
public vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0); public vector ZERO_VECTOR = new vector(0.0, 0.0, 0.0);
public rotation ZERO_ROTATION = new rotation(0.0, 0, 0.0, 1.0); public rotation ZERO_ROTATION = new rotation(0.0, 0, 0.0, 1.0);

View File

@ -4532,6 +4532,86 @@ namespace OpenSim.Region.ScriptEngine.Common
return src; return src;
} }
public LSL_Types.list llGetObjectDetails(string id, LSL_Types.list args)
{
LSL_Types.list ret = new LSL_Types.list();
LLUUID key = new LLUUID();
if (LLUUID.TryParse(id, out key))
{
if (World.m_innerScene.ScenePresences.ContainsKey(key))
{
ScenePresence av = World.m_innerScene.ScenePresences[key];
foreach(object o in args.Data)
{
switch(o.ToString())
{
case "1":
ret.Add(av.Firstname + " " + av.Lastname);
break;
case "2":
ret.Add("");
break;
case "3":
ret.Add(new LSL_Types.Vector3((double)av.AbsolutePosition.X, (double)av.AbsolutePosition.Y, (double)av.AbsolutePosition.Z));
break;
case "4":
ret.Add(new LSL_Types.Quaternion((double)av.Rotation.x, (double)av.Rotation.y, (double)av.Rotation.z, (double)av.Rotation.w));
break;
case "5":
ret.Add(new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z));
break;
case "6":
ret.Add(id);
break;
case "7":
ret.Add(LLUUID.Zero.ToString());
break;
case "8":
ret.Add(LLUUID.Zero.ToString());
break;
}
}
return ret;
}
SceneObjectPart obj = World.GetSceneObjectPart(key);
if (obj != null)
{
foreach(object o in args.Data)
{
switch(o.ToString())
{
case "1":
ret.Add(obj.Name);
break;
case "2":
ret.Add(obj.Description);
break;
case "3":
ret.Add(new LSL_Types.Vector3(obj.AbsolutePosition.X,obj.AbsolutePosition.Y,obj.AbsolutePosition.Z));
break;
case "4":
ret.Add(new LSL_Types.Quaternion(obj.RotationOffset.X, obj.RotationOffset.Y, obj.RotationOffset.Z, obj.RotationOffset.W));
break;
case "5":
ret.Add(new LSL_Types.Vector3(obj.Velocity.X, obj.Velocity.Y, obj.Velocity.Z));
break;
case "6":
ret.Add(obj.OwnerID.ToString());
break;
case "7":
ret.Add(obj.GroupID.ToString());
break;
case "8":
ret.Add(obj.CreatorID.ToString());
break;
}
}
return ret;
}
}
return new LSL_Types.list();
}
// //
// OpenSim functions // OpenSim functions
// //

View File

@ -635,6 +635,7 @@ namespace OpenSim.Region.ScriptEngine.Common
//wiki list llGetParcelDetails(vector pos, list params) //wiki list llGetParcelDetails(vector pos, list params)
LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param); LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param);
string llStringTrim(string src, int type); string llStringTrim(string src, int type);
LSL_Types.list llGetObjectDetails(string id, LSL_Types.list args);
//OpenSim functions //OpenSim functions
string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer); string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, int timer);
string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams, string osSetDynamicTextureURLBlend(string dynamicID, string contentType, string url, string extraParams,