From ca5aadfbff63e03b7ca081e753204d8da040c9bb Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 5 Feb 2008 05:26:18 +0000 Subject: * Refactored the sound calls to SceneObjectPart * Fixed a few bugs * Wrote an example module to make certain event systems more mature. --- OpenSim/Region/ClientStack/ClientView.cs | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index e89b722..5fdb9b3 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -581,6 +581,8 @@ namespace OpenSim.Region.ClientStack public event MoneyTransferRequest OnMoneyTransferRequest; + public event MoneyBalanceRequest OnMoneyBalanceRequest; + #region Scene/Avatar to Client @@ -2067,15 +2069,23 @@ namespace OpenSim.Region.ClientStack private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) { MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack; + // validate the agent owns the agentID and sessionID + if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId && money.AgentData.SessionID == sender.SessionId) + { - if (OnMoneyTransferRequest != null) + if (OnMoneyTransferRequest != null) + { + OnMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID, + money.MoneyData.Amount, money.MoneyData.TransactionType, + Util.FieldToString(money.MoneyData.Description)); + } + + return true; + } + else { - OnMoneyTransferRequest(money.MoneyData.SourceID, money.MoneyData.DestID, - money.MoneyData.Amount, money.MoneyData.TransactionType, - Util.FieldToString(money.MoneyData.Description)); + return false; } - - return true; } private bool HandleViewerEffect(IClientAPI sender, Packet Pack) @@ -3434,7 +3444,13 @@ namespace OpenSim.Region.ClientStack #endregion case PacketType.MoneyBalanceRequest: - SendMoneyBalance(LLUUID.Zero, true, new byte[0], MoneyBalance); + MoneyBalanceRequestPacket moneybalancerequestpacket = (MoneyBalanceRequestPacket)Pack; + if (OnMoneyBalanceRequest != null) + { + OnMoneyBalanceRequest(this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID); + } + + break; case PacketType.UUIDNameRequest: UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; -- cgit v1.1