make sure client still has money at upload

avinationmerge
UbitUmarov 2012-09-17 19:38:05 +01:00
parent 7f5b1182ef
commit c3666c9ec3
1 changed files with 16 additions and 0 deletions

View File

@ -489,6 +489,7 @@ namespace OpenSim.Region.ClientStack.Linden
cost = (uint)baseCost;
}
// check funds
if (mm != null)
{
if (!mm.UploadCovered(client.AgentId, (int)cost))
@ -565,6 +566,21 @@ namespace OpenSim.Region.ClientStack.Linden
sbyte assType = 0;
sbyte inType = 0;
IClientAPI client = null;
IMoneyModule mm = m_Scene.RequestModuleInterface<IMoneyModule>();
if (mm != null)
{
// make sure client still has enougth credit
if (!mm.UploadCovered(m_HostCapsObj.AgentID, (int)cost))
{
m_Scene.TryGetClient(m_HostCapsObj.AgentID, out client);
if (client != null)
client.SendAgentAlertMessage("Unable to upload asset. Insufficient funds.", false);
return;
}
}
if (inventoryType == "sound")
{
inType = 1;