aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-09-24 13:41:48 +0200
committerMelanie2012-09-24 13:41:48 +0200
commit6963b96bd05b17624a2e46726b033e179d50b280 (patch)
treedbb2c75876bf0bb7d530210dbe2665caae401897 /OpenSim/Region
parentChange the poll service to use a thread pool for replies to make sure the (diff)
downloadopensim-SC-6963b96bd05b17624a2e46726b033e179d50b280.zip
opensim-SC-6963b96bd05b17624a2e46726b033e179d50b280.tar.gz
opensim-SC-6963b96bd05b17624a2e46726b033e179d50b280.tar.bz2
opensim-SC-6963b96bd05b17624a2e46726b033e179d50b280.tar.xz
If an asset upload transaction doesn't exist for a CreateInventory request,
simply process it as if UUID.Zero had been given.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs12
-rw-r--r--OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs57
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs2
4 files changed, 38 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
index b557ffe..8a4fd8f 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
146 } 146 }
147 } 147 }
148 148
149 public void RequestCreateInventoryItem(IClientAPI remoteClient, 149 public bool RequestCreateInventoryItem(IClientAPI remoteClient,
150 UUID transactionID, UUID folderID, uint callbackID, 150 UUID transactionID, UUID folderID, uint callbackID,
151 string description, string name, sbyte invType, 151 string description, string name, sbyte invType,
152 sbyte type, byte wearableType, uint nextOwnerMask) 152 sbyte type, byte wearableType, uint nextOwnerMask)
@@ -160,14 +160,16 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
160 } 160 }
161 161
162 if (uploader != null) 162 if (uploader != null)
163 {
163 uploader.RequestCreateInventoryItem( 164 uploader.RequestCreateInventoryItem(
164 remoteClient, transactionID, folderID, 165 remoteClient, transactionID, folderID,
165 callbackID, description, name, invType, type, 166 callbackID, description, name, invType, type,
166 wearableType, nextOwnerMask); 167 wearableType, nextOwnerMask);
167 else 168
168 m_log.ErrorFormat( 169 return true;
169 "[AGENT ASSET TRANSACTIONS]: Could not find uploader with transaction ID {0} when handling request to create inventory item {1} from {2}", 170 }
170 transactionID, name, remoteClient.Name); 171
172 return false;
171 } 173 }
172 174
173 /// <summary> 175 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
index 7081989..441c4ff 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
158 /// <param name="type"></param> 158 /// <param name="type"></param>
159 /// <param name="wearableType"></param> 159 /// <param name="wearableType"></param>
160 /// <param name="nextOwnerMask"></param> 160 /// <param name="nextOwnerMask"></param>
161 public void HandleItemCreationFromTransaction(IClientAPI remoteClient, 161 public bool HandleItemCreationFromTransaction(IClientAPI remoteClient,
162 UUID transactionID, UUID folderID, uint callbackID, 162 UUID transactionID, UUID folderID, uint callbackID,
163 string description, string name, sbyte invType, 163 string description, string name, sbyte invType,
164 sbyte type, byte wearableType, uint nextOwnerMask) 164 sbyte type, byte wearableType, uint nextOwnerMask)
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
169 AgentAssetTransactions transactions = 169 AgentAssetTransactions transactions =
170 GetUserTransactions(remoteClient.AgentId); 170 GetUserTransactions(remoteClient.AgentId);
171 171
172 transactions.RequestCreateInventoryItem(remoteClient, transactionID, 172 return transactions.RequestCreateInventoryItem(remoteClient, transactionID,
173 folderID, callbackID, description, name, invType, type, 173 folderID, callbackID, description, name, invType, type,
174 wearableType, nextOwnerMask); 174 wearableType, nextOwnerMask);
175 } 175 }
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 9a56f42..305a818 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -186,44 +186,43 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
186 if (folder == null || folder.Owner != remoteClient.AgentId) 186 if (folder == null || folder.Owner != remoteClient.AgentId)
187 return; 187 return;
188 188
189 if (transactionID == UUID.Zero) 189 if (transactionID != UUID.Zero)
190 { 190 {
191 ScenePresence presence; 191 IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule;
192 if (m_Scene.TryGetScenePresence(remoteClient.AgentId, out presence)) 192 if (agentTransactions != null)
193 { 193 {
194 byte[] data = null; 194 if (agentTransactions.HandleItemCreationFromTransaction(
195 remoteClient, transactionID, folderID, callbackID, description,
196 name, invType, assetType, wearableType, nextOwnerMask))
197 return;
198 }
199 }
195 200
196 if (invType == (sbyte)InventoryType.Landmark && presence != null) 201 ScenePresence presence;
197 { 202 if (m_Scene.TryGetScenePresence(remoteClient.AgentId, out presence))
198 string suffix = string.Empty, prefix = string.Empty; 203 {
199 string strdata = GenerateLandmark(presence, out prefix, out suffix); 204 byte[] data = null;
200 data = Encoding.ASCII.GetBytes(strdata);
201 name = prefix + name;
202 description += suffix;
203 }
204 205
205 AssetBase asset = m_Scene.CreateAsset(name, description, assetType, data, remoteClient.AgentId); 206 if (invType == (sbyte)InventoryType.Landmark && presence != null)
206 m_Scene.AssetService.Store(asset);
207 m_Scene.CreateNewInventoryItem(
208 remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
209 name, description, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
210 }
211 else
212 { 207 {
213 m_log.ErrorFormat( 208 string suffix = string.Empty, prefix = string.Empty;
214 "[INVENTORY ACCESS MODULE]: ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem", 209 string strdata = GenerateLandmark(presence, out prefix, out suffix);
215 remoteClient.AgentId); 210 data = Encoding.ASCII.GetBytes(strdata);
211 name = prefix + name;
212 description += suffix;
216 } 213 }
214
215 AssetBase asset = m_Scene.CreateAsset(name, description, assetType, data, remoteClient.AgentId);
216 m_Scene.AssetService.Store(asset);
217 m_Scene.CreateNewInventoryItem(
218 remoteClient, remoteClient.AgentId.ToString(), string.Empty, folderID,
219 name, description, 0, callbackID, asset, invType, nextOwnerMask, creationDate);
217 } 220 }
218 else 221 else
219 { 222 {
220 IAgentAssetTransactions agentTransactions = m_Scene.AgentTransactionsModule; 223 m_log.ErrorFormat(
221 if (agentTransactions != null) 224 "[INVENTORY ACCESS MODULE]: ScenePresence for agent uuid {0} unexpectedly not found in CreateNewInventoryItem",
222 { 225 remoteClient.AgentId);
223 agentTransactions.HandleItemCreationFromTransaction(
224 remoteClient, transactionID, folderID, callbackID, description,
225 name, invType, assetType, wearableType, nextOwnerMask);
226 }
227 } 226 }
228 } 227 }
229 228
diff --git a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
index 0cc8fb6..e0aad2b 100644
--- a/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAgentAssetTransactions.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Region.Framework.Interfaces
36 void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID, 36 void HandleItemUpdateFromTransaction(IClientAPI remoteClient, UUID transactionID,
37 InventoryItemBase item); 37 InventoryItemBase item);
38 38
39 void HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID, 39 bool HandleItemCreationFromTransaction(IClientAPI remoteClient, UUID transactionID, UUID folderID,
40 uint callbackID, string description, string name, sbyte invType, 40 uint callbackID, string description, string name, sbyte invType,
41 sbyte type, byte wearableType, uint nextOwnerMask); 41 sbyte type, byte wearableType, uint nextOwnerMask);
42 42