diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs | 304 |
1 files changed, 152 insertions, 152 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs index af3c04f..92627d1 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.Inventory.cs | |||
@@ -1,152 +1,152 @@ | |||
1 | /** | 1 | /** |
2 | * Copyright (c) 2008, Contributors. All rights reserved. | 2 | * Copyright (c) 2008, Contributors. All rights reserved. |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without modification, | 5 | * Redistribution and use in source and binary forms, with or without modification, |
6 | * are permitted provided that the following conditions are met: | 6 | * are permitted provided that the following conditions are met: |
7 | * | 7 | * |
8 | * * Redistributions of source code must retain the above copyright notice, | 8 | * * Redistributions of source code must retain the above copyright notice, |
9 | * this list of conditions and the following disclaimer. | 9 | * this list of conditions and the following disclaimer. |
10 | * * Redistributions in binary form must reproduce the above copyright notice, | 10 | * * Redistributions in binary form must reproduce the above copyright notice, |
11 | * this list of conditions and the following disclaimer in the documentation | 11 | * this list of conditions and the following disclaimer in the documentation |
12 | * and/or other materials provided with the distribution. | 12 | * and/or other materials provided with the distribution. |
13 | * * Neither the name of the Organizations nor the names of Individual | 13 | * * Neither the name of the Organizations nor the names of Individual |
14 | * Contributors may be used to endorse or promote products derived from | 14 | * Contributors may be used to endorse or promote products derived from |
15 | * this software without specific prior written permission. | 15 | * this software without specific prior written permission. |
16 | * | 16 | * |
17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL | 19 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
20 | * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 20 | * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE | 21 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE |
22 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | 22 | * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED |
23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | 23 | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
25 | * OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections; | 30 | using System.Collections; |
31 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Threading; | 33 | using System.Threading; |
34 | 34 | ||
35 | using log4net; | 35 | using log4net; |
36 | using Nini.Config; | 36 | using Nini.Config; |
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | 38 | ||
39 | using OpenSim.Framework; | 39 | using OpenSim.Framework; |
40 | using OpenSim.Framework.Communications; | 40 | using OpenSim.Framework.Communications; |
41 | using OpenSim.Framework.Communications.Cache; | 41 | using OpenSim.Framework.Communications.Cache; |
42 | using OpenSim.Framework.Servers; | 42 | using OpenSim.Framework.Servers; |
43 | using OpenSim.Region.Environment; | 43 | using OpenSim.Region.Environment; |
44 | using OpenSim.Region.Environment.Scenes; | 44 | using OpenSim.Region.Environment.Scenes; |
45 | 45 | ||
46 | namespace OpenSim.Region.Environment.Scenes.Hypergrid | 46 | namespace OpenSim.Region.Environment.Scenes.Hypergrid |
47 | { | 47 | { |
48 | public partial class HGScene : Scene | 48 | public partial class HGScene : Scene |
49 | { | 49 | { |
50 | #region Fields | 50 | #region Fields |
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | private HGAssetMapper m_assMapper; | 53 | private HGAssetMapper m_assMapper; |
54 | 54 | ||
55 | #endregion | 55 | #endregion |
56 | 56 | ||
57 | #region Constructors | 57 | #region Constructors |
58 | 58 | ||
59 | public HGScene(RegionInfo regInfo, AgentCircuitManager authen, | 59 | public HGScene(RegionInfo regInfo, AgentCircuitManager authen, |
60 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, | 60 | CommunicationsManager commsMan, SceneCommunicationService sceneGridService, |
61 | AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, | 61 | AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, |
62 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, | 62 | ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, |
63 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) | 63 | bool SeeIntoRegionFromNeighbor, IConfigSource config, string simulatorVersion) |
64 | : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, moduleLoader, | 64 | : base(regInfo, authen, commsMan, sceneGridService, assetCach, storeManager, httpServer, moduleLoader, |
65 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) | 65 | dumpAssetsToFile, physicalPrim, SeeIntoRegionFromNeighbor, config, simulatorVersion) |
66 | { | 66 | { |
67 | m_log.Info("[HGScene]: Starting HGScene."); | 67 | m_log.Info("[HGScene]: Starting HGScene."); |
68 | m_assMapper = new HGAssetMapper(this); | 68 | m_assMapper = new HGAssetMapper(this); |
69 | 69 | ||
70 | EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem; | 70 | EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem; |
71 | } | 71 | } |
72 | 72 | ||
73 | #endregion | 73 | #endregion |
74 | 74 | ||
75 | #region Event handlers | 75 | #region Event handlers |
76 | 76 | ||
77 | public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel) | 77 | public void UploadInventoryItem(UUID avatarID, UUID assetID, string name, int userlevel) |
78 | { | 78 | { |
79 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(avatarID); | 79 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(avatarID); |
80 | if (userInfo != null) | 80 | if (userInfo != null) |
81 | { | 81 | { |
82 | m_assMapper.Post(assetID, avatarID); | 82 | m_assMapper.Post(assetID, avatarID); |
83 | } | 83 | } |
84 | } | 84 | } |
85 | 85 | ||
86 | #endregion | 86 | #endregion |
87 | 87 | ||
88 | #region Overrides of Scene.Inventory methods | 88 | #region Overrides of Scene.Inventory methods |
89 | 89 | ||
90 | /// | 90 | /// |
91 | /// CapsUpdateInventoryItemAsset | 91 | /// CapsUpdateInventoryItemAsset |
92 | /// | 92 | /// |
93 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) | 93 | public override UUID CapsUpdateInventoryItemAsset(IClientAPI remoteClient, UUID itemID, byte[] data) |
94 | { | 94 | { |
95 | UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data); | 95 | UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data); |
96 | 96 | ||
97 | UploadInventoryItem(remoteClient.AgentId, newAssetID, "", 0); | 97 | UploadInventoryItem(remoteClient.AgentId, newAssetID, "", 0); |
98 | 98 | ||
99 | return newAssetID; | 99 | return newAssetID; |
100 | } | 100 | } |
101 | 101 | ||
102 | /// | 102 | /// |
103 | /// DeleteToInventory | 103 | /// DeleteToInventory |
104 | /// | 104 | /// |
105 | public override UUID DeleteToInventory(int destination, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) | 105 | public override UUID DeleteToInventory(int destination, UUID folderID, SceneObjectGroup objectGroup, IClientAPI remoteClient) |
106 | { | 106 | { |
107 | UUID assetID = base.DeleteToInventory(destination, folderID, objectGroup, remoteClient); | 107 | UUID assetID = base.DeleteToInventory(destination, folderID, objectGroup, remoteClient); |
108 | 108 | ||
109 | if (!assetID.Equals(UUID.Zero)) | 109 | if (!assetID.Equals(UUID.Zero)) |
110 | { | 110 | { |
111 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); | 111 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); |
112 | } | 112 | } |
113 | else | 113 | else |
114 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); | 114 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); |
115 | 115 | ||
116 | return assetID; | 116 | return assetID; |
117 | } | 117 | } |
118 | 118 | ||
119 | /// | 119 | /// |
120 | /// RezObject | 120 | /// RezObject |
121 | /// | 121 | /// |
122 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, | 122 | public override SceneObjectGroup RezObject(IClientAPI remoteClient, UUID itemID, Vector3 RayEnd, Vector3 RayStart, |
123 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 123 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
124 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) | 124 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) |
125 | { | 125 | { |
126 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); | 126 | CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId); |
127 | if (userInfo != null) | 127 | if (userInfo != null) |
128 | { | 128 | { |
129 | if (userInfo.RootFolder != null) | 129 | if (userInfo.RootFolder != null) |
130 | { | 130 | { |
131 | InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); | 131 | InventoryItemBase item = userInfo.RootFolder.FindItem(itemID); |
132 | 132 | ||
133 | if (item != null) | 133 | if (item != null) |
134 | { | 134 | { |
135 | m_assMapper.Get(item.AssetID, remoteClient.AgentId); | 135 | m_assMapper.Get(item.AssetID, remoteClient.AgentId); |
136 | 136 | ||
137 | } | 137 | } |
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | // OK, we're done fetching. Pass it up to the default RezObject | 141 | // OK, we're done fetching. Pass it up to the default RezObject |
142 | return base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, | 142 | return base.RezObject(remoteClient, itemID, RayEnd, RayStart, RayTargetID, BypassRayCast, RayEndIsIntersection, |
143 | RezSelected, RemoveItem, fromTaskID, attachment); | 143 | RezSelected, RemoveItem, fromTaskID, attachment); |
144 | 144 | ||
145 | } | 145 | } |
146 | 146 | ||
147 | 147 | ||
148 | #endregion | 148 | #endregion |
149 | 149 | ||
150 | } | 150 | } |
151 | 151 | ||
152 | } | 152 | } |