From 5d6f92fb9697dc09d26bba236846809c737fc5c0 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 23 Aug 2008 00:44:06 +0000 Subject: Patch #9171 Disallow bulk uploads if money module is present and upload cost is set and the user hasn't got sufficient funds. --- .../Agent/AssetTransaction/AssetTransactionModule.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Environment/Modules/Agent/AssetTransaction') 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 public void HandleUDPUploadRequest(IClientAPI remoteClient, LLUUID assetID, LLUUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile) { + if ((AssetType)type == AssetType.Texture || + (AssetType)type == AssetType.Sound || + (AssetType)type == AssetType.TextureTGA || + (AssetType)type == AssetType.Animation) + { + Scene scene = (Scene)remoteClient.Scene; + IMoneyModule mm = scene.RequestModuleInterface(); + if (mm != null) + { + if (!mm.UploadCovered(remoteClient)) + { + remoteClient.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); + return; + } + } + } + // Console.WriteLine("asset upload of " + assetID); AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); @@ -288,4 +305,4 @@ namespace OpenSim.Region.Environment.Modules.Agent.AssetTransaction transactions.HandleXfer(xferID, packetID, data); } } -} \ No newline at end of file +} -- cgit v1.1