aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs19
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs83
3 files changed, 62 insertions, 44 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 0dad3c4..596174b 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -137,13 +137,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
137 foreach (Scene scene in m_Scenes) 137 foreach (Scene scene in m_Scenes)
138 { 138 {
139// m_log.DebugFormat( 139// m_log.DebugFormat(
140// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", 140// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}",
141// toAgentID.ToString(), scene.RegionInfo.RegionName); 141// toAgentID.ToString(), scene.RegionInfo.RegionName);
142
142 ScenePresence sp = scene.GetScenePresence(toAgentID); 143 ScenePresence sp = scene.GetScenePresence(toAgentID);
143 if (sp != null && !sp.IsChildAgent) 144 if (sp != null && !sp.IsChildAgent)
144 { 145 {
145 // Local message 146 // Local message
146// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID); 147 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", sp.Name, toAgentID);
148
147 sp.ControllingClient.SendInstantMessage(im); 149 sp.ControllingClient.SendInstantMessage(im);
148 150
149 // Message sent 151 // Message sent
@@ -155,13 +157,15 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
155 // try child avatar second 157 // try child avatar second
156 foreach (Scene scene in m_Scenes) 158 foreach (Scene scene in m_Scenes)
157 { 159 {
158// m_log.DebugFormat( 160 m_log.DebugFormat(
159// "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName); 161 "[INSTANT MESSAGE]: Looking for child of {0} in {1}", toAgentID, scene.RegionInfo.RegionName);
162
160 ScenePresence sp = scene.GetScenePresence(toAgentID); 163 ScenePresence sp = scene.GetScenePresence(toAgentID);
161 if (sp != null) 164 if (sp != null)
162 { 165 {
163 // Local message 166 // Local message
164// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID); 167 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", sp.Name, toAgentID);
168
165 sp.ControllingClient.SendInstantMessage(im); 169 sp.ControllingClient.SendInstantMessage(im);
166 170
167 // Message sent 171 // Message sent
@@ -170,10 +174,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
170 } 174 }
171 } 175 }
172 176
173// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID); 177 m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to {0} via XMLRPC", im.toAgentID);
174 SendGridInstantMessageViaXMLRPC(im, result);
175 178
176 return; 179 SendGridInstantMessageViaXMLRPC(im, result);
177 } 180 }
178 181
179 private void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result) 182 private void HandleUndeliveredMessage(GridInstantMessage im, MessageResultNotification result)
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 19c774f..f3af59a 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -297,7 +297,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
297 }); 297 });
298 } 298 }
299 } 299 }
300 else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) 300 else if (
301 im.dialog == (byte)InstantMessageDialog.InventoryDeclined
302 || im.dialog == (byte)InstantMessageDialog.TaskInventoryDeclined)
301 { 303 {
302 // Here, the recipient is local and we can assume that the 304 // Here, the recipient is local and we can assume that the
303 // inventory is loaded. Courtesy of the above bulk update, 305 // inventory is loaded. Courtesy of the above bulk update,
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index f88338d..b43e8e7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3925,8 +3925,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3925 public void llGiveInventory(string destination, string inventory) 3925 public void llGiveInventory(string destination, string inventory)
3926 { 3926 {
3927 m_host.AddScriptLPS(1); 3927 m_host.AddScriptLPS(1);
3928 3928 bool found = false;
3929 UUID destId = UUID.Zero; 3929 UUID destId = UUID.Zero;
3930 UUID objId = UUID.Zero;
3931 int assetType = 0;
3932 string objName = String.Empty;
3930 3933
3931 if (!UUID.TryParse(destination, out destId)) 3934 if (!UUID.TryParse(destination, out destId))
3932 { 3935 {
@@ -3934,16 +3937,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3934 return; 3937 return;
3935 } 3938 }
3936 3939
3937 TaskInventoryItem item = m_host.Inventory.GetInventoryItem(inventory); 3940 // move the first object found with this inventory name
3941 lock (m_host.TaskInventory)
3942 {
3943 foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
3944 {
3945 if (inv.Value.Name == inventory)
3946 {
3947 found = true;
3948 objId = inv.Key;
3949 assetType = inv.Value.Type;
3950 objName = inv.Value.Name;
3951 break;
3952 }
3953 }
3954 }
3938 3955
3939 if (item == null) 3956 if (!found)
3940 { 3957 {
3941 llSay(0, String.Format("Could not find object '{0}'", inventory)); 3958 llSay(0, String.Format("Could not find object '{0}'", inventory));
3942 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory)); 3959 throw new Exception(String.Format("The inventory object '{0}' could not be found", inventory));
3943 } 3960 }
3944 3961
3945 UUID objId = item.ItemID;
3946
3947 // check if destination is an object 3962 // check if destination is an object
3948 if (World.GetSceneObjectPart(destId) != null) 3963 if (World.GetSceneObjectPart(destId) != null)
3949 { 3964 {
@@ -3973,23 +3988,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3973 if (agentItem == null) 3988 if (agentItem == null)
3974 return; 3989 return;
3975 3990
3976 byte[] bucket = new byte[17];
3977 bucket[0] = (byte)item.Type;
3978 byte[] objBytes = agentItem.ID.GetBytes();
3979 Array.Copy(objBytes, 0, bucket, 1, 16);
3980
3981 GridInstantMessage msg = new GridInstantMessage(World,
3982 m_host.UUID, m_host.Name + ", an object owned by " +
3983 resolveName(m_host.OwnerID) + ",", destId,
3984 (byte)InstantMessageDialog.TaskInventoryOffered,
3985 false, item.Name + "\n" + m_host.Name + " is located at " +
3986 World.RegionInfo.RegionName+" "+
3987 m_host.AbsolutePosition.ToString(),
3988 agentItem.ID, true, m_host.AbsolutePosition,
3989 bucket);
3990
3991 if (m_TransferModule != null) 3991 if (m_TransferModule != null)
3992 {
3993 byte[] bucket = new byte[] { (byte)assetType };
3994
3995 GridInstantMessage msg = new GridInstantMessage(World,
3996 m_host.UUID, m_host.Name + ", an object owned by " +
3997 resolveName(m_host.OwnerID) + ",", destId,
3998 (byte)InstantMessageDialog.TaskInventoryOffered,
3999 false, objName + "\n" + m_host.Name + " is located at " +
4000 World.RegionInfo.RegionName + " " +
4001 m_host.AbsolutePosition.ToString(),
4002 agentItem.ID, true, m_host.AbsolutePosition,
4003 bucket);
4004
3992 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 4005 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
4006 }
3993 4007
3994 ScriptSleep(3000); 4008 ScriptSleep(3000);
3995 } 4009 }
@@ -6397,23 +6411,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6397 if (folderID == UUID.Zero) 6411 if (folderID == UUID.Zero)
6398 return; 6412 return;
6399 6413
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) 6414 if (m_TransferModule != null)
6415 {
6416 byte[] bucket = new byte[] { (byte)AssetType.Folder };
6417
6418 GridInstantMessage msg = new GridInstantMessage(World,
6419 m_host.UUID, m_host.Name + ", an object owned by " +
6420 resolveName(m_host.OwnerID) + ",", destID,
6421 (byte)InstantMessageDialog.TaskInventoryOffered,
6422 false, category + "\n" + m_host.Name + " is located at " +
6423 World.RegionInfo.RegionName + " " +
6424 m_host.AbsolutePosition.ToString(),
6425 folderID, true, m_host.AbsolutePosition,
6426 bucket);
6427
6416 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 6428 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
6429 }
6417 } 6430 }
6418 6431
6419 public void llSetVehicleType(int type) 6432 public void llSetVehicleType(int type)