aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs20
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs26
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs4
-rw-r--r--OpenSim/Region/Framework/Interfaces/IDialogModule.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs29
7 files changed, 89 insertions, 3 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 569dc8d..2e59457 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -11630,5 +11630,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11630 11630
11631 OutPacket(packet, ThrottleOutPacketType.Task); 11631 OutPacket(packet, ThrottleOutPacketType.Task);
11632 } 11632 }
11633
11634 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
11635 {
11636 ScriptDialogPacket dialog = (ScriptDialogPacket)PacketPool.Instance.GetPacket(PacketType.ScriptDialog);
11637 dialog.Data.ObjectID = objectId;
11638 dialog.Data.ChatChannel = chatChannel;
11639 dialog.Data.ImageID = UUID.Zero;
11640 dialog.Data.ObjectName = Util.StringToBytes256(objectname);
11641 // this is the username of the *owner*
11642 dialog.Data.FirstName = Util.StringToBytes256(ownerFirstName);
11643 dialog.Data.LastName = Util.StringToBytes256(ownerLastName);
11644 dialog.Data.Message = Util.StringToBytes256(message);
11645
11646
11647 ScriptDialogPacket.ButtonsBlock[] buttons = new ScriptDialogPacket.ButtonsBlock[1];
11648 buttons[0] = new ScriptDialogPacket.ButtonsBlock();
11649 buttons[0].ButtonLabel = Util.StringToBytes256("!!llTextBox!!");
11650 dialog.Buttons = buttons;
11651 OutPacket(dialog, ThrottleOutPacketType.Task);
11652 }
11633 } 11653 }
11634} 11654}
diff --git a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
index fac052a..b8e013c 100644
--- a/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Dialog/DialogModule.cs
@@ -25,6 +25,7 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System;
28using System.Collections.Generic; 29using System.Collections.Generic;
29using System.Reflection; 30using System.Reflection;
30using log4net; 31using log4net;
@@ -151,7 +152,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
151 // region as the sending avatar. 152 // region as the sending avatar.
152 SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message); 153 SendNotificationToUsersInRegion(fromAvatarID, fromAvatarName, message);
153 } 154 }
154 155
156 public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
157 {
158 UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid);
159 string ownerFirstName, ownerLastName;
160 if (account != null)
161 {
162 ownerFirstName = account.FirstName;
163 ownerLastName = account.LastName;
164 }
165 else
166 {
167 ownerFirstName = "(unknown";
168 ownerLastName = "user)";
169 }
170
171
172 ScenePresence sp = m_scene.GetScenePresence(avatarid);
173
174 if (sp != null) {
175 sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
176 }
177 }
178
155 public void SendNotificationToUsersInRegion( 179 public void SendNotificationToUsersInRegion(
156 UUID fromAvatarID, string fromAvatarName, string message) 180 UUID fromAvatarID, string fromAvatarName, string message)
157 { 181 {
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index a1957d1..7fdddc3 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -1153,5 +1153,9 @@ namespace OpenSim.Region.Examples.SimpleModule
1153 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) 1153 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
1154 { 1154 {
1155 } 1155 }
1156
1157 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1158 {
1159 }
1156 } 1160 }
1157} 1161}
diff --git a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
index ce57c44..35b4b63 100644
--- a/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IDialogModule.cs
@@ -131,5 +131,10 @@ namespace OpenSim.Region.Framework.Interfaces
131 /// <param name="fromAvatarName">The name of the user doing the sending</param> 131 /// <param name="fromAvatarName">The name of the user doing the sending</param>
132 /// <param name="message">The message being sent to the user</param> 132 /// <param name="message">The message being sent to the user</param>
133 void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message); 133 void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message);
134
135 /// <summary>
136 /// Send a textbox entry for the client to respond to
137 /// </summary>
138 void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid);
134 } 139 }
135} 140}
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 96530a1..f2253f2 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
1679 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) 1679 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
1680 { 1680 {
1681 } 1681 }
1682
1683 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1684 {
1685 }
1682 } 1686 }
1683} 1687}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index f8ab8d8..65445d9 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
1159 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) 1159 public void SendChangeUserRights(UUID agentID, UUID friendID, int rights)
1160 { 1160 {
1161 } 1161 }
1162
1163 public void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId)
1164 {
1165 }
1162 } 1166 }
1163} 1167}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0a871d9..6f68305 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
4009 ScriptSleep(5000); 4009 ScriptSleep(5000);
4010 } 4010 }
4011 4011
4012 public void llTextBox(string avatar, string message, int chat_channel) 4012 public void llTextBox(string agent, string message, int chatChannel)
4013 { 4013 {
4014 IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
4015
4016 if (dm == null)
4017 return;
4018
4014 m_host.AddScriptLPS(1); 4019 m_host.AddScriptLPS(1);
4015 NotImplemented("llTextBox"); 4020 UUID av = new UUID();
4021 if (!UUID.TryParse(agent,out av))
4022 {
4023 LSLError("First parameter to llDialog needs to be a key");
4024 return;
4025 }
4026
4027 if( message == string.Empty)
4028 {
4029 ShoutError("Trying to use llTextBox with empty message.");
4030 }
4031 else if (message.Length > 512)
4032 {
4033 ShoutError("Trying to use llTextBox with message over 512 characters.");
4034 }
4035 else
4036 {
4037 dm.SendTextBoxToUser(av, message, chatChannel, m_host.Name, m_host.UUID, m_host.OwnerID);
4038 ScriptSleep(1000);
4039 }
4016 } 4040 }
4017 4041
4018 public void llModifyLand(int action, int brush) 4042 public void llModifyLand(int action, int brush)
@@ -4027,6 +4051,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4027 4051
4028 public void llCollisionSound(string impact_sound, double impact_volume) 4052 public void llCollisionSound(string impact_sound, double impact_volume)
4029 { 4053 {
4054
4030 m_host.AddScriptLPS(1); 4055 m_host.AddScriptLPS(1);
4031 // TODO: Parameter check logic required. 4056 // TODO: Parameter check logic required.
4032 UUID soundId = UUID.Zero; 4057 UUID soundId = UUID.Zero;