diff options
author | Melanie Thielker | 2008-08-23 00:44:06 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-08-23 00:44:06 +0000 |
commit | 5d6f92fb9697dc09d26bba236846809c737fc5c0 (patch) | |
tree | 76637af39aaea0b30a19f322cadcdac5e301cb3f /OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | |
parent | * Homer's amazing terrain MapTileRenderer. Thanks Homer! (diff) | |
download | opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.zip opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.gz opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.bz2 opensim-SC_OLD-5d6f92fb9697dc09d26bba236846809c737fc5c0.tar.xz |
Patch #9171
Disallow bulk uploads if money module is present and upload cost
is set and the user hasn't got sufficient funds.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs index fd407d9..d8720db 100644 --- a/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/AssetTransaction/AssetTransactionModule.cs | |||
@@ -261,6 +261,23 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
261 | public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, | 261 | public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, |
262 | byte[] data, bool storeLocal, bool tempFile) | 262 | byte[] data, bool storeLocal, bool tempFile) |
263 | { | 263 | { |
264 | if ((AssetType)type == AssetType.Texture || | ||
265 | (AssetType)type == AssetType.Sound || | ||
266 | (AssetType)type == AssetType.TextureTGA || | ||
267 | (AssetType)type == AssetType.Animation) | ||
268 | { | ||
269 | Scene scene = (Scene)remoteClient.Scene; | ||
270 | IMoneyModule mm = scene.RequestModuleInterface<IMoneyModule>(); | ||
271 | if (mm != null) | ||
272 | { | ||
273 | if (!mm.UploadCovered(remoteClient)) | ||
274 | { | ||
275 | remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | ||
276 | return; | ||
277 | } | ||
278 | } | ||
279 | } | ||
280 | |||
264 | // Console.WriteLine("asset upload of " + assetID); | 281 | // Console.WriteLine("asset upload of " + assetID); |
265 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); | 282 | AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); |
266 | 283 | ||
@@ -288,4 +305,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction | |||
288 | transactions.HandleXfer(xferID, packetID, data); | 305 | transactions.HandleXfer(xferID, packetID, data); |
289 | } | 306 | } |
290 | } | 307 | } |
291 | } \ No newline at end of file | 308 | } |