formatting DialogModule for 80-character width terminal
parent
5cba04e2d6
commit
fb7bbe167a
|
@ -59,7 +59,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
if(scene != m_scene)
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.AddCommand(
|
||||
|
@ -68,20 +68,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
"Users", this, "alert-user", "alert-user <first> <last> <message>",
|
||||
"Users", this, "alert-user",
|
||||
"alert-user <first> <last> <message>",
|
||||
"Send an alert to a user",
|
||||
HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if(scene != m_scene)
|
||||
if (scene != m_scene)
|
||||
return;
|
||||
|
||||
m_scene.UnregisterModuleInterface<IDialogModule>(this);
|
||||
}
|
||||
|
||||
public void Close() {}
|
||||
public void Close() { }
|
||||
public string Name { get { return "Dialog Module"; } }
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message)
|
||||
|
@ -89,7 +90,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
SendAlertToUser(client, message, false);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(IClientAPI client, string message, bool modal)
|
||||
public void SendAlertToUser(IClientAPI client, string message,
|
||||
bool modal)
|
||||
{
|
||||
client.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
@ -107,11 +109,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
sp.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
}
|
||||
|
||||
public void SendAlertToUser(string firstName, string lastName, string message, bool modal)
|
||||
public void SendAlertToUser(string firstName, string lastName,
|
||||
string message, bool modal)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName, lastName);
|
||||
ScenePresence presence = m_scene.GetScenePresence(firstName,
|
||||
lastName);
|
||||
if (presence != null)
|
||||
presence.ControllingClient.SendAgentAlertMessage(message, modal);
|
||||
{
|
||||
presence.ControllingClient.SendAgentAlertMessage(message,
|
||||
modal);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendGeneralAlert(string message)
|
||||
|
@ -122,11 +129,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
});
|
||||
}
|
||||
|
||||
public void SendDialogToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
|
||||
string message, UUID textureID, int ch, string[] buttonlabels)
|
||||
public void SendDialogToUser(UUID avatarID, string objectName,
|
||||
UUID objectID, UUID ownerID, string message, UUID textureID,
|
||||
int ch, string[] buttonlabels)
|
||||
{
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerID);
|
||||
string ownerFirstName, ownerLastName;
|
||||
if (account != null)
|
||||
{
|
||||
|
@ -141,22 +149,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
|
||||
ScenePresence sp = m_scene.GetScenePresence(avatarID);
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendDialog(
|
||||
objectName, objectID, ownerID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
|
||||
{
|
||||
sp.ControllingClient.SendDialog(objectName, objectID, ownerID,
|
||||
ownerFirstName, ownerLastName, message, textureID, ch,
|
||||
buttonlabels);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendUrlToUser(
|
||||
UUID avatarID, string objectName, UUID objectID, UUID ownerID, bool groupOwned, string message, string url)
|
||||
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);
|
||||
{
|
||||
sp.ControllingClient.SendLoadURL(objectName, objectID,
|
||||
ownerID, groupOwned, message, url);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendTextBoxToUser(UUID avatarid, string message, int chatChannel, string name, UUID objectid, UUID ownerid)
|
||||
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);
|
||||
UserAccount account = m_scene.UserAccountService.GetUserAccount(
|
||||
m_scene.RegionInfo.ScopeID, ownerid);
|
||||
string ownerFirstName, ownerLastName;
|
||||
UUID ownerID = UUID.Zero;
|
||||
if (account != null)
|
||||
|
@ -174,15 +191,20 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
ScenePresence sp = m_scene.GetScenePresence(avatarid);
|
||||
|
||||
if (sp != null)
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerID, ownerFirstName, ownerLastName, objectid);
|
||||
{
|
||||
sp.ControllingClient.SendTextBoxRequest(message, chatChannel,
|
||||
name, ownerID, ownerFirstName, ownerLastName,
|
||||
objectid);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendNotificationToUsersInRegion(
|
||||
UUID fromAvatarID, string fromAvatarName, string message)
|
||||
public void SendNotificationToUsersInRegion(UUID fromAvatarID,
|
||||
string fromAvatarName, string message)
|
||||
{
|
||||
m_scene.ForEachRootClient(delegate(IClientAPI client)
|
||||
{
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
|
||||
client.SendBlueBoxMessage(fromAvatarID, fromAvatarName,
|
||||
message);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -191,10 +213,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
/// </summary>
|
||||
/// <param name="module"></param>
|
||||
/// <param name="cmdparams"></param>
|
||||
public void HandleAlertConsoleCommand(string module, string[] cmdparams)
|
||||
public void HandleAlertConsoleCommand(string module,
|
||||
string[] cmdparams)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null &&
|
||||
m_scene.ConsoleScene() != m_scene)
|
||||
{
|
||||
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
|
||||
return;
|
||||
}
|
||||
|
||||
string message = string.Empty;
|
||||
|
||||
|
@ -210,9 +236,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
|||
string firstName = cmdparams[1];
|
||||
string lastName = cmdparams[2];
|
||||
message = CombineParams(cmdparams, 3);
|
||||
m_log.InfoFormat(
|
||||
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName, message);
|
||||
m_log.InfoFormat("[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}",
|
||||
m_scene.RegionInfo.RegionName, firstName, lastName,
|
||||
message);
|
||||
SendAlertToUser(firstName, lastName, message, false);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue