* refactor: move url sending from scene to DialogModule

0.6.2-post-fixes
Justin Clarke Casey 2009-01-08 19:28:10 +00:00
parent be41132c72
commit af49acd6cc
4 changed files with 29 additions and 27 deletions

View File

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

View File

@ -111,6 +111,15 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Dialog
sp.ControllingClient.SendDialog(objectName, objectID, ownerID, message, textureID, ch, buttonlabels); sp.ControllingClient.SendDialog(objectName, objectID, ownerID, message, textureID, ch, buttonlabels);
} }
public void SendUrlToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
{
ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
}
public void SendNotificationToUsersInEstate( public void SendNotificationToUsersInEstate(
UUID fromAvatarID, string fromAvatarName, string message) UUID fromAvatarID, string fromAvatarName, string message)
{ {

View File

@ -3354,29 +3354,6 @@ namespace OpenSim.Region.Environment.Scenes
m_timePhase = phase; m_timePhase = phase;
} }
/// <summary>
///
/// </summary>
/// <param name="avatarID"></param>
/// <param name="objectName"></param>
/// <param name="objectID"></param>
/// <param name="ownerID"></param>
/// <param name="groupOwned"></param>
/// <param name="message"></param>
/// <param name="url"></param>
public void SendUrlToUser(UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned,
string message, string url)
{
lock (m_scenePresences)
{
if (m_scenePresences.ContainsKey(avatarID))
{
m_scenePresences[avatarID].ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned,
message, url);
}
}
}
public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms) public virtual void StoreAddFriendship(UUID ownerID, UUID friendID, uint perms)
{ {
m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms); m_sceneGridService.AddNewUserFriend(ownerID, friendID, perms);

View File

@ -7799,9 +7799,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void llLoadURL(string avatar_id, string message, string url) public void llLoadURL(string avatar_id, string message, string url)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
UUID avatarId = new UUID(avatar_id);
m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, IDialogModule dm = World.RequestModuleInterface<IDialogModule>();
url); if (null != dm)
dm.SendUrlToUser(
new UUID(avatar_id), m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, url);
// ScriptSleep(10000); // ScriptSleep(10000);
} }