From 4e45718833f72b9149aed6d503e967b8916e5d08 Mon Sep 17 00:00:00 2001 From: Mikko Pallari Date: Thu, 15 Apr 2010 08:23:51 +0300 Subject: Added overload of SendGenericMessage to LLClientView with string list as parameter. Now modules themselfs don't necessarily need to convert strings to byte arrays. Added this as it was removed in LightShare patch. --- OpenSim/Client/MXP/ClientStack/MXPClientView.cs | 4 ++++ OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | 4 ++++ OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | 4 ++++ OpenSim/Framework/IClientAPI.cs | 1 + OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 15 +++++++++++++++ OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | 4 ++++ .../Agent/InternetRelayClientView/Server/IRCClientView.cs | 5 +++++ OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 5 +++++ OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 9 files changed, 47 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 3e92658..d742039 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs @@ -931,6 +931,10 @@ namespace OpenSim.Client.MXP.ClientStack // Need to translate to MXP somehow } + public void SendGenericMessage(string method, List message) + { + } + public void SendGenericMessage(string method, List message) { // Need to translate to MXP somehow diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index c293480..d725943 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs @@ -504,6 +504,10 @@ namespace OpenSim.Client.Sirikata.ClientStack throw new System.NotImplementedException(); } + public void SendGenericMessage(string method, List message) + { + } + public void SendGenericMessage(string method, List message) { throw new System.NotImplementedException(); diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index 51026ab..2eec844 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs @@ -510,6 +510,10 @@ namespace OpenSim.Client.VWoHTTP.ClientStack throw new System.NotImplementedException(); } + public void SendGenericMessage(string method, List message) + { + } + public void SendGenericMessage(string method, List message) { throw new System.NotImplementedException(); diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index f51bf71..c1333fc 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -983,6 +983,7 @@ namespace OpenSim.Framework void SendInstantMessage(GridInstantMessage im); + void SendGenericMessage(string method, List message); void SendGenericMessage(string method, List message); void SendLayerData(float[] map); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 9eb35fa..e67428d 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -816,6 +816,21 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } + public void SendGenericMessage(string method, List message) + { + GenericMessagePacket gmp = new GenericMessagePacket(); + gmp.MethodData.Method = Util.StringToBytes256(method); + gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; + int i = 0; + foreach (string val in message) + { + gmp.ParamList[i] = new GenericMessagePacket.ParamListBlock(); + gmp.ParamList[i++].Parameter = Util.StringToBytes256(val); + } + + OutPacket(gmp, ThrottleOutPacketType.Task); + } + public void SendGenericMessage(string method, List message) { GenericMessagePacket gmp = new GenericMessagePacket(); diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 967438f..2681d4f 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -461,6 +461,10 @@ namespace OpenSim.Region.Examples.SimpleModule } + public void SendGenericMessage(string method, List message) + { + } + public void SendGenericMessage(string method, List message) { diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 27de529..7453eae 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -965,6 +965,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server // TODO } + public void SendGenericMessage(string method, List message) + { + + } + public void SendGenericMessage(string method, List message) { diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index d2279c7..146b3d6 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -551,6 +551,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC } + public void SendGenericMessage(string method, List message) + { + + } + public void SendGenericMessage(string method, List message) { diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 6b0efe9..94d9d72 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -519,6 +519,11 @@ namespace OpenSim.Tests.Common.Mock } + public void SendGenericMessage(string method, List message) + { + + } + public void SendGenericMessage(string method, List message) { -- cgit v1.1 From e5bcd8b341c974afe3f1fbd06a537319bc7c4485 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 May 2010 23:29:37 +0100 Subject: Apply adaption of patch in http://opensimulator.org/mantis/view.php?id=4628 This prevents a ground-sitting avatar from being moved about in mouselook Thanks mirceakitsune! --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2ce1b68..ad7c3ae 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1312,8 +1312,7 @@ namespace OpenSim.Region.Framework.Scenes // Setting parent ID would fix this, if we knew what value // to use. Or we could add a m_isSitting variable. //Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); - SitGround = true; - + SitGround = true; } // In the future, these values might need to go global. @@ -1330,7 +1329,7 @@ namespace OpenSim.Region.Framework.Scenes bool update_movementflag = false; - if (m_allowMovement) + if (m_allowMovement && !SitGround) { if (agentData.UseClientAgentPosition) { -- cgit v1.1 From 074937e0e510e9be6b7a0e5639d93a93be38d6b1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 May 2010 23:34:47 +0100 Subject: Apply http://opensimulator.org/mantis/view.php?id=4627 Adds OwnerId and CreatorId properties to MRM.IObject --- .../OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | 10 ++++++++++ .../Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | 10 ++++++++++ 2 files changed, 20 insertions(+) (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 30580e7..29f7f68 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs @@ -98,6 +98,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule String Description { get; set; } /// + /// Returns the UUID of the Owner of the Object. + /// + UUID OwnerId { get; } + + /// + /// Returns the UUID of the Creator of the Object. + /// + UUID CreatorId { get; } + + /// /// Returns the root object of a linkset. If this object is the root, it will return itself. /// IObject Root { get; } diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 5bfe4be..f51498c 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -169,6 +169,16 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule } } + public UUID OwnerId + { + get { return GetSOP().OwnerID;} + } + + public UUID CreatorId + { + get { return GetSOP().CreatorID;} + } + public IObject[] Children { get -- cgit v1.1 From b2197e3b94f3865ba3927a4aaaf38cffe141cd72 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 May 2010 23:37:05 +0100 Subject: Apply http://opensimulator.org/mantis/view.php?id=4632 Adds dialog methods for MRM. Thanks ziah. --- .../Scripting/Minimodule/Interfaces/IObject.cs | 18 ++++++++- .../Scripting/Minimodule/SOPObject.cs | 44 +++++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 29f7f68..e189489 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs @@ -189,9 +189,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule /// /// The message to send to the user void Say(string msg); - + + /// + /// Causes the object to speak to on a specific channel, + /// equivilent to LSL/OSSL llSay + /// + /// The message to send to the user + /// The channel on which to send the message void Say(string msg,int channel); + /// + /// Opens a Dialog Panel in the Users Viewer, + /// equivilent to LSL/OSSL llDialog + /// + /// The UUID of the Avatar to which the Dialog should be send + /// The Message to display at the top of the Dialog + /// The Strings that act as label/value of the Bottons in the Dialog + /// The channel on which to send the response + void Dialog(UUID avatar, string message, string[] buttons, int chat_channel); + //// /// Grants access to the objects inventory /// diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index f51498c..96cccb7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs @@ -31,6 +31,7 @@ using System.Security; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; +using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; using OpenSim.Region.OptionalModules.Scripting.Minimodule.Object; using OpenSim.Region.Physics.Manager; @@ -402,7 +403,48 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule SceneObjectPart sop = GetSOP(); m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false); } - + + public void Dialog(UUID avatar, string message, string[] buttons, int chat_channel) + { + if (!CanEdit()) + return; + + IDialogModule dm = m_rootScene.RequestModuleInterface(); + + if (dm == null) + return; + + if (buttons.Length < 1) + { + Say("ERROR: No less than 1 button can be shown",2147483647); + return; + } + if (buttons.Length > 12) + { + Say("ERROR: No more than 12 buttons can be shown",2147483647); + return; + } + + foreach(string button in buttons) + { + if (button == String.Empty) + { + Say("ERROR: button label cannot be blank",2147483647); + return; + } + if (button.Length > 24) + { + Say("ERROR: button label cannot be longer than 24 characters",2147483647); + return; + } + } + + dm.SendDialogToUser( + avatar, GetSOP().Name, GetSOP().UUID, GetSOP().OwnerID, + message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buttons); + + } + #endregion -- cgit v1.1