- supporting llTextBox

Signed-off-by: Melanie <melanie@t-data.com>
slimupdates
unknown 2010-03-06 14:13:12 -06:00 committed by Melanie
parent 9fa9cfd215
commit 2dcf73dd93
12 changed files with 106 additions and 3 deletions

View File

@ -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)
{
}
}
}

View File

@ -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
}
}

View File

@ -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)
{
}
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}
}

View File

@ -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;
@ -152,6 +153,29 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
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)
{

View File

@ -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)
{
}
}
}

View File

@ -131,5 +131,10 @@ namespace OpenSim.Region.Framework.Interfaces
/// <param name="fromAvatarName">The name of the user doing the sending</param>
/// <param name="message">The message being sent to the user</param>
void SendNotificationToUsersInEstate(UUID fromAvatarID, string fromAvatarName, string message);
/// <summary>
/// Send a textbox entry for the client to respond to
/// </summary>
void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid);
}
}

View File

@ -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)
{
}
}
}

View File

@ -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)
{
}
}
}

View File

@ -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<IDialogModule>();
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;

View File

@ -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)
{
}
}
}