diff options
author | UbitUmarov | 2012-09-17 19:38:05 +0100 |
---|---|---|
committer | UbitUmarov | 2012-09-17 19:38:05 +0100 |
commit | c3666c9ec3f0e32443094fbcb683dec7b457a3e6 (patch) | |
tree | 87a235dd51cd7a308e102439dd3b1b5d80fb9df4 /OpenSim/Region | |
parent | same cleanup (diff) | |
download | opensim-SC-c3666c9ec3f0e32443094fbcb683dec7b457a3e6.zip opensim-SC-c3666c9ec3f0e32443094fbcb683dec7b457a3e6.tar.gz opensim-SC-c3666c9ec3f0e32443094fbcb683dec7b457a3e6.tar.bz2 opensim-SC-c3666c9ec3f0e32443094fbcb683dec7b457a3e6.tar.xz |
make sure client still has money at upload
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index ddb69c4..4ba8254 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs | |||
@@ -489,6 +489,7 @@ namespace OpenSim.Region.ClientStack.Linden | |||
489 | cost = (uint)baseCost; | 489 | cost = (uint)baseCost; |
490 | } | 490 | } |
491 | 491 | ||
492 | // check funds | ||
492 | if (mm != null) | 493 | if (mm != null) |
493 | { | 494 | { |
494 | if (!mm.UploadCovered(client.AgentId, (int)cost)) | 495 | if (!mm.UploadCovered(client.AgentId, (int)cost)) |
@@ -565,6 +566,21 @@ namespace OpenSim.Region.ClientStack.Linden | |||
565 | sbyte assType = 0; | 566 | sbyte assType = 0; |
566 | sbyte inType = 0; | 567 | sbyte inType = 0; |
567 | 568 | ||
569 | IClientAPI client = null; | ||
570 | |||
571 | IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>(); | ||
572 | if (mm != null) | ||
573 | { | ||
574 | // make sure client still has enougth credit | ||
575 | if (!mm.UploadCovered(m_HostCapsObj.AgentID, (int)cost)) | ||
576 | { | ||
577 | m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client); | ||
578 | if (client != null) | ||
579 | client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false); | ||
580 | return; | ||
581 | } | ||
582 | } | ||
583 | |||
568 | if (inventoryType == "sound") | 584 | if (inventoryType == "sound") |
569 | { | 585 | { |
570 | inType = 1; | 586 | inType = 1; |