* refactor: move code to send a dialog to a user from scene to DialogModule

0.6.2-post-fixes
Justin Clarke Casey 2009-01-08 19:14:52 +00:00
parent 9a97a6866f
commit e7bb27b5bd
4 changed files with 35 additions and 13 deletions

View File

@ -79,6 +79,21 @@ namespace OpenSim.Region.Environment.Interfaces
/// <param name="message"></param>
void SendGeneralAlert(string message);
/// <summary>
/// Send a dialog box to a particular user.
/// </summary>
/// <param name="avatarID"></param>
/// <param name="objectName"></param>
/// <param name="objectID"></param>
/// <param name="ownerID"></param>
/// <param name="message"></param>
/// <param name="textureID"></param>
/// <param name="ch"></param>
/// <param name="buttonlabels"></param>
void SendDialogToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
string message, UUID textureID, int ch, string[] buttonlabels);
/// <summary>
/// Send a notification to all users in the scene. This notification should remain around until the
/// user explicitly dismisses it.

View File

@ -101,6 +101,16 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
}
}
public void SendDialogToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
string message, UUID textureID, int ch, string[] buttonlabels)
{
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendDialog(objectName, objectID, ownerID, message, textureID, ch, buttonlabels);
}
public void SendNotificationToUsersInEstate(
UUID fromAvatarID, string fromAvatarName, string message)
{

View File

@ -3377,18 +3377,6 @@ namespace OpenSim.Region.Environment.Scenes
}
}
public void SendDialogToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, string message, UUID TextureID, int ch, string[] buttonlabels)
{
lock (m_scenePresences)
{
if (m_scenePresences.ContainsKey(avatarID))
{
m_scenePresences[avatarID].ControllingClient.SendDialog(
objectName, objectID, ownerID, message, TextureID, ch, buttonlabels);
}
}
}
public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms)
{
m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms);

View File

@ -5722,6 +5722,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llDialog(string avatar, string message, LSL_List buttons, int chat_channel)
{
IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
if (dm == null)
return;
m_host.AddScriptLPS(1);
UUID av = new UUID();
if (!UUID.TryParse(avatar,out av))
@ -5749,7 +5754,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
buts[i] = buttons.Data[i].ToString();
}
World.SendDialogToUser(av, m_host.Name, m_host.UUID, m_host.OwnerID, message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
dm.SendDialogToUser(
av, m_host.Name, m_host.UUID, m_host.OwnerID,
message, new UUID("00000000-0000-2222-3333-100000001000"), chat_channel, buts);
// ScriptSleep(1000);
}