Mantis#2045. Thank you kindly, Tyre for a patch that:

This patch adds even more LSL compatibility to llSetPos() As stated in the 
wiki http://wiki.secondlife.com/wiki/LlSetPos, [^] movement should also be 
capped to 10m per call for unattached root prims.
Beside this issue the attached patch adds (hopefully) all known LSL script 
delays (as ScriptSleep(), but still commented out) to LSL_BuiltIn_Commands.cs 
and LSL_Api.cs and a lot of format cleanup.
0.6.0-stable
Charles Krinke 2008-08-25 21:39:36 +00:00
parent 3d2069f3d9
commit a055d3c2e8
2 changed files with 534 additions and 427 deletions

File diff suppressed because it is too large Load Diff

View File

@ -120,20 +120,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
throw new EventAbortException(); throw new EventAbortException();
} }
public void llSay(int channelID, string text)
{
m_host.AddScriptLPS(1);
if (text.Length > 1023)
text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
}
// Extension commands use this: // Extension commands use this:
public ICommander GetCommander(string name) public ICommander GetCommander(string name)
{ {
@ -569,6 +555,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
} }
public void llSay(int channelID, string text)
{
m_host.AddScriptLPS(1);
if (text.Length > 1023)
text = text.Substring(0, 1023);
World.SimChat(Helpers.StringToField(text),
ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
}
public void llShout(int channelID, string text) public void llShout(int channelID, string text)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -1312,6 +1312,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
SetTexture(m_host, texture, face); SetTexture(m_host, texture, face);
// ScriptSleep(200);
} }
private void SetTexture(SceneObjectPart part, string texture, int face) private void SetTexture(SceneObjectPart part, string texture, int face)
@ -1356,6 +1357,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ScaleTexture(m_host, u, v, face); ScaleTexture(m_host, u, v, face);
// ScriptSleep(200);
} }
private void ScaleTexture(SceneObjectPart part, double u, double v, int face) private void ScaleTexture(SceneObjectPart part, double u, double v, int face)
@ -1391,6 +1393,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
OffsetTexture(m_host, u, v, face); OffsetTexture(m_host, u, v, face);
// ScriptSleep(200);
} }
private void OffsetTexture(SceneObjectPart part, double u, double v, int face) private void OffsetTexture(SceneObjectPart part, double u, double v, int face)
@ -1426,6 +1429,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
RotateTexture(m_host, rotation, face); RotateTexture(m_host, rotation, face);
// ScriptSleep(200);
} }
private void RotateTexture(SceneObjectPart part, double rotation, int face) private void RotateTexture(SceneObjectPart part, double rotation, int face)
@ -1479,17 +1483,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
SetPos(m_host, pos); SetPos(m_host, pos);
ScriptSleep(200);
} }
private void SetPos(SceneObjectPart part, LSL_Types.Vector3 pos) private void SetPos(SceneObjectPart part, LSL_Types.Vector3 targetPos)
{ {
// Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
LSL_Types.Vector3 currentPos = llGetLocalPos();
if (llVecDist(currentPos, targetPos) > 10)
{
targetPos = currentPos + 10 * llVecNorm(targetPos - currentPos);
}
if (part.ParentID != 0) if (part.ParentID != 0)
{ {
part.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); part.UpdateOffSet(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
} }
else else
{ {
part.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); part.UpdateGroupPosition(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
} }
} }
@ -1523,6 +1536,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
SetRot(m_host, rot); SetRot(m_host, rot);
ScriptSleep(200);
} }
private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot) private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot)
@ -1800,6 +1815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.PreloadSound(sound); m_host.PreloadSound(sound);
// ScriptSleep(1000);
} }
/// <summary> /// <summary>
@ -2083,30 +2099,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llMakeExplosion"); NotImplemented("llMakeExplosion");
// ScriptSleep(100);
} }
public void llMakeFountain() public void llMakeFountain()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llMakeFountain"); NotImplemented("llMakeFountain");
// ScriptSleep(100);
} }
public void llMakeSmoke() public void llMakeSmoke()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llMakeSmoke"); NotImplemented("llMakeSmoke");
// ScriptSleep(100);
} }
public void llMakeFire() public void llMakeFire()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llMakeFire"); NotImplemented("llMakeFire");
// ScriptSleep(100);
} }
public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param) public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
//NotImplemented("llRezObject");
bool found = false; bool found = false;
// Instead of using return;, I'm using continue; because in our TaskInventory implementation // Instead of using return;, I'm using continue; because in our TaskInventory implementation
@ -2157,8 +2176,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
//Recoil. //Recoil.
llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0);
found = true; found = true;
//script delay // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
ScriptSleep((int)((groupmass * velmag) / 10)); ScriptSleep((int)((groupmass * velmag) / 10));
// ScriptSleep(100);
break; break;
} }
} }
@ -2332,6 +2352,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID; msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID;
msg.binaryBucket = new byte[0];// binaryBucket; msg.binaryBucket = new byte[0];// binaryBucket;
World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
// ScriptSleep(2000);
// NotImplemented("llInstantMessage"); // NotImplemented("llInstantMessage");
} }
@ -2343,6 +2365,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
emailModule.SendEmail(m_host.UUID, address, subject, message); emailModule.SendEmail(m_host.UUID, address, subject, message);
// ScriptSleep(20000);
} }
public void llGetNextEmail(string address, string subject) public void llGetNextEmail(string address, string subject)
@ -2813,9 +2836,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected);
parentPrim.GetProperties(client); parentPrim.GetProperties(client);
// sleep for 1 second
ScriptSleep(1000); ScriptSleep(1000);
} }
public void llBreakLink(int linknum) public void llBreakLink(int linknum)
@ -2962,9 +2983,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// destination is an object // destination is an object
World.MoveTaskInventoryItem(destId, m_host, objId); World.MoveTaskInventoryItem(destId, m_host, objId);
} }
// ScriptSleep(3000);
} }
public void llRemoveInventory(string item) public void llRemoveInventory(string name)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llRemoveInventory"); NotImplemented("llRemoveInventory");
@ -3040,6 +3062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
AsyncCommands. AsyncCommands.
DataserverPlugin.DataserverReply(rq.ToString(), reply); DataserverPlugin.DataserverReply(rq.ToString(), reply);
// ScriptSleep(100);
return tid.ToString(); return tid.ToString();
} }
@ -3075,10 +3098,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
reply); reply);
}, false); }, false);
// ScriptSleep(1000);
return tid.ToString(); return tid.ToString();
} }
} }
// ScriptSleep(1000);
return String.Empty; return String.Empty;
} }
@ -3102,6 +3126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
World.TeleportClientHome(agentId, presence.ControllingClient); World.TeleportClientHome(agentId, presence.ControllingClient);
} }
} }
// ScriptSleep(5000);
} }
public void llModifyLand(int action, int brush) public void llModifyLand(int action, int brush)
@ -3351,7 +3376,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// except that it refers to scripting constants // except that it refers to scripting constants
private int getScriptPrimType(PrimitiveBaseShape primShape) private int getScriptPrimType(PrimitiveBaseShape primShape)
{ {
if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0)
return ScriptBaseClass.PRIM_TYPE_SCULPT; return ScriptBaseClass.PRIM_TYPE_SCULPT;
if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
@ -3382,9 +3406,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return ScriptBaseClass.PRIM_TYPE_RING; return ScriptBaseClass.PRIM_TYPE_RING;
} }
return ScriptBaseClass.PRIM_TYPE_BOX; return ScriptBaseClass.PRIM_TYPE_BOX;
} }
// Helper functions to understand if object has cut, hollow, dimple, and other affecting number of faces // Helper functions to understand if object has cut, hollow, dimple, and other affecting number of faces
private void hasCutHollowDimpleProfileCut(int primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, private void hasCutHollowDimpleProfileCut(int primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow,
out bool hasDimple, out bool hasProfileCut) out bool hasDimple, out bool hasProfileCut)
@ -3462,7 +3485,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret = 1; ret = 1;
break; break;
} }
return ret; return ret;
} }
@ -4304,6 +4326,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.AdjustSoundGain(volume); m_host.AdjustSoundGain(volume);
// ScriptSleep(100);
} }
public void llSetSoundQueueing(int queue) public void llSetSoundQueueing(int queue)
@ -4902,6 +4925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
land.ParcelAccessList.Add(entry); land.ParcelAccessList.Add(entry);
} }
} }
// ScriptSleep(100);
} }
public void llSetTouchText(string text) public void llSetTouchText(string text)
@ -4989,6 +5013,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
buts[i] = buttons.Data[i].ToString(); buts[i] = buttons.Data[i].ToString();
} }
World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
// ScriptSleep(1000);
} }
public void llVolumeDetect(int detect) public void llVolumeDetect(int detect)
@ -5037,6 +5062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
Deprecated("llRemoteLoadScript"); Deprecated("llRemoteLoadScript");
// ScriptSleep(3000);
} }
public void llSetRemoteScriptAccessPin(int pin) public void llSetRemoteScriptAccessPin(int pin)
@ -5049,13 +5075,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llRemoteLoadScriptPin"); NotImplemented("llRemoteLoadScriptPin");
ScriptSleep(3000);
} }
// remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
// Not sure where these constants should live:
// REMOTE_DATA_CHANNEL = 1
// REMOTE_DATA_REQUEST = 2
// REMOTE_DATA_REPLY = 3
public void llOpenRemoteDataChannel() public void llOpenRemoteDataChannel()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
@ -5068,12 +5090,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
"remote_data", resobj, "remote_data", resobj,
new DetectParams[0])); new DetectParams[0]));
} }
// ScriptSleep(1000);
} }
public string llSendRemoteData(string channel, string dest, int idata, string sdata) public string llSendRemoteData(string channel, string dest, int idata, string sdata)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
// ScriptSleep(3000);
return (xmlrpcMod.SendRemoteData(m_localID, m_itemID, channel, dest, idata, sdata)).ToString(); return (xmlrpcMod.SendRemoteData(m_localID, m_itemID, channel, dest, idata, sdata)).ToString();
} }
@ -5082,6 +5106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
// ScriptSleep(3000);
} }
public void llCloseRemoteDataChannel(string channel) public void llCloseRemoteDataChannel(string channel)
@ -5089,6 +5114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
xmlrpcMod.CloseXMLRPCChannel(channel); xmlrpcMod.CloseXMLRPCChannel(channel);
// ScriptSleep(1000);
} }
public string llMD5String(string src, int nonce) public string llMD5String(string src, int nonce)
@ -5782,6 +5808,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
Deprecated("llXorBase64Strings"); Deprecated("llXorBase64Strings");
// ScriptSleep(300);
} }
public void llRemoteDataSetRegion() public void llRemoteDataSetRegion()
@ -5830,6 +5857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
} }
World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
// ScriptSleep(2000);
} }
public void osSetParcelMediaURL(string url) public void osSetParcelMediaURL(string url)
@ -6048,7 +6076,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
case ScriptBaseClass.PRIM_TYPE_BOX: case ScriptBaseClass.PRIM_TYPE_BOX:
case ScriptBaseClass.PRIM_TYPE_CYLINDER: case ScriptBaseClass.PRIM_TYPE_CYLINDER:
case ScriptBaseClass.PRIM_TYPE_PRISM: case ScriptBaseClass.PRIM_TYPE_PRISM:
res.Add(new LSL_Types.LSLInteger(Shape.ProfileCurve)); res.Add(new LSL_Types.LSLInteger(Shape.ProfileCurve));
res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0)); res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0));
@ -6063,16 +6090,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0)); res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0));
res.Add(new LSL_Types.Vector3(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0)); res.Add(new LSL_Types.Vector3(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
break; break;
case ScriptBaseClass.PRIM_TYPE_SCULPT: case ScriptBaseClass.PRIM_TYPE_SCULPT:
res.Add(Shape.SculptTexture.ToString()); res.Add(Shape.SculptTexture.ToString());
res.Add(new LSL_Types.LSLInteger(Shape.SculptType)); res.Add(new LSL_Types.LSLInteger(Shape.SculptType));
break; break;
case ScriptBaseClass.PRIM_TYPE_RING: case ScriptBaseClass.PRIM_TYPE_RING:
case ScriptBaseClass.PRIM_TYPE_TUBE: case ScriptBaseClass.PRIM_TYPE_TUBE:
case ScriptBaseClass.PRIM_TYPE_TORUS: case ScriptBaseClass.PRIM_TYPE_TORUS:
@ -6111,8 +6135,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
res.Add(new LSL_Types.LSLFloat(Shape.PathSkew / 100.0)); res.Add(new LSL_Types.LSLFloat(Shape.PathSkew / 100.0));
break; break;
} }
break; break;
@ -6141,7 +6163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (remain < 1) if (remain < 1)
return res; return res;
face=Convert.ToInt32(rules.Data[idx++]); face=Convert.ToInt32("" + rules.Data[idx++]);
tex = m_host.Shape.Textures; tex = m_host.Shape.Textures;
LLColor texcolor; LLColor texcolor;
@ -6499,6 +6521,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
// ScriptSleep(200);
} }
// <summary> // <summary>
@ -6818,7 +6841,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
case 5: // DATA_SIM_POS case 5: // DATA_SIM_POS
if (info == null) if (info == null)
{
// ScriptSleep(1000);
return LLUUID.Zero.ToString(); return LLUUID.Zero.ToString();
}
reply = new LSL_Types.Vector3( reply = new LSL_Types.Vector3(
info.RegionLocX * Constants.RegionSize, info.RegionLocX * Constants.RegionSize,
info.RegionLocY * Constants.RegionSize, info.RegionLocY * Constants.RegionSize,
@ -6832,7 +6858,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
break; break;
case 7: // DATA_SIM_RATING case 7: // DATA_SIM_RATING
if (info == null) if (info == null)
{
// ScriptSleep(1000);
return LLUUID.Zero.ToString(); return LLUUID.Zero.ToString();
}
int access = info.RegionSettings.Maturity; int access = info.RegionSettings.Maturity;
if (access == 0) if (access == 0)
reply = "PG"; reply = "PG";
@ -6845,17 +6874,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
reply = m_ScriptEngine.World.GetSimulatorVersion(); reply = m_ScriptEngine.World.GetSimulatorVersion();
break; break;
default: default:
// ScriptSleep(1000);
return LLUUID.Zero.ToString(); // Raise no event return LLUUID.Zero.ToString(); // Raise no event
} }
LLUUID rq = LLUUID.Random(); LLUUID rq = LLUUID.Random();
LLUUID tid = AsyncCommands. LLUUID tid = AsyncCommands.
DataserverPlugin.RegisterRequest(m_localID, DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString());
m_itemID, rq.ToString());
AsyncCommands. AsyncCommands.
DataserverPlugin.DataserverReply(rq.ToString(), reply); DataserverPlugin.DataserverReply(rq.ToString(), reply);
// ScriptSleep(1000);
return tid.ToString(); return tid.ToString();
} }
catch(Exception e) catch(Exception e)
@ -6970,6 +7000,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LLUUID avatarId = new LLUUID(avatar_id); LLUUID avatarId = new LLUUID(avatar_id);
m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
url); url);
// ScriptSleep(10000);
} }
public void llParcelMediaCommandList(LSL_Types.list commandList) public void llParcelMediaCommandList(LSL_Types.list commandList)
@ -7056,7 +7087,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}//end switch }//end switch
} }
// ScriptSleep(2000);
//NotImplemented("llParcelMediaCommandList"); //NotImplemented("llParcelMediaCommandList");
} }
@ -7096,8 +7127,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
// ScriptSleep(2000);
return list; return list;
} }
public LSL_Types.LSLInteger llModPow(int a, int b, int c) public LSL_Types.LSLInteger llModPow(int a, int b, int c)
@ -7105,6 +7136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
Int64 tmp = 0; Int64 tmp = 0;
Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp);
// ScriptSleep(1000);
return Convert.ToInt32(tmp); return Convert.ToInt32(tmp);
} }
@ -7151,9 +7183,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_Types.Vector3(); return new LSL_Types.Vector3();
} }
ScenePresence presence = World.GetScenePresence(m_host.OwnerID); ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
if (presence != null)
{
LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
return pos; return pos;
} }
return new LSL_Types.Vector3();
}
public LSL_Types.Quaternion llGetCameraRot() public LSL_Types.Quaternion llGetCameraRot()
{ {
@ -7166,12 +7202,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llSetPrimURL"); NotImplemented("llSetPrimURL");
// ScriptSleep(2000);
} }
public void llRefreshPrimURL() public void llRefreshPrimURL()
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llRefreshPrimURL"); NotImplemented("llRefreshPrimURL");
// ScriptSleep(20000);
} }
public string llEscapeURL(string url) public string llEscapeURL(string url)
@ -7204,6 +7242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
NotImplemented("llMapDestination"); NotImplemented("llMapDestination");
// ScriptSleep(1000);
} }
public void llAddToLandBanList(string avatar, double hours) public void llAddToLandBanList(string avatar, double hours)
@ -7222,6 +7261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
land.ParcelAccessList.Add(entry); land.ParcelAccessList.Add(entry);
} }
} }
// ScriptSleep(100);
} }
public void llRemoveFromLandPassList(string avatar) public void llRemoveFromLandPassList(string avatar)
@ -7243,6 +7283,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
// ScriptSleep(100);
} }
public void llRemoveFromLandBanList(string avatar) public void llRemoveFromLandBanList(string avatar)
@ -7264,6 +7305,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
// ScriptSleep(100);
} }
public void llSetCameraParams(LSL_Types.list rules) public void llSetCameraParams(LSL_Types.list rules)
@ -7471,6 +7513,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
// ScriptSleep(100);
} }
public void llResetLandPassList() public void llResetLandPassList()
@ -7487,6 +7530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
} }
// ScriptSleep(100);
} }
public LSL_Types.LSLInteger llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) public LSL_Types.LSLInteger llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
@ -7565,6 +7609,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ret.Add(d.Value); ret.Add(d.Value);
} }
} }
// ScriptSleep(2000);
return ret; return ret;
} }
@ -7661,6 +7706,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return; return;
SetTexture(part, texture, face); SetTexture(part, texture, face);
// ScriptSleep(200);
} }
public string llStringTrim(string src, int type) public string llStringTrim(string src, int type)
@ -7810,6 +7856,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
AsyncCommands. AsyncCommands.
DataserverPlugin.DataserverReply(item.AssetID.ToString(), DataserverPlugin.DataserverReply(item.AssetID.ToString(),
NotecardCache.GetLines(item.AssetID).ToString()); NotecardCache.GetLines(item.AssetID).ToString());
// ScriptSleep(100);
return tid.ToString(); return tid.ToString();
} }
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
@ -7823,10 +7870,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
DataserverPlugin.DataserverReply(id.ToString(), DataserverPlugin.DataserverReply(id.ToString(),
NotecardCache.GetLines(id).ToString()); NotecardCache.GetLines(id).ToString());
}); });
// ScriptSleep(100);
return tid.ToString(); return tid.ToString();
} }
} }
// ScriptSleep(100);
return LLUUID.Zero.ToString(); return LLUUID.Zero.ToString();
} }
@ -7846,6 +7894,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
AsyncCommands. AsyncCommands.
DataserverPlugin.DataserverReply(item.AssetID.ToString(), DataserverPlugin.DataserverReply(item.AssetID.ToString(),
NotecardCache.GetLine(item.AssetID, line)); NotecardCache.GetLine(item.AssetID, line));
// ScriptSleep(100);
return tid.ToString(); return tid.ToString();
} }
WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
@ -7860,10 +7909,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
NotecardCache.GetLine(id, line)); NotecardCache.GetLine(id, line));
}); });
// ScriptSleep(100);
return tid.ToString(); return tid.ToString();
} }
} }
// ScriptSleep(100);
return String.Empty; return String.Empty;
} }