From 3370d581e1c5297721a05db857a016e1d728018f Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Wed, 23 Apr 2008 12:21:54 +0000 Subject: * Patch #1026 - llDialog support -- Thanks Melanie! --- OpenSim/Region/ClientStack/ClientView.cs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index a58f88f..9e8830f 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -233,6 +233,7 @@ namespace OpenSim.Region.ClientStack private RequestAsset handlerRequestAsset = null; // OnRequestAsset; private UUIDNameRequest handlerTeleportHomeRequest = null; + private ScriptAnswer handlerScriptAnswer = null; /* Properties */ @@ -789,6 +790,8 @@ namespace OpenSim.Region.ClientStack public event UUIDNameRequest OnTeleportHomeRequest; + public event ScriptAnswer OnScriptAnswer; + #region Scene/Avatar to Client /// @@ -2484,6 +2487,20 @@ namespace OpenSim.Region.ClientStack return true; } + public void SendScriptQuestion(LLUUID taskID, string taskName, string ownerName, LLUUID itemID, int question) + { + ScriptQuestionPacket scriptQuestion = (ScriptQuestionPacket)PacketPool.Instance.GetPacket(PacketType.ScriptQuestion); + scriptQuestion.Data = new ScriptQuestionPacket.DataBlock(); + // TODO: don't create new blocks if recycling an old packet + scriptQuestion.Data.TaskID = taskID; + scriptQuestion.Data.ItemID = itemID; + scriptQuestion.Data.Questions = question; + scriptQuestion.Data.ObjectName = Helpers.StringToField(taskName); + scriptQuestion.Data.ObjectOwner = Helpers.StringToField(ownerName); + + OutPacket(scriptQuestion, ThrottleOutPacketType.Task); + } + protected virtual bool Logout(IClientAPI client, Packet packet) { m_log.Info("[CLIENT]: Got a logout request"); @@ -3840,6 +3857,16 @@ namespace OpenSim.Region.ClientStack } break; + case PacketType.ScriptAnswerYes: + ScriptAnswerYesPacket scriptAnswer = (ScriptAnswerYesPacket)Pack; + + handlerScriptAnswer = OnScriptAnswer; + if (handlerScriptAnswer != null) + { + handlerScriptAnswer(this, scriptAnswer.Data.TaskID, scriptAnswer.Data.ItemID, scriptAnswer.Data.Questions); + } + break; + #endregion #region Inventory/Asset/Other related packets -- cgit v1.1