From fddefff28479b6874235419dd5d26214afabb4f2 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Wed, 23 Dec 2009 10:34:11 -0800 Subject: [PATCH] Thank you kindly, Ziah for a patch that adds the channel to the class ChatEventArgs and retrieves it's value along with the others from the OSChatMessage in HandleChatPackage. With this the MRM Script can check if a ChatEvent is coming in on a specifc Channel. The Second Part adds the Method say(string msg , int channel) to send a chat message on the specified channel. The idea behind this is to enable MRM's to communicate with regular LSL or OSSL Scripts so that they may can act as a Backend to access a Database or do business Logic for those Scripts. Signed-off-by: Charles Krinke --- .../Scripting/Minimodule/Interfaces/IObject.cs | 2 ++ .../Scripting/Minimodule/Interfaces/IWorld.cs | 1 + .../OptionalModules/Scripting/Minimodule/SOPObject.cs | 9 +++++++++ .../Region/OptionalModules/Scripting/Minimodule/World.cs | 6 ++++-- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 19f72109dc..9d6466714e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs @@ -179,6 +179,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule /// /// The message to send to the user void Say(string msg); + + void Say(string msg,int channel); //// /// Grants access to the objects inventory diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IWorld.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IWorld.cs index 3c14ed5186..3b3b3d0e9e 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IWorld.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IWorld.cs @@ -41,6 +41,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule { public string Text; public IEntity Sender; + public int Channel; } public delegate void OnChatDelegate(IWorld sender, ChatEventArgs e); diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 143c45490f..9596d13a32 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -384,6 +384,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false); } + public void Say(string msg,int channel) + { + if (!CanEdit()) + return; + + SceneObjectPart sop = GetSOP(); + m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false); + } + #endregion diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 6fcb5d04f3..82020cb4cc 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs @@ -148,7 +148,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule ChatEventArgs e = new ChatEventArgs(); e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security); e.Text = chat.Message; - + e.Channel = chat.Channel; + _OnChat(this, e); return; } @@ -158,7 +159,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule ChatEventArgs e = new ChatEventArgs(); e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security); e.Text = chat.Message; - + e.Channel = chat.Channel; + _OnChat(this, e); return; }