diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index cf87a30b94..7b435f5bfe 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -1710,5 +1710,9 @@ namespace OpenSim.Client.MXP.ClientStack
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index 56f5f8f426..e2986d9a80 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -1199,6 +1199,10 @@ namespace OpenSim.Client.Sirikata.ClientStack
{
}
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
+
#endregion
}
}
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index b8f46dc647..c4f201666d 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -1214,5 +1214,9 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 82b596821c..0c268bf7f4 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -1479,5 +1479,6 @@ namespace OpenSim.Framework
void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt);
void SendChangeUserRights(UUID agentID, UUID friendID, int rights);
+ void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId);
}
}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 569dc8db25..2e5945745f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -11630,5 +11630,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(packet, ThrottleOutPacketType.Task);
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ ScriptDialogPacket dialog = (ScriptDialogPacket)PacketPool.Instance.GetPacket(PacketType.ScriptDialog);
+ dialog.Data.ObjectID = objectId;
+ dialog.Data.ChatChannel = chatChannel;
+ dialog.Data.ImageID = UUID.Zero;
+ dialog.Data.ObjectName = Util.StringToBytes256(objectname);
+ // this is the username of the *owner*
+ dialog.Data.FirstName = Util.StringToBytes256(ownerFirstName);
+ dialog.Data.LastName = Util.StringToBytes256(ownerLastName);
+ dialog.Data.Message = Util.StringToBytes256(message);
+
+
+ ScriptDialogPacket.ButtonsBlock[] buttons = new ScriptDialogPacket.ButtonsBlock[1];
+ buttons[0] = new ScriptDialogPacket.ButtonsBlock();
+ buttons[0].ButtonLabel = Util.StringToBytes256("!!llTextBox!!");
+ dialog.Buttons = buttons;
+ OutPacket(dialog, ThrottleOutPacketType.Task);
+ }
}
}
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
index fac052a7eb..b8e013c672 100644
--- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+using System;
using System.Collections.Generic;
using System.Reflection;
using log4net;
@@ -151,7 +152,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
// region as the sending avatar.
SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message);
}
-
+
+ public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
+ {
+ UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
+ string ownerFirstName, ownerLastName;
+ if (account != null)
+ {
+ ownerFirstName = account.FirstName;
+ ownerLastName = account.LastName;
+ }
+ else
+ {
+ ownerFirstName = "(unknown";
+ ownerLastName = "user)";
+ }
+
+
+ ScenePresence sp = m_scene.GetScenePresence(avatarid);
+
+ if (sp != null) {
+ sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
+ }
+ }
+
public void SendNotificationToUsersInRegion(
UUID fromAvatarID, string fromAvatarName, string message)
{
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index a1957d141b..7fdddc3189 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -1153,5 +1153,9 @@ namespace OpenSim.Region.Examples.SimpleModule
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}
diff --git a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
index ce57c44202..35b4b63152 100644
--- a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
@@ -131,5 +131,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// The name of the user doing the sending
/// The message being sent to the user
void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message);
+
+ ///
+ /// Send a textbox entry for the client to respond to
+ ///
+ void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid);
}
}
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 96530a1f01..f2253f291c 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -1679,5 +1679,9 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index f8ab8d8bc1..65445d9686 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -1159,5 +1159,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0a871d9519..6f683052ec 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4009,10 +4009,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScriptSleep(5000);
}
- public void llTextBox(string avatar, string message, int chat_channel)
+ public void llTextBox(string agent, string message, int chatChannel)
{
+ IDialogModule dm = World.RequestModuleInterface();
+
+ if (dm == null)
+ return;
+
m_host.AddScriptLPS(1);
- NotImplemented("llTextBox");
+ UUID av = new UUID();
+ if (!UUID.TryParse(agent,out av))
+ {
+ LSLError("First parameter to llDialog needs to be a key");
+ return;
+ }
+
+ if( message == string.Empty)
+ {
+ ShoutError("Trying to use llTextBox with empty message.");
+ }
+ else if (message.Length > 512)
+ {
+ ShoutError("Trying to use llTextBox with message over 512 characters.");
+ }
+ else
+ {
+ dm.SendTextBoxToUser(av, message, chatChannel, m_host.Name, m_host.UUID, m_host.OwnerID);
+ ScriptSleep(1000);
+ }
}
public void llModifyLand(int action, int brush)
@@ -4027,6 +4051,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llCollisionSound(string impact_sound, double impact_volume)
{
+
m_host.AddScriptLPS(1);
// TODO: Parameter check logic required.
UUID soundId = UUID.Zero;
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 6403c1bfe3..7b46e957a7 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -1213,5 +1213,9 @@ namespace OpenSim.Tests.Common.Mock
public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
{
}
+
+ public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
+ {
+ }
}
}