aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs72
1 files changed, 71 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
index e963737..126b636 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
@@ -26,11 +26,14 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.IO;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using libsecondlife; 31using libsecondlife;
31using libsecondlife.Packets; 32using libsecondlife.Packets;
32using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
33using OpenSim.Framework.Types; 34using OpenSim.Framework.Types;
35using OpenSim.Framework.Communications.Caches;
36using OpenSim.Framework.Data;
34 37
35namespace OpenSim.Region.Environment.Scenes 38namespace OpenSim.Region.Environment.Scenes
36{ 39{
@@ -139,7 +142,7 @@ namespace OpenSim.Region.Environment.Scenes
139 /// <param name="fromAgentID"></param> 142 /// <param name="fromAgentID"></param>
140 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 143 public void SimChat(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
141 { 144 {
142 ScenePresence avatar = null; 145 ScenePresence avatar = null;
143 if (this.Avatars.ContainsKey(fromAgentID)) 146 if (this.Avatars.ContainsKey(fromAgentID))
144 { 147 {
145 avatar = this.Avatars[fromAgentID]; 148 avatar = this.Avatars[fromAgentID];
@@ -343,6 +346,29 @@ namespace OpenSim.Region.Environment.Scenes
343 } 346 }
344 } 347 }
345 } 348 }
349
350 /// <summary>
351 ///
352 /// </summary>
353 /// <param name="remoteClient"></param>
354 /// <param name="primLocalID"></param>
355 public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
356 {
357 Primitive prim = null;
358 foreach (EntityBase ent in Entities.Values)
359 {
360 if (ent is SceneObject)
361 {
362 prim = ((SceneObject)ent).HasChildPrim(primLocalID);
363 if (prim != null)
364 {
365 prim.GetInventory(remoteClient, primLocalID);
366 break;
367 }
368 }
369 }
370 }
371
346 /// <summary> 372 /// <summary>
347 /// 373 ///
348 /// </summary> 374 /// </summary>
@@ -623,6 +649,50 @@ namespace OpenSim.Region.Environment.Scenes
623 } 649 }
624 650
625 /// <summary> 651 /// <summary>
652 /// temporary method to test out creating new inventory items
653 /// </summary>
654 /// <param name="remoteClient"></param>
655 /// <param name="transActionID"></param>
656 /// <param name="folderID"></param>
657 /// <param name="callbackID"></param>
658 /// <param name="description"></param>
659 /// <param name="name"></param>
660 /// <param name="invType"></param>
661 /// <param name="type"></param>
662 /// <param name="wearableType"></param>
663 /// <param name="nextOwnerMask"></param>
664 public void CreateNewInventoryItem(IClientAPI remoteClient, LLUUID transActionID, LLUUID folderID, uint callbackID, string description, string name, sbyte invType, sbyte type, byte wearableType, uint nextOwnerMask)
665 {
666 CachedUserInfo userInfo = commsManager.UserProfilesCache.GetUserDetails(remoteClient.AgentId);
667 if (userInfo != null)
668 {
669 AssetBase asset = new AssetBase();
670 asset.Name = name;
671 asset.Description = description;
672 asset.InvType = invType;
673 asset.Type = type;
674 asset.FullID = LLUUID.Random();
675 asset.Data = new byte[0];
676 this.assetCache.AddAsset(asset);
677
678 InventoryItemBase item = new InventoryItemBase();
679 item.avatarID = remoteClient.AgentId;
680 item.creatorsID = remoteClient.AgentId;
681 item.inventoryID = LLUUID.Random();
682 item.assetID = asset.FullID;
683 item.inventoryDescription = description;
684 item.inventoryName = name;
685 item.type = invType;
686 item.parentFolderID = folderID;
687 item.inventoryCurrentPermissions = 2147483647;
688 item.inventoryNextPermissions = nextOwnerMask;
689
690 userInfo.ItemReceive(remoteClient.AgentId, item);
691 remoteClient.SendInventoryItemUpdate(item);
692 }
693 }
694
695 /// <summary>
626 /// Sends prims to a client 696 /// Sends prims to a client
627 /// </summary> 697 /// </summary>
628 /// <param name="RemoteClient">Client to send to</param> 698 /// <param name="RemoteClient">Client to send to</param>