aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
diff options
context:
space:
mode:
authorMW2007-07-22 11:44:36 +0000
committerMW2007-07-22 11:44:36 +0000
commit70fa30204272e874b8e3acccdc2e22cd4e42b2b2 (patch)
tree2f6c3c0f3b3bd60d5972f8dea6b3abeae4dc9065 /OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs
parent* Aerobic erosion now uses Navier Stokes algorithms for wind calculations. (diff)
downloadopensim-SC_OLD-70fa30204272e874b8e3acccdc2e22cd4e42b2b2.zip
opensim-SC_OLD-70fa30204272e874b8e3acccdc2e22cd4e42b2b2.tar.gz
opensim-SC_OLD-70fa30204272e874b8e3acccdc2e22cd4e42b2b2.tar.bz2
opensim-SC_OLD-70fa30204272e874b8e3acccdc2e22cd4e42b2b2.tar.xz
* Some work in progress code: Inventory cache, start of inventory server/service, userprofile cache, inventory handling. (non of it is enabled yet (or at least it shouldn't be).
* Fixed some of the problems with crossing regions when flying: you should no longer sink to ground level when crossing (should keep roughly your right height). Should no longer sometimes get sent back to the centre of the current region when attempting to border cross. But instead sometimes you will find you avatar stop at the edge of region and you will need to start moving again to retry the crossing (which should then work). This code is partly based on Babblefrog's issue #212 patch. [I think I have some ideas of how to solve the stopping at edges problem, just want to get the inventory code done first] * Capabilities code has now been moved to the OpenSim.Framework.Communications project as some of the caps code will be tightly tied to inventory/asset handling and it was causing a two way reference problem when it was in its own project/dll. This is a Big commit as I was going to keep my inventory work local until I had it in a working state, in case it brakes anything, but its getting harder to keep in sync with svn.
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>