aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs56
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs15
2 files changed, 41 insertions, 30 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index f88338d..084bd41 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3973,23 +3973,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3973 if (agentItem == null) 3973 if (agentItem == null)
3974 return; 3974 return;
3975 3975
3976 byte[] bucket = new byte[17]; 3976 if (m_TransferModule != null)
3977 bucket[0] = (byte)item.Type; 3977 {
3978 byte[] objBytes = agentItem.ID.GetBytes(); 3978 byte[] bucket = new byte[] { (byte)item.Type };
3979 Array.Copy(objBytes, 0, bucket, 1, 16);
3980 3979
3981 GridInstantMessage msg = new GridInstantMessage(World, 3980 GridInstantMessage msg = new GridInstantMessage(World,
3982 m_host.UUID, m_host.Name + ", an object owned by " + 3981 m_host.UUID, m_host.Name + ", an object owned by " +
3983 resolveName(m_host.OwnerID) + ",", destId, 3982 resolveName(m_host.OwnerID) + ",", destId,
3984 (byte)InstantMessageDialog.TaskInventoryOffered, 3983 (byte)InstantMessageDialog.TaskInventoryOffered,
3985 false, item.Name + "\n" + m_host.Name + " is located at " + 3984 false, item.Name + "\n" + m_host.Name + " is located at " +
3986 World.RegionInfo.RegionName+" "+ 3985 World.RegionInfo.RegionName+" "+
3987 m_host.AbsolutePosition.ToString(), 3986 m_host.AbsolutePosition.ToString(),
3988 agentItem.ID, true, m_host.AbsolutePosition, 3987 agentItem.ID, true, m_host.AbsolutePosition,
3989 bucket); 3988 bucket);
3990 3989
3991 if (m_TransferModule != null)
3992 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 3990 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
3991 }
3993 3992
3994 ScriptSleep(3000); 3993 ScriptSleep(3000);
3995 } 3994 }
@@ -6397,23 +6396,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6397 if (folderID == UUID.Zero) 6396 if (folderID == UUID.Zero)
6398 return; 6397 return;
6399 6398
6400 byte[] bucket = new byte[17];
6401 bucket[0] = (byte)AssetType.Folder;
6402 byte[] objBytes = folderID.GetBytes();
6403 Array.Copy(objBytes, 0, bucket, 1, 16);
6404
6405 GridInstantMessage msg = new GridInstantMessage(World,
6406 m_host.UUID, m_host.Name + ", an object owned by " +
6407 resolveName(m_host.OwnerID) + ",", destID,
6408 (byte)InstantMessageDialog.InventoryOffered,
6409 false, category + "\n" + m_host.Name + " is located at " +
6410 World.RegionInfo.RegionName + " " +
6411 m_host.AbsolutePosition.ToString(),
6412 folderID, true, m_host.AbsolutePosition,
6413 bucket);
6414
6415 if (m_TransferModule != null) 6399 if (m_TransferModule != null)
6400 {
6401 byte[] bucket = new byte[] { (byte)AssetType.Folder };
6402
6403 GridInstantMessage msg = new GridInstantMessage(World,
6404 m_host.UUID, m_host.Name + ", an object owned by " +
6405 resolveName(m_host.OwnerID) + ",", destID,
6406 (byte)InstantMessageDialog.TaskInventoryOffered,
6407 false, category + "\n" + m_host.Name + " is located at " +
6408 World.RegionInfo.RegionName + " " +
6409 m_host.AbsolutePosition.ToString(),
6410 folderID, true, m_host.AbsolutePosition,
6411 bucket);
6412
6416 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 6413 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
6414 }
6417 } 6415 }
6418 6416
6419 public void llSetVehicleType(int type) 6417 public void llSetVehicleType(int type)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 3654106..4137397 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1664,9 +1664,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1664 CheckThreatLevel(ThreatLevel.Low, "osMessageObject"); 1664 CheckThreatLevel(ThreatLevel.Low, "osMessageObject");
1665 m_host.AddScriptLPS(1); 1665 m_host.AddScriptLPS(1);
1666 1666
1667 UUID objUUID;
1668 if (!UUID.TryParse(objectUUID, out objUUID)) // prior to patching, a thrown exception regarding invalid GUID format would be shouted instead.
1669 {
1670 OSSLShoutError("osMessageObject() cannot send messages to objects with invalid UUIDs");
1671 return;
1672 }
1673
1667 object[] resobj = new object[] { new LSL_Types.LSLString(m_host.UUID.ToString()), new LSL_Types.LSLString(message) }; 1674 object[] resobj = new object[] { new LSL_Types.LSLString(m_host.UUID.ToString()), new LSL_Types.LSLString(message) };
1668 1675
1669 SceneObjectPart sceneOP = World.GetSceneObjectPart(new UUID(objectUUID)); 1676 SceneObjectPart sceneOP = World.GetSceneObjectPart(objUUID);
1677
1678 if (sceneOP == null) // prior to patching, PostObjectEvent() would cause a throw exception to be shouted instead.
1679 {
1680 OSSLShoutError("osMessageObject() cannot send message to " + objUUID.ToString() + ", object was not found in scene.");
1681 return;
1682 }
1670 1683
1671 m_ScriptEngine.PostObjectEvent( 1684 m_ScriptEngine.PostObjectEvent(
1672 sceneOP.LocalId, new EventParams( 1685 sceneOP.LocalId, new EventParams(