Revert "Make client event handlers for money only work on root agents"

This reverts commit a8913141c0.

	Pulling this back until some testing under various money
	modules can be done. Need to be able to make purchases as
	a child agent.
bulletsim
BlueWall 2011-05-24 16:33:51 -04:00
parent a8913141c0
commit ef3f6b4e63
1 changed files with 6 additions and 30 deletions

View File

@ -177,37 +177,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
scene.EventManager.OnClientClosed += ClientLoggedOut; scene.EventManager.OnClientClosed += ClientLoggedOut;
scene.EventManager.OnValidateLandBuy += ValidateLandBuy; scene.EventManager.OnValidateLandBuy += ValidateLandBuy;
scene.EventManager.OnLandBuy += processLandBuy; scene.EventManager.OnLandBuy += processLandBuy;
scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
} }
} }
void OnMakeRootAgent(ScenePresence presence)
{
// Do this only for root agents
// Some implementations register $$ for
// child agents, then that never goes away
// We will send a zero balance when they are
// made root.
//
// Modules overriding this should only deal with
// root agents as well.
//
IClientAPI client = presence.ControllingClient;
client.OnEconomyDataRequest += EconomyDataRequestHandler;
client.OnMoneyBalanceRequest += SendMoneyBalance;
client.OnRequestPayPrice += requestPayPrice;
client.OnObjectBuy += ObjectBuy;
client.OnLogout += ClientClosed;
client.SendMoneyBalance (UUID.Random(), true, new byte[0], 0);
}
void HandleSceneEventManagerOnMakeRootAgent (ScenePresence presence)
{
}
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
} }
@ -305,9 +277,13 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
private void OnNewClient(IClientAPI client) private void OnNewClient(IClientAPI client)
{ {
GetClientFunds(client); GetClientFunds(client);
// Moved the event registrations to fire them when
// the agent becomes root
// Subscribe to Money messages
client.OnEconomyDataRequest += EconomyDataRequestHandler;
client.OnMoneyBalanceRequest += SendMoneyBalance;
client.OnRequestPayPrice += requestPayPrice;
client.OnObjectBuy += ObjectBuy;
client.OnLogout += ClientClosed;
} }
/// <summary> /// <summary>