mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 18:25:33 +08:00
Patch #9171
Disallow bulk uploads if money module is present and upload cost is set and the user hasn't got sufficient funds.
This commit is contained in:
@@ -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<IMoneyModule>();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user