From 1909d74d5fa8e6cea151bb5ff6b8e40b197b9f90 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 23 Apr 2008 22:44:59 +0000 Subject: * Patch from Melanie. Mantis 0001037: Add various internal plumbing to the example economy module, implements llSetPayPrice(), money() and llGiveMoney() in scripts. Thanks Melanie! * Moves module loading before the script engine so the script engine can pick up events from modules registering interfaces with scene. --- OpenSim/Region/ClientStack/ClientView.cs | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'OpenSim/Region/ClientStack/ClientView.cs') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 9e8830f..216633f 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -234,6 +234,7 @@ namespace OpenSim.Region.ClientStack private UUIDNameRequest handlerTeleportHomeRequest = null; private ScriptAnswer handlerScriptAnswer = null; + private RequestPayPrice handlerRequestPayPrice = null; /* Properties */ @@ -791,6 +792,7 @@ namespace OpenSim.Region.ClientStack public event UUIDNameRequest OnTeleportHomeRequest; public event ScriptAnswer OnScriptAnswer; + public event RequestPayPrice OnRequestPayPrice; #region Scene/Avatar to Client @@ -1167,6 +1169,32 @@ namespace OpenSim.Region.ClientStack OutPacket(money, ThrottleOutPacketType.Task); } + public void SendPayPrice(LLUUID objectID, int[] payPrice) + { + if(payPrice[0] == 0 && + payPrice[1] == 0 && + payPrice[2] == 0 && + payPrice[3] == 0 && + payPrice[4] == 0) + return; + + PayPriceReplyPacket payPriceReply = (PayPriceReplyPacket)PacketPool.Instance.GetPacket(PacketType.PayPriceReply); + payPriceReply.ObjectData.ObjectID = objectID; + payPriceReply.ObjectData.DefaultPayPrice = payPrice[0]; + + payPriceReply.ButtonData=new PayPriceReplyPacket.ButtonDataBlock[4]; + payPriceReply.ButtonData[0]=new PayPriceReplyPacket.ButtonDataBlock(); + payPriceReply.ButtonData[0].PayButton = payPrice[1]; + payPriceReply.ButtonData[1]=new PayPriceReplyPacket.ButtonDataBlock(); + payPriceReply.ButtonData[1].PayButton = payPrice[2]; + payPriceReply.ButtonData[2]=new PayPriceReplyPacket.ButtonDataBlock(); + payPriceReply.ButtonData[2].PayButton = payPrice[3]; + payPriceReply.ButtonData[3]=new PayPriceReplyPacket.ButtonDataBlock(); + payPriceReply.ButtonData[3].PayButton = payPrice[4]; + + OutPacket(payPriceReply, ThrottleOutPacketType.Task); + } + public void SendStartPingCheck(byte seq) { StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck); @@ -4555,6 +4583,14 @@ namespace OpenSim.Region.ClientStack // TODO: handle this packet //m_log.Warn("[CLIENT]: unhandled EconomyDataRequest packet"); break; + case PacketType.RequestPayPrice: + RequestPayPricePacket requestPayPricePacket = (RequestPayPricePacket)Pack; + handlerRequestPayPrice = OnRequestPayPrice; + if (handlerRequestPayPrice != null) + { + handlerRequestPayPrice(this, requestPayPricePacket.ObjectData.ObjectID); + } + break; #endregion -- cgit v1.1