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
Charles Krinke 2008-05-23 01:38:20 +00:00
parent 8cde4a1c28
commit 7dcaa409b3
4 changed files with 17 additions and 1 deletions

View File

@ -36,6 +36,7 @@ namespace OpenSim.Region.Environment.Interfaces
{ {
bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID, bool ObjectGiveMoney(LLUUID objectID, LLUUID fromID, LLUUID toID,
int amount); int amount);
void ApplyUploadCharge(LLUUID agentID);
event ObjectPaid OnObjectPaid; event ObjectPaid OnObjectPaid;
} }

View File

@ -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) 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));

View File

@ -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> /// <summary>
/// Add an inventory item to an avatar's inventory. /// Add an inventory item to an avatar's inventory.
/// </summary> /// </summary>

View File

@ -2092,7 +2092,7 @@ namespace OpenSim.Region.Environment.Scenes
EventManager.TriggerOnRegisterCaps(agentId, cap); EventManager.TriggerOnRegisterCaps(agentId, cap);
cap.AddNewInventoryItem = AddInventoryItem; cap.AddNewInventoryItem = AddUploadedInventoryItem;
cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset; cap.ItemUpdatedCall = CapsUpdateInventoryItemAsset;
cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset; cap.TaskScriptUpdatedCall = CapsUpdateTaskInventoryScriptAsset;
cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS; cap.CAPSFetchInventoryDescendents = CommsManager.UserProfileCacheService.HandleFetchInventoryDescendentsCAPS;