Thank you kindly, Melanie, for a patch which:
Previously, upload charging was possible only for UPD uploads. This is because UDP uploads are charged by the viewer, while in CAPS, this was changed to be server side, so hackers couldn't avoid paying the upload charge. This patch adds a method to allow implementation of this serverside charge.0.6.0-stable
parent
8cde4a1c28
commit
7dcaa409b3
|
@ -36,6 +36,7 @@ namespace OpenSim.Region.Environment.Interfaces
|
|||
{
|
||||
bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID,
|
||||
int amount);
|
||||
void ApplyUploadCharge(LLUUID agentID);
|
||||
|
||||
event ObjectPaid OnObjectPaid;
|
||||
}
|
||||
|
|
|
@ -182,6 +182,10 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney
|
|||
}
|
||||
}
|
||||
|
||||
public void ApplyUploadCharge(LLUUID agentID)
|
||||
{
|
||||
}
|
||||
|
||||
public bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, int amount)
|
||||
{
|
||||
string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
|
||||
|
|
|
@ -59,6 +59,17 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
public void AddUploadedInventoryItem(LLUUID agentID, InventoryItemBase item)
|
||||
{
|
||||
IMoneyModule money=RequestModuleInterface<IMoneyModule>();
|
||||
if(money != null)
|
||||
{
|
||||
money.ApplyUploadCharge(agentID);
|
||||
}
|
||||
|
||||
AddInventoryItem(agentID, item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add an inventory item to an avatar's inventory.
|
||||
/// </summary>
|
||||
|
|
|
@ -2092,7 +2092,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
|
||||
EventManager.TriggerOnRegisterCaps(agentId, cap);
|
||||
|
||||
cap.AddNewInventoryItem = AddInventoryItem;
|
||||
cap.AddNewInventoryItem = AddUploadedInventoryItem;
|
||||
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
|
||||
cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
|
||||
cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;
|
||||
|
|
Loading…
Reference in New Issue