aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2011-12-07 00:43:59 +0100
committerMelanie2011-12-07 00:43:59 +0100
commitd6486fe14a77b74235eaa9e1feab36f923dc6ee9 (patch)
tree7bcda14d72eeb74635cbb36cef13539137d945ba
parentRemove harmless merge artefact (diff)
downloadopensim-SC-d6486fe14a77b74235eaa9e1feab36f923dc6ee9.zip
opensim-SC-d6486fe14a77b74235eaa9e1feab36f923dc6ee9.tar.gz
opensim-SC-d6486fe14a77b74235eaa9e1feab36f923dc6ee9.tar.bz2
opensim-SC-d6486fe14a77b74235eaa9e1feab36f923dc6ee9.tar.xz
Fix task inventory giving
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs25
-rw-r--r--OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs29
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs38
4 files changed, 39 insertions, 56 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
index 712632b..6064ddc 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs
@@ -146,20 +146,13 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
146 ScenePresence sp = scene.GetScenePresence(toAgentID); 146 ScenePresence sp = scene.GetScenePresence(toAgentID);
147 if (sp != null && !sp.IsChildAgent) 147 if (sp != null && !sp.IsChildAgent)
148 { 148 {
149// m_log.DebugFormat( 149 // Local message
150// "[INSTANT MESSAGE]: Looking for root agent {0} in {1}", 150// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to root agent {0} {1}", user.Name, toAgentID);
151// toAgentID.ToString(), scene.RegionInfo.RegionName); 151 sp.ControllingClient.SendInstantMessage(im);
152
153 ScenePresence user = (ScenePresence) scene.Entities[toAgentID];
154 if (!user.IsChildAgent)
155 {
156 // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
157 user.ControllingClient.SendInstantMessage(im);
158 152
159 // Message sent 153 // Message sent
160 result(true); 154 result(true);
161 return; 155 return;
162 }
163 } 156 }
164 } 157 }
165 158
@@ -172,10 +165,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
172 if (sp != null) 165 if (sp != null)
173 { 166 {
174 // Local message 167 // Local message
175 ScenePresence user = (ScenePresence) scene.Entities[toAgentID]; 168// m_log.DebugFormat("[INSTANT MESSAGE]: Delivering IM to child agent {0} {1}", user.Name, toAgentID);
176 169 sp.ControllingClient.SendInstantMessage(im);
177 // m_log.DebugFormat("[INSTANT MESSAGE]: Delivering to client");
178 user.ControllingClient.SendInstantMessage(im);
179 170
180 // Message sent 171 // Message sent
181 result(true); 172 result(true);
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
index 5ab604f..b27b07d 100644
--- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs
@@ -212,7 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
212 im.dialog != (byte)InstantMessageDialog.MessageFromAgent && 212 im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
213 im.dialog != (byte)InstantMessageDialog.GroupNotice && 213 im.dialog != (byte)InstantMessageDialog.GroupNotice &&
214 im.dialog != (byte)InstantMessageDialog.GroupInvitation && 214 im.dialog != (byte)InstantMessageDialog.GroupInvitation &&
215 im.dialog != (byte)InstantMessageDialog.InventoryOffered) 215 im.dialog != (byte)InstantMessageDialog.InventoryOffered &&
216 im.dialog != (byte)InstantMessageDialog.TaskInventoryOffered)
216 { 217 {
217 return; 218 return;
218 } 219 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index aa211ba..677fab9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -265,7 +265,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
265 }); 265 });
266 } 266 }
267 } 267 }
268 else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted) 268 else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
269 im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
269 { 270 {
270 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); 271 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
271 272
@@ -276,30 +277,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
276 else 277 else
277 { 278 {
278 if (m_TransferModule != null) 279 if (m_TransferModule != null)
279 m_TransferModule.SendInstantMessage(im, delegate(bool success) { 280 m_TransferModule.SendInstantMessage(im, delegate(bool success) {});
280
281 // justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011
282 // and is apparently supposed to fix bulk inventory updates after accepting items. But
283 // instead it appears to cause two copies of an accepted folder for the receiving user in
284 // at least some cases. Folder/item update is already done when the offer is made (see code above)
285
286// // Send BulkUpdateInventory
287// IInventoryService invService = scene.InventoryService;
288// UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip
289//
290// InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
291// folder = invService.GetFolder(folder);
292//
293// ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
294//
295// // If the user has left the scene by the time the message comes back then we can't send
296// // them the update.
297// if (fromUser != null)
298// fromUser.ControllingClient.SendBulkUpdateInventory(folder);
299 });
300 } 281 }
301 } 282 }
302 else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined) 283 else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined ||
284 im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined)
303 { 285 {
304 // Here, the recipient is local and we can assume that the 286 // Here, the recipient is local and we can assume that the
305 // inventory is loaded. Courtesy of the above bulk update, 287 // inventory is loaded. Courtesy of the above bulk update,
@@ -335,6 +317,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
335 { 317 {
336 folder.ParentID = trashFolder.ID; 318 folder.ParentID = trashFolder.ID;
337 invService.MoveFolder(folder); 319 invService.MoveFolder(folder);
320 client.SendBulkUpdateInventory(folder);
338 } 321 }
339 } 322 }
340 323
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d2eb461..7a56f11 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4368,22 +4368,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4368 if (agentItem == null) 4368 if (agentItem == null)
4369 return; 4369 return;
4370 4370
4371 byte[] bucket = new byte[17]; 4371 byte[] bucket = new byte[1];
4372 bucket[0] = (byte)assetType; 4372 bucket[0] = (byte)assetType;
4373 byte[] objBytes = agentItem.ID.GetBytes(); 4373 //byte[] objBytes = agentItem.ID.GetBytes();
4374 Array.Copy(objBytes, 0, bucket, 1, 16); 4374 //Array.Copy(objBytes, 0, bucket, 1, 16);
4375 4375
4376 GridInstantMessage msg = new GridInstantMessage(World, 4376 GridInstantMessage msg = new GridInstantMessage(World,
4377 m_host.UUID, m_host.Name+", an object owned by "+ 4377 m_host.OwnerID, m_host.Name, destId,
4378 resolveName(m_host.OwnerID)+",", destId,
4379 (byte)InstantMessageDialog.TaskInventoryOffered, 4378 (byte)InstantMessageDialog.TaskInventoryOffered,
4380 false, objName+"\n"+m_host.Name+" is located at "+ 4379 false, objName+". "+m_host.Name+" is located at "+
4381 World.RegionInfo.RegionName+" "+ 4380 World.RegionInfo.RegionName+" "+
4382 m_host.AbsolutePosition.ToString(), 4381 m_host.AbsolutePosition.ToString(),
4383 agentItem.ID, true, m_host.AbsolutePosition, 4382 agentItem.ID, true, m_host.AbsolutePosition,
4384 bucket); 4383 bucket);
4385 if (m_TransferModule != null) 4384
4386 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 4385 ScenePresence sp;
4386
4387 if (World.TryGetScenePresence(destId, out sp))
4388 {
4389 sp.ControllingClient.SendInstantMessage(msg);
4390 }
4391 else
4392 {
4393 if (m_TransferModule != null)
4394 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
4395 }
4387 4396
4388 //This delay should only occur when giving inventory to avatars. 4397 //This delay should only occur when giving inventory to avatars.
4389 ScriptSleep(3000); 4398 ScriptSleep(3000);
@@ -6708,16 +6717,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6708 if (folderID == UUID.Zero) 6717 if (folderID == UUID.Zero)
6709 return; 6718 return;
6710 6719
6711 byte[] bucket = new byte[17]; 6720 byte[] bucket = new byte[1];
6712 bucket[0] = (byte)AssetType.Folder; 6721 bucket[0] = (byte)AssetType.Folder;
6713 byte[] objBytes = folderID.GetBytes(); 6722 //byte[] objBytes = folderID.GetBytes();
6714 Array.Copy(objBytes, 0, bucket, 1, 16); 6723 //Array.Copy(objBytes, 0, bucket, 1, 16);
6715 6724
6716 GridInstantMessage msg = new GridInstantMessage(World, 6725 GridInstantMessage msg = new GridInstantMessage(World,
6717 m_host.UUID, m_host.Name+", an object owned by "+ 6726 m_host.OwnerID, m_host.Name, destID,
6718 resolveName(m_host.OwnerID)+",", destID, 6727 (byte)InstantMessageDialog.TaskInventoryOffered,
6719 (byte)InstantMessageDialog.InventoryOffered, 6728 false, category+". "+m_host.Name+" is located at "+
6720 false, category+"\n"+m_host.Name+" is located at "+
6721 World.RegionInfo.RegionName+" "+ 6729 World.RegionInfo.RegionName+" "+
6722 m_host.AbsolutePosition.ToString(), 6730 m_host.AbsolutePosition.ToString(),
6723 folderID, true, m_host.AbsolutePosition, 6731 folderID, true, m_host.AbsolutePosition,