mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
make sure client still has money at upload
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user