Committing Dee100's balance update patch with a few bug fixes and a twist. Thanks Dee100!
parent
de2ff8e626
commit
97db1e8af0
|
@ -1045,7 +1045,33 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount)
|
public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount)
|
||||||
{
|
{
|
||||||
string description=String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
|
string description=String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
|
||||||
return doMoneyTransfer(fromID, toID, amount, 2, description);
|
|
||||||
|
bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description);
|
||||||
|
|
||||||
|
if (m_MoneyAddress.Length == 0)
|
||||||
|
BalanceUpdate(fromID, toID, give_result, description);
|
||||||
|
|
||||||
|
return give_result;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
private void BalanceUpdate(LLUUID senderID, LLUUID receiverID, bool transactionresult, string description)
|
||||||
|
{
|
||||||
|
IClientAPI sender = LocateClientObject(senderID);
|
||||||
|
IClientAPI receiver = LocateClientObject(receiverID);
|
||||||
|
|
||||||
|
if (senderID != receiverID)
|
||||||
|
{
|
||||||
|
if (sender != null)
|
||||||
|
{
|
||||||
|
sender.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(senderID));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (receiver != null)
|
||||||
|
{
|
||||||
|
receiver.SendMoneyBalance(LLUUID.Random(), transactionresult, Helpers.StringToField(description), GetFundsForAgentID(receiverID));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
Loading…
Reference in New Issue