aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs171
1 files changed, 111 insertions, 60 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c939f74..2b99ce6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -120,20 +120,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
120 throw new EventAbortException(); 120 throw new EventAbortException();
121 } 121 }
122 122
123 public void llSay(int channelID, string text)
124 {
125 m_host.AddScriptLPS(1);
126
127 if (text.Length > 1023)
128 text = text.Substring(0, 1023);
129
130 World.SimChat(Helpers.StringToField(text),
131 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
132
133 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
134 wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
135 }
136
137 // Extension commands use this: 123 // Extension commands use this:
138 public ICommander GetCommander(string name) 124 public ICommander GetCommander(string name)
139 { 125 {
@@ -569,6 +555,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
569 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text); 555 wComm.DeliverMessage(ChatTypeEnum.Whisper, channelID, m_host.Name, m_host.UUID, text);
570 } 556 }
571 557
558 public void llSay(int channelID, string text)
559 {
560 m_host.AddScriptLPS(1);
561
562 if (text.Length > 1023)
563 text = text.Substring(0, 1023);
564
565 World.SimChat(Helpers.StringToField(text),
566 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID, false);
567
568 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
569 wComm.DeliverMessage(ChatTypeEnum.Say, channelID, m_host.Name, m_host.UUID, text);
570 }
571
572 public void llShout(int channelID, string text) 572 public void llShout(int channelID, string text)
573 { 573 {
574 m_host.AddScriptLPS(1); 574 m_host.AddScriptLPS(1);
@@ -1312,6 +1312,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1312 { 1312 {
1313 m_host.AddScriptLPS(1); 1313 m_host.AddScriptLPS(1);
1314 SetTexture(m_host, texture, face); 1314 SetTexture(m_host, texture, face);
1315 // ScriptSleep(200);
1315 } 1316 }
1316 1317
1317 private void SetTexture(SceneObjectPart part, string texture, int face) 1318 private void SetTexture(SceneObjectPart part, string texture, int face)
@@ -1356,6 +1357,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1356 m_host.AddScriptLPS(1); 1357 m_host.AddScriptLPS(1);
1357 1358
1358 ScaleTexture(m_host, u, v, face); 1359 ScaleTexture(m_host, u, v, face);
1360 // ScriptSleep(200);
1359 } 1361 }
1360 1362
1361 private void ScaleTexture(SceneObjectPart part, double u, double v, int face) 1363 private void ScaleTexture(SceneObjectPart part, double u, double v, int face)
@@ -1391,6 +1393,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1391 { 1393 {
1392 m_host.AddScriptLPS(1); 1394 m_host.AddScriptLPS(1);
1393 OffsetTexture(m_host, u, v, face); 1395 OffsetTexture(m_host, u, v, face);
1396 // ScriptSleep(200);
1394 } 1397 }
1395 1398
1396 private void OffsetTexture(SceneObjectPart part, double u, double v, int face) 1399 private void OffsetTexture(SceneObjectPart part, double u, double v, int face)
@@ -1426,6 +1429,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1426 { 1429 {
1427 m_host.AddScriptLPS(1); 1430 m_host.AddScriptLPS(1);
1428 RotateTexture(m_host, rotation, face); 1431 RotateTexture(m_host, rotation, face);
1432 // ScriptSleep(200);
1429 } 1433 }
1430 1434
1431 private void RotateTexture(SceneObjectPart part, double rotation, int face) 1435 private void RotateTexture(SceneObjectPart part, double rotation, int face)
@@ -1479,17 +1483,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1479 m_host.AddScriptLPS(1); 1483 m_host.AddScriptLPS(1);
1480 1484
1481 SetPos(m_host, pos); 1485 SetPos(m_host, pos);
1486
1487 ScriptSleep(200);
1482 } 1488 }
1483 1489
1484 private void SetPos(SceneObjectPart part, LSL_Types.Vector3 pos) 1490 private void SetPos(SceneObjectPart part, LSL_Types.Vector3 targetPos)
1485 { 1491 {
1492 // Capped movemment if distance > 10m (http://wiki.secondlife.com/wiki/LlSetPos)
1493 LSL_Types.Vector3 currentPos = llGetLocalPos();
1494 if (llVecDist(currentPos, targetPos) > 10)
1495 {
1496 targetPos = currentPos + 10 * llVecNorm(targetPos - currentPos);
1497 }
1498
1486 if (part.ParentID != 0) 1499 if (part.ParentID != 0)
1487 { 1500 {
1488 part.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 1501 part.UpdateOffSet(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
1489 } 1502 }
1490 else 1503 else
1491 { 1504 {
1492 part.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 1505 part.UpdateGroupPosition(new LLVector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z));
1493 } 1506 }
1494 } 1507 }
1495 1508
@@ -1523,6 +1536,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1523 m_host.AddScriptLPS(1); 1536 m_host.AddScriptLPS(1);
1524 1537
1525 SetRot(m_host, rot); 1538 SetRot(m_host, rot);
1539
1540 ScriptSleep(200);
1526 } 1541 }
1527 1542
1528 private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot) 1543 private void SetRot(SceneObjectPart part, LSL_Types.Quaternion rot)
@@ -1628,11 +1643,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1628 //No energy force yet 1643 //No energy force yet
1629 1644
1630 if (force.x > 20000) 1645 if (force.x > 20000)
1631 force.x = 20000; 1646 force.x = 20000;
1632 if (force.y > 20000) 1647 if (force.y > 20000)
1633 force.y = 20000; 1648 force.y = 20000;
1634 if (force.z > 20000) 1649 if (force.z > 20000)
1635 force.z = 20000; 1650 force.z = 20000;
1636 1651
1637 m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), local != 0); 1652 m_host.ApplyImpulse(new LLVector3((float)force.x, (float)force.y, (float)force.z), local != 0);
1638 } 1653 }
@@ -1683,7 +1698,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1683 public double llGetTimeOfDay() 1698 public double llGetTimeOfDay()
1684 { 1699 {
1685 m_host.AddScriptLPS(1); 1700 m_host.AddScriptLPS(1);
1686 return (double) (((DateTime.Now.TimeOfDay.TotalMilliseconds / 1000) % (3600*4))*World.TimeDilation); 1701 return (double)(((DateTime.Now.TimeOfDay.TotalMilliseconds / 1000) % (3600 * 4)) * World.TimeDilation);
1687 } 1702 }
1688 1703
1689 public double llGetWallclock() 1704 public double llGetWallclock()
@@ -1800,6 +1815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1800 { 1815 {
1801 m_host.AddScriptLPS(1); 1816 m_host.AddScriptLPS(1);
1802 m_host.PreloadSound(sound); 1817 m_host.PreloadSound(sound);
1818 // ScriptSleep(1000);
1803 } 1819 }
1804 1820
1805 /// <summary> 1821 /// <summary>
@@ -2083,30 +2099,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2083 { 2099 {
2084 m_host.AddScriptLPS(1); 2100 m_host.AddScriptLPS(1);
2085 NotImplemented("llMakeExplosion"); 2101 NotImplemented("llMakeExplosion");
2102 // ScriptSleep(100);
2086 } 2103 }
2087 2104
2088 public void llMakeFountain() 2105 public void llMakeFountain()
2089 { 2106 {
2090 m_host.AddScriptLPS(1); 2107 m_host.AddScriptLPS(1);
2091 NotImplemented("llMakeFountain"); 2108 NotImplemented("llMakeFountain");
2109 // ScriptSleep(100);
2092 } 2110 }
2093 2111
2094 public void llMakeSmoke() 2112 public void llMakeSmoke()
2095 { 2113 {
2096 m_host.AddScriptLPS(1); 2114 m_host.AddScriptLPS(1);
2097 NotImplemented("llMakeSmoke"); 2115 NotImplemented("llMakeSmoke");
2116 // ScriptSleep(100);
2098 } 2117 }
2099 2118
2100 public void llMakeFire() 2119 public void llMakeFire()
2101 { 2120 {
2102 m_host.AddScriptLPS(1); 2121 m_host.AddScriptLPS(1);
2103 NotImplemented("llMakeFire"); 2122 NotImplemented("llMakeFire");
2123 // ScriptSleep(100);
2104 } 2124 }
2105 2125
2106 public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param) 2126 public void llRezAtRoot(string inventory, LSL_Types.Vector3 pos, LSL_Types.Vector3 vel, LSL_Types.Quaternion rot, int param)
2107 { 2127 {
2108 m_host.AddScriptLPS(1); 2128 m_host.AddScriptLPS(1);
2109 //NotImplemented("llRezObject");
2110 bool found = false; 2129 bool found = false;
2111 2130
2112 // Instead of using return;, I'm using continue; because in our TaskInventory implementation 2131 // Instead of using return;, I'm using continue; because in our TaskInventory implementation
@@ -2157,8 +2176,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2157 //Recoil. 2176 //Recoil.
2158 llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0); 2177 llApplyImpulse(new LSL_Types.Vector3(llvel.X * groupmass, llvel.Y * groupmass, llvel.Z * groupmass), 0);
2159 found = true; 2178 found = true;
2160 //script delay 2179 // Variable script delay? (see (http://wiki.secondlife.com/wiki/LSL_Delay)
2161 ScriptSleep((int)((groupmass * velmag) / 10)); 2180 ScriptSleep((int)((groupmass * velmag) / 10));
2181 // ScriptSleep(100);
2162 break; 2182 break;
2163 } 2183 }
2164 } 2184 }
@@ -2332,6 +2352,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2332 msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID; 2352 msg.RegionID = World.RegionInfo.RegionID.UUID;//RegionID.UUID;
2333 msg.binaryBucket = new byte[0];// binaryBucket; 2353 msg.binaryBucket = new byte[0];// binaryBucket;
2334 World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule); 2354 World.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
2355 // ScriptSleep(2000);
2356
2335 // NotImplemented("llInstantMessage"); 2357 // NotImplemented("llInstantMessage");
2336 } 2358 }
2337 2359
@@ -2343,6 +2365,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2343 return; 2365 return;
2344 2366
2345 emailModule.SendEmail(m_host.UUID, address, subject, message); 2367 emailModule.SendEmail(m_host.UUID, address, subject, message);
2368 // ScriptSleep(20000);
2346 } 2369 }
2347 2370
2348 public void llGetNextEmail(string address, string subject) 2371 public void llGetNextEmail(string address, string subject)
@@ -2813,9 +2836,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2813 parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected); 2836 parentPrim.RootPart.AddFlag(LLObject.ObjectFlags.CreateSelected);
2814 parentPrim.GetProperties(client); 2837 parentPrim.GetProperties(client);
2815 2838
2816 // sleep for 1 second
2817 ScriptSleep(1000); 2839 ScriptSleep(1000);
2818
2819 } 2840 }
2820 2841
2821 public void llBreakLink(int linknum) 2842 public void llBreakLink(int linknum)
@@ -2962,9 +2983,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2962 // destination is an object 2983 // destination is an object
2963 World.MoveTaskInventoryItem(destId, m_host, objId); 2984 World.MoveTaskInventoryItem(destId, m_host, objId);
2964 } 2985 }
2986 // ScriptSleep(3000);
2965 } 2987 }
2966 2988
2967 public void llRemoveInventory(string item) 2989 public void llRemoveInventory(string name)
2968 { 2990 {
2969 m_host.AddScriptLPS(1); 2991 m_host.AddScriptLPS(1);
2970 NotImplemented("llRemoveInventory"); 2992 NotImplemented("llRemoveInventory");
@@ -3040,6 +3062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3040 AsyncCommands. 3062 AsyncCommands.
3041 DataserverPlugin.DataserverReply(rq.ToString(), reply); 3063 DataserverPlugin.DataserverReply(rq.ToString(), reply);
3042 3064
3065 // ScriptSleep(100);
3043 return tid.ToString(); 3066 return tid.ToString();
3044 } 3067 }
3045 3068
@@ -3075,10 +3098,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3075 reply); 3098 reply);
3076 }, false); 3099 }, false);
3077 3100
3101 // ScriptSleep(1000);
3078 return tid.ToString(); 3102 return tid.ToString();
3079 } 3103 }
3080 } 3104 }
3081 3105 // ScriptSleep(1000);
3082 return String.Empty; 3106 return String.Empty;
3083 } 3107 }
3084 3108
@@ -3102,6 +3126,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3102 World.TeleportClientHome(agentId, presence.ControllingClient); 3126 World.TeleportClientHome(agentId, presence.ControllingClient);
3103 } 3127 }
3104 } 3128 }
3129 // ScriptSleep(5000);
3105 } 3130 }
3106 3131
3107 public void llModifyLand(int action, int brush) 3132 public void llModifyLand(int action, int brush)
@@ -3351,7 +3376,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3351 // except that it refers to scripting constants 3376 // except that it refers to scripting constants
3352 private int getScriptPrimType(PrimitiveBaseShape primShape) 3377 private int getScriptPrimType(PrimitiveBaseShape primShape)
3353 { 3378 {
3354
3355 if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0) 3379 if (primShape.SculptEntry && primShape.SculptType != (byte)0 && primShape.SculptData.Length > 0)
3356 return ScriptBaseClass.PRIM_TYPE_SCULPT; 3380 return ScriptBaseClass.PRIM_TYPE_SCULPT;
3357 if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square) 3381 if ((primShape.ProfileCurve & 0x07) == (byte)ProfileShape.Square)
@@ -3382,11 +3406,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3382 return ScriptBaseClass.PRIM_TYPE_RING; 3406 return ScriptBaseClass.PRIM_TYPE_RING;
3383 } 3407 }
3384 return ScriptBaseClass.PRIM_TYPE_BOX; 3408 return ScriptBaseClass.PRIM_TYPE_BOX;
3385
3386
3387 } 3409 }
3410
3388 // Helper functions to understand if object has cut, hollow, dimple, and other affecting number of faces 3411 // Helper functions to understand if object has cut, hollow, dimple, and other affecting number of faces
3389 private void hasCutHollowDimpleProfileCut(int primType,PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow, 3412 private void hasCutHollowDimpleProfileCut(int primType, PrimitiveBaseShape shape, out bool hasCut, out bool hasHollow,
3390 out bool hasDimple, out bool hasProfileCut) 3413 out bool hasDimple, out bool hasProfileCut)
3391 { 3414 {
3392 if (primType == ScriptBaseClass.PRIM_TYPE_BOX 3415 if (primType == ScriptBaseClass.PRIM_TYPE_BOX
@@ -3444,25 +3467,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3444 ret = 1; 3467 ret = 1;
3445 if (hasCut) ret += 2; 3468 if (hasCut) ret += 2;
3446 if (hasProfileCut) ret += 2; 3469 if (hasProfileCut) ret += 2;
3447 if (hasHollow) ret += 1; 3470 if (hasHollow) ret += 1;
3448 break; 3471 break;
3449 case ScriptBaseClass.PRIM_TYPE_TUBE: 3472 case ScriptBaseClass.PRIM_TYPE_TUBE:
3450 ret = 4; 3473 ret = 4;
3451 if (hasCut) ret += 2; 3474 if (hasCut) ret += 2;
3452 if (hasProfileCut) ret += 2; 3475 if (hasProfileCut) ret += 2;
3453 if (hasHollow) ret += 1; 3476 if (hasHollow) ret += 1;
3454 break; 3477 break;
3455 case ScriptBaseClass.PRIM_TYPE_RING: 3478 case ScriptBaseClass.PRIM_TYPE_RING:
3456 ret = 3; 3479 ret = 3;
3457 if (hasCut) ret += 2; 3480 if (hasCut) ret += 2;
3458 if (hasProfileCut) ret += 2; 3481 if (hasProfileCut) ret += 2;
3459 if (hasHollow) ret += 1; 3482 if (hasHollow) ret += 1;
3460 break; 3483 break;
3461 case ScriptBaseClass.PRIM_TYPE_SCULPT: 3484 case ScriptBaseClass.PRIM_TYPE_SCULPT:
3462 ret = 1; 3485 ret = 1;
3463 break; 3486 break;
3464 } 3487 }
3465
3466 return ret; 3488 return ret;
3467 } 3489 }
3468 3490
@@ -4050,10 +4072,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4050 chunks[i] = i; 4072 chunks[i] = i;
4051 4073
4052 // Knuth shuffle the chunkk index 4074 // Knuth shuffle the chunkk index
4053 for (int i = chunkk-1; i >= 1; i--) 4075 for (int i = chunkk - 1; i >= 1; i--)
4054 { 4076 {
4055 // Elect an unrandomized chunk to swap 4077 // Elect an unrandomized chunk to swap
4056 int index = rand.Next(i+1); 4078 int index = rand.Next(i + 1);
4057 int tmp; 4079 int tmp;
4058 4080
4059 // and swap position with first unrandomized chunk 4081 // and swap position with first unrandomized chunk
@@ -4304,6 +4326,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4304 { 4326 {
4305 m_host.AddScriptLPS(1); 4327 m_host.AddScriptLPS(1);
4306 m_host.AdjustSoundGain(volume); 4328 m_host.AdjustSoundGain(volume);
4329 // ScriptSleep(100);
4307 } 4330 }
4308 4331
4309 public void llSetSoundQueueing(int queue) 4332 public void llSetSoundQueueing(int queue)
@@ -4902,6 +4925,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4902 land.ParcelAccessList.Add(entry); 4925 land.ParcelAccessList.Add(entry);
4903 } 4926 }
4904 } 4927 }
4928 // ScriptSleep(100);
4905 } 4929 }
4906 4930
4907 public void llSetTouchText(string text) 4931 public void llSetTouchText(string text)
@@ -4989,6 +5013,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4989 buts[i] = buttons.Data[i].ToString(); 5013 buts[i] = buttons.Data[i].ToString();
4990 } 5014 }
4991 World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts); 5015 World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new LLUUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
5016 // ScriptSleep(1000);
4992 } 5017 }
4993 5018
4994 public void llVolumeDetect(int detect) 5019 public void llVolumeDetect(int detect)
@@ -5037,6 +5062,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5037 { 5062 {
5038 m_host.AddScriptLPS(1); 5063 m_host.AddScriptLPS(1);
5039 Deprecated("llRemoteLoadScript"); 5064 Deprecated("llRemoteLoadScript");
5065 // ScriptSleep(3000);
5040 } 5066 }
5041 5067
5042 public void llSetRemoteScriptAccessPin(int pin) 5068 public void llSetRemoteScriptAccessPin(int pin)
@@ -5049,13 +5075,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5049 { 5075 {
5050 m_host.AddScriptLPS(1); 5076 m_host.AddScriptLPS(1);
5051 NotImplemented("llRemoteLoadScriptPin"); 5077 NotImplemented("llRemoteLoadScriptPin");
5078 ScriptSleep(3000);
5052 } 5079 }
5053 5080
5054 // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
5055 // Not sure where these constants should live:
5056 // REMOTE_DATA_CHANNEL = 1
5057 // REMOTE_DATA_REQUEST = 2
5058 // REMOTE_DATA_REPLY = 3
5059 public void llOpenRemoteDataChannel() 5081 public void llOpenRemoteDataChannel()
5060 { 5082 {
5061 m_host.AddScriptLPS(1); 5083 m_host.AddScriptLPS(1);
@@ -5068,12 +5090,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5068 "remote_data", resobj, 5090 "remote_data", resobj,
5069 new DetectParams[0])); 5091 new DetectParams[0]));
5070 } 5092 }
5093 // ScriptSleep(1000);
5071 } 5094 }
5072 5095
5073 public string llSendRemoteData(string channel, string dest, int idata, string sdata) 5096 public string llSendRemoteData(string channel, string dest, int idata, string sdata)
5074 { 5097 {
5075 m_host.AddScriptLPS(1); 5098 m_host.AddScriptLPS(1);
5076 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 5099 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
5100 // ScriptSleep(3000);
5077 return (xmlrpcMod.SendRemoteData(m_localID, m_itemID, channel, dest, idata, sdata)).ToString(); 5101 return (xmlrpcMod.SendRemoteData(m_localID, m_itemID, channel, dest, idata, sdata)).ToString();
5078 } 5102 }
5079 5103
@@ -5082,6 +5106,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5082 m_host.AddScriptLPS(1); 5106 m_host.AddScriptLPS(1);
5083 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 5107 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
5084 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); 5108 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
5109 // ScriptSleep(3000);
5085 } 5110 }
5086 5111
5087 public void llCloseRemoteDataChannel(string channel) 5112 public void llCloseRemoteDataChannel(string channel)
@@ -5089,6 +5114,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5089 m_host.AddScriptLPS(1); 5114 m_host.AddScriptLPS(1);
5090 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 5115 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
5091 xmlrpcMod.CloseXMLRPCChannel(channel); 5116 xmlrpcMod.CloseXMLRPCChannel(channel);
5117 // ScriptSleep(1000);
5092 } 5118 }
5093 5119
5094 public string llMD5String(string src, int nonce) 5120 public string llMD5String(string src, int nonce)
@@ -5782,6 +5808,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5782 { 5808 {
5783 m_host.AddScriptLPS(1); 5809 m_host.AddScriptLPS(1);
5784 Deprecated("llXorBase64Strings"); 5810 Deprecated("llXorBase64Strings");
5811 // ScriptSleep(300);
5785 } 5812 }
5786 5813
5787 public void llRemoteDataSetRegion() 5814 public void llRemoteDataSetRegion()
@@ -5830,6 +5857,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
5830 return; 5857 return;
5831 } 5858 }
5832 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); 5859 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
5860 // ScriptSleep(2000);
5833 } 5861 }
5834 5862
5835 public void osSetParcelMediaURL(string url) 5863 public void osSetParcelMediaURL(string url)
@@ -6048,7 +6076,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6048 case ScriptBaseClass.PRIM_TYPE_BOX: 6076 case ScriptBaseClass.PRIM_TYPE_BOX:
6049 case ScriptBaseClass.PRIM_TYPE_CYLINDER: 6077 case ScriptBaseClass.PRIM_TYPE_CYLINDER:
6050 case ScriptBaseClass.PRIM_TYPE_PRISM: 6078 case ScriptBaseClass.PRIM_TYPE_PRISM:
6051
6052 res.Add(new LSL_Types.LSLInteger(Shape.ProfileCurve)); 6079 res.Add(new LSL_Types.LSLInteger(Shape.ProfileCurve));
6053 res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); 6080 res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
6054 res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0)); 6081 res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0));
@@ -6063,16 +6090,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6063 res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0)); 6090 res.Add(new LSL_Types.LSLFloat(Shape.ProfileHollow / 50000.0));
6064 res.Add(new LSL_Types.Vector3(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0)); 6091 res.Add(new LSL_Types.Vector3(Shape.PathTwistBegin / 100.0, Shape.PathTwist / 100.0, 0));
6065 res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0)); 6092 res.Add(new LSL_Types.Vector3(Shape.ProfileBegin / 50000.0, 1 - Shape.ProfileEnd / 50000.0, 0));
6066
6067 break; 6093 break;
6068 6094
6069
6070
6071 case ScriptBaseClass.PRIM_TYPE_SCULPT: 6095 case ScriptBaseClass.PRIM_TYPE_SCULPT:
6072 res.Add(Shape.SculptTexture.ToString()); 6096 res.Add(Shape.SculptTexture.ToString());
6073 res.Add(new LSL_Types.LSLInteger(Shape.SculptType)); 6097 res.Add(new LSL_Types.LSLInteger(Shape.SculptType));
6074
6075 break; 6098 break;
6099
6076 case ScriptBaseClass.PRIM_TYPE_RING: 6100 case ScriptBaseClass.PRIM_TYPE_RING:
6077 case ScriptBaseClass.PRIM_TYPE_TUBE: 6101 case ScriptBaseClass.PRIM_TYPE_TUBE:
6078 case ScriptBaseClass.PRIM_TYPE_TORUS: 6102 case ScriptBaseClass.PRIM_TYPE_TORUS:
@@ -6111,8 +6135,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6111 res.Add(new LSL_Types.LSLFloat(Shape.PathSkew / 100.0)); 6135 res.Add(new LSL_Types.LSLFloat(Shape.PathSkew / 100.0));
6112 break; 6136 break;
6113 6137
6114
6115
6116 } 6138 }
6117 break; 6139 break;
6118 6140
@@ -6141,7 +6163,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6141 if (remain < 1) 6163 if (remain < 1)
6142 return res; 6164 return res;
6143 6165
6144 face=Convert.ToInt32(rules.Data[idx++]); 6166 face=Convert.ToInt32("" + rules.Data[idx++]);
6145 6167
6146 tex = m_host.Shape.Textures; 6168 tex = m_host.Shape.Textures;
6147 LLColor texcolor; 6169 LLColor texcolor;
@@ -6499,6 +6521,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6499 { 6521 {
6500 m_host.AddScriptLPS(1); 6522 m_host.AddScriptLPS(1);
6501 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); 6523 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
6524 // ScriptSleep(200);
6502 } 6525 }
6503 6526
6504 // <summary> 6527 // <summary>
@@ -6818,7 +6841,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6818 { 6841 {
6819 case 5: // DATA_SIM_POS 6842 case 5: // DATA_SIM_POS
6820 if (info == null) 6843 if (info == null)
6821 return LLUUID.Zero.ToString(); 6844 {
6845 // ScriptSleep(1000);
6846 return LLUUID.Zero.ToString();
6847 }
6822 reply = new LSL_Types.Vector3( 6848 reply = new LSL_Types.Vector3(
6823 info.RegionLocX * Constants.RegionSize, 6849 info.RegionLocX * Constants.RegionSize,
6824 info.RegionLocY * Constants.RegionSize, 6850 info.RegionLocY * Constants.RegionSize,
@@ -6832,7 +6858,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6832 break; 6858 break;
6833 case 7: // DATA_SIM_RATING 6859 case 7: // DATA_SIM_RATING
6834 if (info == null) 6860 if (info == null)
6835 return LLUUID.Zero.ToString(); 6861 {
6862 // ScriptSleep(1000);
6863 return LLUUID.Zero.ToString();
6864 }
6836 int access = info.RegionSettings.Maturity; 6865 int access = info.RegionSettings.Maturity;
6837 if (access == 0) 6866 if (access == 0)
6838 reply = "PG"; 6867 reply = "PG";
@@ -6845,17 +6874,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6845 reply = m_ScriptEngine.World.GetSimulatorVersion(); 6874 reply = m_ScriptEngine.World.GetSimulatorVersion();
6846 break; 6875 break;
6847 default: 6876 default:
6877 // ScriptSleep(1000);
6848 return LLUUID.Zero.ToString(); // Raise no event 6878 return LLUUID.Zero.ToString(); // Raise no event
6849 } 6879 }
6850 LLUUID rq = LLUUID.Random(); 6880 LLUUID rq = LLUUID.Random();
6851 6881
6852 LLUUID tid = AsyncCommands. 6882 LLUUID tid = AsyncCommands.
6853 DataserverPlugin.RegisterRequest(m_localID, 6883 DataserverPlugin.RegisterRequest(m_localID, m_itemID, rq.ToString());
6854 m_itemID, rq.ToString());
6855 6884
6856 AsyncCommands. 6885 AsyncCommands.
6857 DataserverPlugin.DataserverReply(rq.ToString(), reply); 6886 DataserverPlugin.DataserverReply(rq.ToString(), reply);
6858 6887
6888 // ScriptSleep(1000);
6859 return tid.ToString(); 6889 return tid.ToString();
6860 } 6890 }
6861 catch(Exception e) 6891 catch(Exception e)
@@ -6877,7 +6907,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6877 LLUUID key = new LLUUID(); 6907 LLUUID key = new LLUUID();
6878 if (LLUUID.TryParse(id,out key)) 6908 if (LLUUID.TryParse(id,out key))
6879 { 6909 {
6880 return (double) World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass(); 6910 return (double)World.GetSceneObjectPart(World.Entities[key].LocalId).GetMass();
6881 } 6911 }
6882 return 0; 6912 return 0;
6883 } 6913 }
@@ -6970,6 +7000,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6970 LLUUID avatarId = new LLUUID(avatar_id); 7000 LLUUID avatarId = new LLUUID(avatar_id);
6971 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, 7001 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
6972 url); 7002 url);
7003 // ScriptSleep(10000);
6973 } 7004 }
6974 7005
6975 public void llParcelMediaCommandList(LSL_Types.list commandList) 7006 public void llParcelMediaCommandList(LSL_Types.list commandList)
@@ -7056,7 +7087,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7056 }//end switch 7087 }//end switch
7057 7088
7058 } 7089 }
7059 7090 // ScriptSleep(2000);
7060 7091
7061 //NotImplemented("llParcelMediaCommandList"); 7092 //NotImplemented("llParcelMediaCommandList");
7062 } 7093 }
@@ -7096,8 +7127,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7096 7127
7097 } 7128 }
7098 } 7129 }
7130 // ScriptSleep(2000);
7099 return list; 7131 return list;
7100
7101 } 7132 }
7102 7133
7103 public LSL_Types.LSLInteger llModPow(int a, int b, int c) 7134 public LSL_Types.LSLInteger llModPow(int a, int b, int c)
@@ -7105,6 +7136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7105 m_host.AddScriptLPS(1); 7136 m_host.AddScriptLPS(1);
7106 Int64 tmp = 0; 7137 Int64 tmp = 0;
7107 Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); 7138 Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp);
7139 // ScriptSleep(1000);
7108 return Convert.ToInt32(tmp); 7140 return Convert.ToInt32(tmp);
7109 } 7141 }
7110 7142
@@ -7151,8 +7183,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7151 return new LSL_Types.Vector3(); 7183 return new LSL_Types.Vector3();
7152 } 7184 }
7153 ScenePresence presence = World.GetScenePresence(m_host.OwnerID); 7185 ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
7154 LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z); 7186 if (presence != null)
7155 return pos; 7187 {
7188 LSL_Types.Vector3 pos = new LSL_Types.Vector3(presence.CameraPosition.x,presence.CameraPosition.y,presence.CameraPosition.z);
7189 return pos;
7190 }
7191 return new LSL_Types.Vector3();
7156 } 7192 }
7157 7193
7158 public LSL_Types.Quaternion llGetCameraRot() 7194 public LSL_Types.Quaternion llGetCameraRot()
@@ -7166,12 +7202,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7166 { 7202 {
7167 m_host.AddScriptLPS(1); 7203 m_host.AddScriptLPS(1);
7168 NotImplemented("llSetPrimURL"); 7204 NotImplemented("llSetPrimURL");
7205 // ScriptSleep(2000);
7169 } 7206 }
7170 7207
7171 public void llRefreshPrimURL() 7208 public void llRefreshPrimURL()
7172 { 7209 {
7173 m_host.AddScriptLPS(1); 7210 m_host.AddScriptLPS(1);
7174 NotImplemented("llRefreshPrimURL"); 7211 NotImplemented("llRefreshPrimURL");
7212 // ScriptSleep(20000);
7175 } 7213 }
7176 7214
7177 public string llEscapeURL(string url) 7215 public string llEscapeURL(string url)
@@ -7204,6 +7242,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7204 { 7242 {
7205 m_host.AddScriptLPS(1); 7243 m_host.AddScriptLPS(1);
7206 NotImplemented("llMapDestination"); 7244 NotImplemented("llMapDestination");
7245 // ScriptSleep(1000);
7207 } 7246 }
7208 7247
7209 public void llAddToLandBanList(string avatar, double hours) 7248 public void llAddToLandBanList(string avatar, double hours)
@@ -7222,6 +7261,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7222 land.ParcelAccessList.Add(entry); 7261 land.ParcelAccessList.Add(entry);
7223 } 7262 }
7224 } 7263 }
7264 // ScriptSleep(100);
7225 } 7265 }
7226 7266
7227 public void llRemoveFromLandPassList(string avatar) 7267 public void llRemoveFromLandPassList(string avatar)
@@ -7243,6 +7283,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7243 } 7283 }
7244 } 7284 }
7245 } 7285 }
7286 // ScriptSleep(100);
7246 } 7287 }
7247 7288
7248 public void llRemoveFromLandBanList(string avatar) 7289 public void llRemoveFromLandBanList(string avatar)
@@ -7264,6 +7305,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7264 } 7305 }
7265 } 7306 }
7266 } 7307 }
7308 // ScriptSleep(100);
7267 } 7309 }
7268 7310
7269 public void llSetCameraParams(LSL_Types.list rules) 7311 public void llSetCameraParams(LSL_Types.list rules)
@@ -7471,6 +7513,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7471 } 7513 }
7472 } 7514 }
7473 } 7515 }
7516 // ScriptSleep(100);
7474 } 7517 }
7475 7518
7476 public void llResetLandPassList() 7519 public void llResetLandPassList()
@@ -7487,6 +7530,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7487 } 7530 }
7488 } 7531 }
7489 } 7532 }
7533 // ScriptSleep(100);
7490 } 7534 }
7491 7535
7492 public LSL_Types.LSLInteger llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) 7536 public LSL_Types.LSLInteger llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
@@ -7565,6 +7609,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7565 ret.Add(d.Value); 7609 ret.Add(d.Value);
7566 } 7610 }
7567 } 7611 }
7612 // ScriptSleep(2000);
7568 return ret; 7613 return ret;
7569 } 7614 }
7570 7615
@@ -7661,6 +7706,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7661 return; 7706 return;
7662 7707
7663 SetTexture(part, texture, face); 7708 SetTexture(part, texture, face);
7709 // ScriptSleep(200);
7664 } 7710 }
7665 7711
7666 public string llStringTrim(string src, int type) 7712 public string llStringTrim(string src, int type)
@@ -7810,6 +7856,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7810 AsyncCommands. 7856 AsyncCommands.
7811 DataserverPlugin.DataserverReply(item.AssetID.ToString(), 7857 DataserverPlugin.DataserverReply(item.AssetID.ToString(),
7812 NotecardCache.GetLines(item.AssetID).ToString()); 7858 NotecardCache.GetLines(item.AssetID).ToString());
7859 // ScriptSleep(100);
7813 return tid.ToString(); 7860 return tid.ToString();
7814 } 7861 }
7815 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) 7862 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
@@ -7823,10 +7870,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7823 DataserverPlugin.DataserverReply(id.ToString(), 7870 DataserverPlugin.DataserverReply(id.ToString(),
7824 NotecardCache.GetLines(id).ToString()); 7871 NotecardCache.GetLines(id).ToString());
7825 }); 7872 });
7826 7873 // ScriptSleep(100);
7827 return tid.ToString(); 7874 return tid.ToString();
7828 } 7875 }
7829 } 7876 }
7877 // ScriptSleep(100);
7830 return LLUUID.Zero.ToString(); 7878 return LLUUID.Zero.ToString();
7831 } 7879 }
7832 7880
@@ -7846,6 +7894,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7846 AsyncCommands. 7894 AsyncCommands.
7847 DataserverPlugin.DataserverReply(item.AssetID.ToString(), 7895 DataserverPlugin.DataserverReply(item.AssetID.ToString(),
7848 NotecardCache.GetLine(item.AssetID, line)); 7896 NotecardCache.GetLine(item.AssetID, line));
7897 // ScriptSleep(100);
7849 return tid.ToString(); 7898 return tid.ToString();
7850 } 7899 }
7851 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a) 7900 WithNotecard(item.AssetID, delegate (LLUUID id, AssetBase a)
@@ -7860,10 +7909,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7860 NotecardCache.GetLine(id, line)); 7909 NotecardCache.GetLine(id, line));
7861 }); 7910 });
7862 7911
7912 // ScriptSleep(100);
7863 return tid.ToString(); 7913 return tid.ToString();
7864 } 7914 }
7865 } 7915 }
7866 7916
7917 // ScriptSleep(100);
7867 return String.Empty; 7918 return String.Empty;
7868 } 7919 }
7869 7920