aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.cs
diff options
context:
space:
mode:
authoralondria2008-02-02 22:53:01 +0000
committeralondria2008-02-02 22:53:01 +0000
commit742ed9537df1cb45a0c57e38e4c0c0735fc92eca (patch)
treeda78e2838e34139dfc4aa8f4fa5e118136781b16 /OpenSim/Region/ClientStack/ClientView.cs
parentAdded llParseString2List (and a few extra methods to LSL_Types.list). (diff)
downloadopensim-SC-742ed9537df1cb45a0c57e38e4c0c0735fc92eca.zip
opensim-SC-742ed9537df1cb45a0c57e38e4c0c0735fc92eca.tar.gz
opensim-SC-742ed9537df1cb45a0c57e38e4c0c0735fc92eca.tar.bz2
opensim-SC-742ed9537df1cb45a0c57e38e4c0c0735fc92eca.tar.xz
Implements LSL function llDialog().
The ScriptDialogReply packet handler is a bit of a hack job. It is currently handled similar to ChatFromViewer, which will trigger the listen() event, however this is not exactly how LL's implementation works and will/can be fixed up later.
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs37
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index c68c3c7..4aceac0 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -1299,10 +1299,28 @@ namespace OpenSim.Region.ClientStack
1299 loadURL.Data.OwnerIsGroup = groupOwned; 1299 loadURL.Data.OwnerIsGroup = groupOwned;
1300 loadURL.Data.Message = Helpers.StringToField(message); 1300 loadURL.Data.Message = Helpers.StringToField(message);
1301 loadURL.Data.URL = Helpers.StringToField(url); 1301 loadURL.Data.URL = Helpers.StringToField(url);
1302
1303 OutPacket(loadURL, ThrottleOutPacketType.Task); 1302 OutPacket(loadURL, ThrottleOutPacketType.Task);
1304 } 1303 }
1305 1304
1305 public void SendDialog(string objectname, LLUUID objectID, LLUUID ownerID, string msg, LLUUID textureID, int ch, string[] buttonlabels)
1306 {
1307 ScriptDialogPacket dialog = (ScriptDialogPacket)PacketPool.Instance.GetPacket(PacketType.ScriptDialog);
1308 dialog.Data.ObjectID = objectID;
1309 dialog.Data.ObjectName = Helpers.StringToField(objectname);
1310 dialog.Data.FirstName = Helpers.StringToField(this.FirstName);
1311 dialog.Data.LastName = Helpers.StringToField(this.LastName);
1312 dialog.Data.Message = Helpers.StringToField(msg);
1313 dialog.Data.ImageID = textureID;
1314 dialog.Data.ChatChannel = ch;
1315 ScriptDialogPacket.ButtonsBlock[] buttons = new ScriptDialogPacket.ButtonsBlock[buttonlabels.Length];
1316 for (int i = 0; i < buttonlabels.Length; i++)
1317 {
1318 buttons[i] = new ScriptDialogPacket.ButtonsBlock();
1319 buttons[i].ButtonLabel = Helpers.StringToField(buttonlabels[i]);
1320 }
1321 dialog.Buttons = buttons;
1322 OutPacket(dialog, ThrottleOutPacketType.Task);
1323 }
1306 1324
1307 public void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) 1325 public void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID)
1308 { 1326 {
@@ -2617,6 +2635,23 @@ namespace OpenSim.Region.ClientStack
2617 OnChatFromViewer(this, args); 2635 OnChatFromViewer(this, args);
2618 } 2636 }
2619 break; 2637 break;
2638 case PacketType.ScriptDialogReply:
2639 ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
2640 int ch = rdialog.Data.ChatChannel;
2641 byte[] msg = rdialog.Data.ButtonLabel;
2642 if (OnChatFromViewer != null)
2643 {
2644 ChatFromViewerArgs args = new ChatFromViewerArgs();
2645 args.Channel = ch;
2646 args.From = String.Empty;
2647 args.Message = Helpers.FieldToUTF8String(msg);
2648 args.Type = ChatTypeEnum.Shout;
2649 args.Position = new LLVector3();
2650 args.Scene = Scene;
2651 args.Sender = this;
2652 OnChatFromViewer(this, args);
2653 }
2654 break;
2620 case PacketType.ImprovedInstantMessage: 2655 case PacketType.ImprovedInstantMessage:
2621 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; 2656 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack;
2622 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 2657 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);