Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-08-21 00:32:26 +01:00
commit f8ff98577e
24 changed files with 675 additions and 550 deletions

View File

@ -142,7 +142,7 @@ namespace OpenSim.Framework.Capabilities
m_httpListenPort = httpPort; m_httpListenPort = httpPort;
if (httpServer.UseSSL) if (httpServer != null && httpServer.UseSSL)
{ {
m_httpListenPort = httpServer.SSLPort; m_httpListenPort = httpServer.SSLPort;
httpListen = httpServer.SSLCommonName; httpListen = httpServer.SSLCommonName;
@ -151,7 +151,7 @@ namespace OpenSim.Framework.Capabilities
m_agentID = agent; m_agentID = agent;
m_dumpAssetsToFile = dumpAssetsToFile; m_dumpAssetsToFile = dumpAssetsToFile;
m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, httpServer.UseSSL); m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort, (httpServer == null) ? false : httpServer.UseSSL);
m_regionName = regionName; m_regionName = regionName;
} }

View File

@ -74,7 +74,7 @@ namespace OpenSim.Framework.Capabilities
m_httpListenerHostName = httpListenerHostname; m_httpListenerHostName = httpListenerHostname;
m_httpListenerPort = httpListenerPort; m_httpListenerPort = httpListenerPort;
m_useSSL = https; m_useSSL = https;
if (m_useSSL) if (httpListener != null && m_useSSL)
{ {
m_httpListenerHostName = httpListener.SSLCommonName; m_httpListenerHostName = httpListener.SSLCommonName;
m_httpListenerPort = httpListener.SSLPort; m_httpListenerPort = httpListener.SSLPort;

View File

@ -83,7 +83,9 @@ namespace OpenSim.Framework
/// <summary>Finished, Sim Changed</summary> /// <summary>Finished, Sim Changed</summary>
FinishedViaNewSim = 1 << 28, FinishedViaNewSim = 1 << 28,
/// <summary>Finished, Same Sim</summary> /// <summary>Finished, Same Sim</summary>
FinishedViaSameSim = 1 << 29 FinishedViaSameSim = 1 << 29,
/// <summary>Agent coming into the grid from another grid</summary>
ViaHGLogin = 1 << 30
} }
} }

View File

@ -181,16 +181,8 @@ namespace OpenSim.Framework
throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client");
} }
static IPAddress externalIPAddress;
static NetworkUtil() static NetworkUtil()
{ {
try
{
externalIPAddress = GetExternalIP();
}
catch { /* ignore */ }
try try
{ {
foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces()) foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces())
@ -254,79 +246,5 @@ namespace OpenSim.Framework
return defaultHostname; return defaultHostname;
} }
public static IPAddress GetExternalIPOf(IPAddress user)
{
if (externalIPAddress == null)
return user;
if (user.ToString() == "127.0.0.1")
{
m_log.Info("[NetworkUtil] 127.0.0.1 user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
// Check if we're accessing localhost.
foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName()))
{
if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork)
{
m_log.Info("[NetworkUtil] Localhost user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
}
// Check for same LAN segment
foreach (KeyValuePair<IPAddress, IPAddress> subnet in m_subnets)
{
byte[] subnetBytes = subnet.Value.GetAddressBytes();
byte[] localBytes = subnet.Key.GetAddressBytes();
byte[] destBytes = user.GetAddressBytes();
if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length)
return user;
bool valid = true;
for (int i = 0; i < subnetBytes.Length; i++)
{
if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i]))
{
valid = false;
break;
}
}
if (subnet.Key.AddressFamily != AddressFamily.InterNetwork)
valid = false;
if (valid)
{
m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'");
return externalIPAddress;
}
}
// Otherwise, return user address
return user;
}
private static IPAddress GetExternalIP()
{
string whatIsMyIp = "http://www.whatismyip.com/automation/n09230945.asp";
WebClient wc = new WebClient();
UTF8Encoding utf8 = new UTF8Encoding();
string requestHtml = "";
try
{
requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp));
}
catch (WebException we)
{
m_log.Info("[NetworkUtil]: Exception in GetExternalIP: " + we.ToString());
return null;
}
IPAddress externalIp = IPAddress.Parse(requestHtml);
return externalIp;
}
} }
} }

View File

@ -394,7 +394,7 @@ namespace OpenSim.Framework
if (!File.Exists(filename)) // New region config request if (!File.Exists(filename)) // New region config request
{ {
IniConfigSource newFile = new IniConfigSource(); IniConfigSource newFile = new IniConfigSource();
ReadNiniConfig(newFile, String.Empty); ReadNiniConfig(newFile, configName);
newFile.Save(filename); newFile.Save(filename);

View File

@ -308,8 +308,13 @@ namespace OpenSim
"Persist objects to the database now", RunCommand); "Persist objects to the database now", RunCommand);
m_console.Commands.AddCommand("region", false, "create region", m_console.Commands.AddCommand("region", false, "create region",
"create region", "create region [\"region name\"] <region_file.ini>",
"Create a new region", HandleCreateRegion); "Create a new region.",
"The settings for \"region name\" are read from <region_file.ini>."
+ " If \"region name\" does not exist in <region_file.ini>, it will be added." + Environment.NewLine
+ "Without \"region name\", the first region found in <region_file.ini> will be created." + Environment.NewLine
+ "If <region_file.ini> does not exist, it will be created.",
HandleCreateRegion);
m_console.Commands.AddCommand("region", false, "restart", m_console.Commands.AddCommand("region", false, "restart",
"restart", "restart",
@ -513,47 +518,47 @@ namespace OpenSim
/// Creates a new region based on the parameters specified. This will ask the user questions on the console /// Creates a new region based on the parameters specified. This will ask the user questions on the console
/// </summary> /// </summary>
/// <param name="module"></param> /// <param name="module"></param>
/// <param name="cmd">0,1,region name, region XML file</param> /// <param name="cmd">0,1,region name, region ini or XML file</param>
private void HandleCreateRegion(string module, string[] cmd) private void HandleCreateRegion(string module, string[] cmd)
{ {
if (cmd.Length < 4) string regionName = string.Empty;
string regionFile = string.Empty;
if (cmd.Length == 3)
{ {
MainConsole.Instance.Output("Usage: create region <region name> <region_file.ini>"); regionFile = cmd[2];
}
else if (cmd.Length > 3)
{
regionName = cmd[2];
regionFile = cmd[3];
}
string extension = Path.GetExtension(regionFile).ToLower();
bool isXml = extension.Equals(".xml");
bool isIni = extension.Equals(".ini");
if (!isXml && !isIni)
{
MainConsole.Instance.Output("Usage: create region [\"region name\"] <region_file.ini>");
return; return;
} }
if (cmd[3].EndsWith(".xml")) if (!Path.IsPathRooted(regionFile))
{ {
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim(); string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]); regionFile = Path.Combine(regionsDir, regionFile);
// Allow absolute and relative specifiers
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
regionFile = cmd[3];
IScene scene;
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source);
PopulateRegionEstateInfo(regInfo);
CreateRegion(regInfo, true, out scene);
regInfo.EstateSettings.Save();
} }
else if (cmd[3].EndsWith(".ini"))
{
string regionsDir = ConfigSource.Source.Configs["Startup"].GetString("regionload_regionsdir", "Regions").Trim();
string regionFile = String.Format("{0}/{1}", regionsDir, cmd[3]);
// Allow absolute and relative specifiers
if (cmd[3].StartsWith("/") || cmd[3].StartsWith("\\") || cmd[3].StartsWith(".."))
regionFile = cmd[3];
IScene scene; RegionInfo regInfo;
RegionInfo regInfo = new RegionInfo(cmd[2], regionFile, false, ConfigSource.Source, cmd[2]); if (isXml)
PopulateRegionEstateInfo(regInfo); {
CreateRegion(regInfo, true, out scene); regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source);
regInfo.EstateSettings.Save();
} }
else else
{ {
MainConsole.Instance.Output("Usage: create region <region name> <region_file.ini>"); regInfo = new RegionInfo(regionName, regionFile, false, ConfigSource.Source, regionName);
return;
} }
IScene scene;
PopulateRegionEstateInfo(regInfo);
CreateRegion(regInfo, true, out scene);
regInfo.EstateSettings.Save();
} }
/// <summary> /// <summary>

View File

@ -109,9 +109,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
Caps caps Caps caps
= new Caps(m_scene, = new Caps(m_scene,
m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName, m_scene.AssetService, MainServer.Instance, m_scene.RegionInfo.ExternalHostName,
MainServer.Instance.Port, (MainServer.Instance == null) ? 0: MainServer.Instance.Port,
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName); capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
caps.RegisterHandlers(); caps.RegisterHandlers();
m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps); m_scene.EventManager.TriggerOnRegisterCaps(agentId, caps);
@ -121,7 +121,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset; caps.TaskScriptUpdatedCall = m_scene.CapsUpdateTaskInventoryScriptAsset;
caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS; caps.CAPSFetchInventoryDescendents = m_scene.HandleFetchInventoryDescendentsCAPS;
caps.GetClient = m_scene.SceneContents.GetControllingClient; caps.GetClient = m_scene.SceneContents.GetControllingClient;
m_capsHandlers[agentId] = caps; m_capsHandlers[agentId] = caps;
} }

View File

@ -1,223 +1,242 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer. * notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright * * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the * notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution. * documentation and/or other materials provided with the distribution.
* * Neither the name of the OpenSimulator Project nor the * * Neither the name of the OpenSimulator Project nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
using log4net; using log4net;
using Nini.Config; using Nini.Config;
using OpenMetaverse; using OpenMetaverse;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Scenes;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
namespace OpenSim.Region.CoreModules.Avatar.Dialog namespace OpenSim.Region.CoreModules.Avatar.Dialog
{ {
public class DialogModule : IRegionModule, IDialogModule public class DialogModule : IRegionModule, IDialogModule
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Scene m_scene; protected Scene m_scene;
public void Initialise(Scene scene, IConfigSource source) public void Initialise(Scene scene, IConfigSource source)
{ {
m_scene = scene; m_scene = scene;
m_scene.RegisterModuleInterface<IDialogModule>(this); m_scene.RegisterModuleInterface<IDialogModule>(this);
m_scene.AddCommand( m_scene.AddCommand(
this, "alert", "alert <first> <last> <message>", "Send an alert to a user", HandleAlertConsoleCommand); this, "alert", "alert <first> <last> <message>",
"Send an alert to a user",
m_scene.AddCommand( HandleAlertConsoleCommand);
this, "alert general", "alert general <message>", "Send an alert to everyone", HandleAlertConsoleCommand);
m_scene.AddCommand(
m_scene.AddCommand( this, "alert general", "alert [general] <message>",
this, "alert dialog", "alert dialog <message>", "Send a dialog alert to everyone", HandleAlertConsoleCommand); "Send an alert to everyone",
"If keyword 'general' is omitted, then <message> must be surrounded by quotation marks.",
HandleAlertConsoleCommand);
} }
public void PostInitialise() {} public void PostInitialise() {}
public void Close() {} public void Close() {}
public string Name { get { return "Dialog Module"; } } public string Name { get { return "Dialog Module"; } }
public bool IsSharedModule { get { return false; } } public bool IsSharedModule { get { return false; } }
public void SendAlertToUser(IClientAPI client, string message) public void SendAlertToUser(IClientAPI client, string message)
{ {
SendAlertToUser(client, message, false); 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); client.SendAgentAlertMessage(message, modal);
} }
public void SendAlertToUser(UUID agentID, string message) public void SendAlertToUser(UUID agentID, string message)
{ {
SendAlertToUser(agentID, message, false); SendAlertToUser(agentID, message, false);
} }
public void SendAlertToUser(UUID agentID, string message, bool modal) public void SendAlertToUser(UUID agentID, string message, bool modal)
{ {
ScenePresence sp = m_scene.GetScenePresence(agentID); ScenePresence sp = m_scene.GetScenePresence(agentID);
if (sp != null) if (sp != null)
sp.ControllingClient.SendAgentAlertMessage(message, modal); 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) if (presence != null)
presence.ControllingClient.SendAgentAlertMessage(message, modal); presence.ControllingClient.SendAgentAlertMessage(message, modal);
} }
public void SendGeneralAlert(string message) public void SendGeneralAlert(string message)
{ {
m_scene.ForEachScenePresence(delegate(ScenePresence presence) m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{ {
if (!presence.IsChildAgent) if (!presence.IsChildAgent)
{ presence.ControllingClient.SendAlertMessage(message);
presence.ControllingClient.SendAlertMessage(message); });
} }
});
} public void SendDialogToUser(
UUID avatarID, string objectName, UUID objectID, UUID ownerID,
public void SendDialogToUser( string message, UUID textureID, int ch, string[] buttonlabels)
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);
{ string ownerFirstName, ownerLastName;
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerID); if (account != null)
string ownerFirstName, ownerLastName; {
if (account != null) ownerFirstName = account.FirstName;
{ ownerLastName = account.LastName;
ownerFirstName = account.FirstName; }
ownerLastName = account.LastName; else
} {
else ownerFirstName = "(unknown";
{ ownerLastName = "user)";
ownerFirstName = "(unknown"; }
ownerLastName = "user)";
} ScenePresence sp = m_scene.GetScenePresence(avatarID);
if (sp != null)
ScenePresence sp = m_scene.GetScenePresence(avatarID); sp.ControllingClient.SendDialog(objectName, objectID, ownerFirstName, ownerLastName, message, textureID, ch, buttonlabels);
if (sp != null) }
sp.ControllingClient.SendDialog(objectName, objectID, 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);
{
ScenePresence sp = m_scene.GetScenePresence(avatarID); if (sp != null)
sp.ControllingClient.SendLoadURL(objectName, objectID, ownerID, groupOwned, message, url);
if (sp != null) }
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);
{ string ownerFirstName, ownerLastName;
UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, ownerid); if (account != null)
string ownerFirstName, ownerLastName; {
if (account != null) ownerFirstName = account.FirstName;
{ ownerLastName = account.LastName;
ownerFirstName = account.FirstName; }
ownerLastName = account.LastName; else
} {
else ownerFirstName = "(unknown";
{ ownerLastName = "user)";
ownerFirstName = "(unknown"; }
ownerLastName = "user)";
} ScenePresence sp = m_scene.GetScenePresence(avatarid);
ScenePresence sp = m_scene.GetScenePresence(avatarid); if (sp != null)
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
if (sp != null) }
sp.ControllingClient.SendTextBoxRequest(message, chatChannel, name, ownerFirstName, ownerLastName, objectid);
} public void SendNotificationToUsersInRegion(
UUID fromAvatarID, string fromAvatarName, string message)
public void SendNotificationToUsersInRegion( {
UUID fromAvatarID, string fromAvatarName, string message) m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{ {
m_scene.ForEachScenePresence(delegate(ScenePresence presence) if (!presence.IsChildAgent)
{ presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message);
if (!presence.IsChildAgent) });
presence.ControllingClient.SendBlueBoxMessage(fromAvatarID, fromAvatarName, message); }
});
} /// <summary>
/// Handle an alert command from the console.
/// <summary> /// </summary>
/// Handle an alert command from the console. /// <param name="module"></param>
/// </summary> /// <param name="cmdparams"></param>
/// <param name="module"></param> public void HandleAlertConsoleCommand(string module, string[] cmdparams)
/// <param name="cmdparams"></param> {
public void HandleAlertConsoleCommand(string module, string[] cmdparams) if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
{ return;
if (m_scene.ConsoleScene() != null && m_scene.ConsoleScene() != m_scene)
return; bool isGeneral = false;
string firstName = string.Empty;
if (cmdparams[1] == "general") string lastName = string.Empty;
{ string message = string.Empty;
string message = CombineParams(cmdparams, 2);
if (cmdparams.Length > 1)
m_log.InfoFormat( {
"[DIALOG]: Sending general alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); firstName = cmdparams[1];
SendGeneralAlert(message); isGeneral = firstName.ToLower().Equals("general");
} }
else if (cmdparams[1] == "dialog") if (cmdparams.Length == 2 && !isGeneral)
{ {
string message = CombineParams(cmdparams, 2); // alert "message"
message = cmdparams[1];
m_log.InfoFormat( isGeneral = true;
"[DIALOG]: Sending dialog alert in region {0} with message {1}", m_scene.RegionInfo.RegionName, message); }
SendNotificationToUsersInRegion(UUID.Zero, "System", message); else if (cmdparams.Length > 2 && isGeneral)
} {
else // alert general <message>
{ message = CombineParams(cmdparams, 2);
string firstName = cmdparams[1]; }
string lastName = cmdparams[2]; else if (cmdparams.Length > 3)
string message = CombineParams(cmdparams, 3); {
// alert <first> <last> <message>
m_log.InfoFormat( lastName = cmdparams[2];
"[DIALOG]: Sending alert in region {0} to {1} {2} with message {3}", message = CombineParams(cmdparams, 3);
m_scene.RegionInfo.RegionName, firstName, lastName, message); }
SendAlertToUser(firstName, lastName, message, false); else
} {
} OpenSim.Framework.Console.MainConsole.Instance.Output(
"Usage: alert \"message\" | alert general <message> | alert <first> <last> <message>");
private string CombineParams(string[] commandParams, int pos) return;
{ }
string result = string.Empty;
for (int i = pos; i < commandParams.Length; i++) if (isGeneral)
{ {
result += commandParams[i] + " "; m_log.InfoFormat(
} "[DIALOG]: Sending general alert in region {0} with message {1}",
m_scene.RegionInfo.RegionName, message);
return result; SendGeneralAlert(message);
} }
} else
} {
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);
}
}
private string CombineParams(string[] commandParams, int pos)
{
string result = string.Empty;
for (int i = pos; i < commandParams.Length; i++)
{
result += commandParams[i] + " ";
}
return result;
}
}
}

View File

@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
bool enabled = false; bool enabled = false;
IConfig cfg = null; IConfig cfg = null;
IConfig httpcfg = null; IConfig httpcfg = null;
IConfig startupcfg = null; // IConfig startupcfg = null;
try try
{ {
cfg = config.Configs["OpenGridProtocol"]; cfg = config.Configs["OpenGridProtocol"];
@ -117,14 +117,14 @@ namespace OpenSim.Region.CoreModules.InterGrid
{ {
} }
try // try
{ // {
startupcfg = config.Configs["Startup"]; // startupcfg = config.Configs["Startup"];
} // }
catch (NullReferenceException) // catch (NullReferenceException)
{ // {
//
} // }
// if (startupcfg != null) // if (startupcfg != null)
// { // {

View File

@ -2584,18 +2584,25 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="client"></param> /// <param name="client"></param>
public override void AddNewClient(IClientAPI client) public override void AddNewClient(IClientAPI client)
{ {
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
bool vialogin = false; bool vialogin = false;
m_clientManager.Add(client); if (aCircuit == null) // no good, didn't pass NewUserConnection successfully
return;
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
CheckHeartbeat(); CheckHeartbeat();
SubscribeToClientEvents(client);
ScenePresence presence; ScenePresence presence;
if (m_restorePresences.ContainsKey(client.AgentId)) if (m_restorePresences.ContainsKey(client.AgentId))
{ {
m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName); m_log.DebugFormat("[SCENE]: Restoring agent {0} {1} in {2}", client.Name, client.AgentId, RegionInfo.RegionName);
m_clientManager.Add(client);
SubscribeToClientEvents(client);
presence = m_restorePresences[client.AgentId]; presence = m_restorePresences[client.AgentId];
m_restorePresences.Remove(client.AgentId); m_restorePresences.Remove(client.AgentId);
@ -2618,49 +2625,35 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode); if (GetScenePresence(client.AgentId) == null) // ensure there is no SP here
// Do the verification here
System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP();
if (aCircuit != null)
{ {
if (!VerifyClient(aCircuit, ep, out vialogin)) m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
m_clientManager.Add(client);
SubscribeToClientEvents(client);
ScenePresence sp = CreateAndAddScenePresence(client);
if (aCircuit != null)
sp.Appearance = aCircuit.Appearance;
// HERE!!! Do the initial attachments right here
// first agent upon login is a root agent by design.
// All other AddNewClient calls find aCircuit.child to be true
if (aCircuit == null || (aCircuit != null && aCircuit.child == false))
{ {
// uh-oh, this is fishy sp.IsChildAgent = false;
m_log.WarnFormat("[SCENE]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.", Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
client.AgentId, client.SessionId, ep.ToString());
try
{
client.Close();
}
catch (Exception e)
{
m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace);
}
return;
} }
} }
m_log.Debug("[SCENE]: Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
ScenePresence sp = CreateAndAddScenePresence(client);
if (aCircuit != null)
sp.Appearance = aCircuit.Appearance;
// HERE!!! Do the initial attachments right here
// first agent upon login is a root agent by design.
// All other AddNewClient calls find aCircuit.child to be true
if (aCircuit == null || (aCircuit != null && aCircuit.child == false))
{
sp.IsChildAgent = false;
Util.FireAndForget(delegate(object o) { sp.RezAttachments(); });
}
} }
m_LastLogin = Util.EnvironmentTickCount(); if (GetScenePresence(client.AgentId) != null)
EventManager.TriggerOnNewClient(client); {
if (vialogin) m_LastLogin = Util.EnvironmentTickCount();
EventManager.TriggerOnClientLogin(client); EventManager.TriggerOnNewClient(client);
if (vialogin)
EventManager.TriggerOnClientLogin(client);
}
} }
private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin) private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin)
@ -2668,16 +2661,14 @@ namespace OpenSim.Region.Framework.Scenes
vialogin = false; vialogin = false;
// Do the verification here // Do the verification here
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0) if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0)
{ {
m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via HG login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
vialogin = true; vialogin = true;
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
if (userVerification != null && ep != null) if (userVerification != null && ep != null)
{ {
System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address); if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString()))
{ {
// uh-oh, this is fishy // uh-oh, this is fishy
m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); m_log.DebugFormat("[SCENE]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
@ -2688,6 +2679,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
{
m_log.DebugFormat("[SCENE]: Incoming client {0} {1} in region {2} via regular login. Client IP verification not performed.",
aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
vialogin = true;
}
return true; return true;
} }
@ -3343,7 +3341,8 @@ namespace OpenSim.Region.Framework.Scenes
/// also return a reason.</returns> /// also return a reason.</returns>
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
{ {
TeleportFlags tp = (TeleportFlags)teleportFlags; bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
reason = String.Empty; reason = String.Empty;
//Teleport flags: //Teleport flags:
@ -3380,7 +3379,7 @@ namespace OpenSim.Region.Framework.Scenes
ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y);
//On login test land permisions //On login test land permisions
if (tp == TeleportFlags.ViaLogin) if (vialogin)
{ {
if (land != null && !TestLandRestrictions(agent, land, out reason)) if (land != null && !TestLandRestrictions(agent, land, out reason))
{ {
@ -3440,7 +3439,7 @@ namespace OpenSim.Region.Framework.Scenes
agent.teleportFlags = teleportFlags; agent.teleportFlags = teleportFlags;
m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent); m_authenticateHandler.AddNewCircuit(agent.circuitcode, agent);
if (tp == TeleportFlags.ViaLogin) if (vialogin)
{ {
if (TestBorderCross(agent.startpos, Cardinals.E)) if (TestBorderCross(agent.startpos, Cardinals.E))
{ {
@ -3561,7 +3560,7 @@ namespace OpenSim.Region.Framework.Scenes
IPresenceService presence = RequestModuleInterface<IPresenceService>(); IPresenceService presence = RequestModuleInterface<IPresenceService>();
if (presence == null) if (presence == null)
{ {
reason = String.Format("Failed to verify user {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); reason = String.Format("Failed to verify user presence in the grid for {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName);
return false; return false;
} }
@ -3569,7 +3568,7 @@ namespace OpenSim.Region.Framework.Scenes
if (pinfo == null) if (pinfo == null)
{ {
reason = String.Format("Failed to verify user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); reason = String.Format("Failed to verify user presence in the grid for {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName);
return false; return false;
} }

View File

@ -130,11 +130,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
{ {
TestHelper.InMethod(); TestHelper.InMethod();
//log4net.Config.XmlConfigurator.Configure(); //log4net.Config.XmlConfigurator.Configure();
UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001"); UUID agentId = UUID.Parse("00000000-0000-0000-0000-000000000001");
TestScene scene = SceneSetupHelpers.SetupScene(); TestScene scene = SceneSetupHelpers.SetupScene();
// Turn off the timer on the async sog deleter - we'll crank it by hand for this test. // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter; AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
sogd.Enabled = false; sogd.Enabled = false;
@ -147,7 +147,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
Assert.That(retrievedPart, Is.Not.Null); Assert.That(retrievedPart, Is.Not.Null);
sogd.InventoryDeQueueAndDelete(); sogd.InventoryDeQueueAndDelete();
SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId); SceneObjectPart retrievedPart2 = scene.GetSceneObjectPart(part.LocalId);

View File

@ -104,8 +104,8 @@ namespace OpenSim.Region.Framework.Scenes.Tests
agent.AgentID = agent1; agent.AgentID = agent1;
agent.firstname = firstName; agent.firstname = firstName;
agent.lastname = "testlastname"; agent.lastname = "testlastname";
agent.SessionID = UUID.Zero; agent.SessionID = UUID.Random();
agent.SecureSessionID = UUID.Zero; agent.SecureSessionID = UUID.Random();
agent.circuitcode = 123; agent.circuitcode = 123;
agent.BaseFolder = UUID.Zero; agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero; agent.InventoryFolder = UUID.Zero;
@ -114,6 +114,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
agent.ChildrenCapSeeds = new Dictionary<ulong, string>(); agent.ChildrenCapSeeds = new Dictionary<ulong, string>();
agent.child = true; agent.child = true;
if (scene.PresenceService == null)
Console.WriteLine("Presence Service is null");
scene.PresenceService.LoginAgent(agent.AgentID.ToString(), agent.SessionID, agent.SecureSessionID);
string reason; string reason;
scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason); scene.NewUserConnection(agent, (uint)TeleportFlags.ViaLogin, out reason);
testclient = new TestClient(agent, scene); testclient = new TestClient(agent, scene);

View File

@ -183,6 +183,8 @@ namespace OpenSim.Server.Handlers.Simulation
resp["reason"] = OSD.FromString(reason); resp["reason"] = OSD.FromString(reason);
resp["success"] = OSD.FromBoolean(result); resp["success"] = OSD.FromBoolean(result);
// Let's also send out the IP address of the caller back to the caller (HG 1.5)
resp["your_ip"] = OSD.FromString(GetCallerIP(request));
// TODO: add reason if not String.Empty? // TODO: add reason if not String.Empty?
responsedata["int_response_code"] = HttpStatusCode.OK; responsedata["int_response_code"] = HttpStatusCode.OK;
@ -375,6 +377,24 @@ namespace OpenSim.Server.Handlers.Simulation
{ {
m_SimulationService.ReleaseAgent(regionID, id, ""); m_SimulationService.ReleaseAgent(regionID, id, "");
} }
private string GetCallerIP(Hashtable req)
{
if (req.ContainsKey("headers"))
{
try
{
Hashtable headers = (Hashtable)req["headers"];
if (headers.ContainsKey("remote_addr") && headers["remote_addr"] != null)
return headers["remote_addr"].ToString();
}
catch (Exception e)
{
m_log.WarnFormat("[AGENT HANDLER]: exception in GetCallerIP: {0}", e.Message);
}
}
return string.Empty;
}
} }
} }

View File

@ -38,6 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
using OpenMetaverse; using OpenMetaverse;
using OpenMetaverse.Imaging; using OpenMetaverse.Imaging;
using OpenMetaverse.StructuredData;
using Nwc.XmlRpc; using Nwc.XmlRpc;
using log4net; using log4net;
@ -278,5 +279,48 @@ namespace OpenSim.Services.Connectors.Hypergrid
return null; return null;
} }
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
{
HttpWebRequest AgentCreateRequest = null;
myipaddress = String.Empty;
reason = String.Empty;
if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
{
string response = GetResponse(AgentCreateRequest, out reason);
bool success = true;
UnpackResponse(response, out success, out reason, out myipaddress);
return success;
}
return false;
}
protected void UnpackResponse(string response, out bool result, out string reason, out string ipaddress)
{
result = true;
reason = string.Empty;
ipaddress = string.Empty;
if (!String.IsNullOrEmpty(response))
{
try
{
// we assume we got an OSDMap back
OSDMap r = Util.GetOSDMap(response);
result = r["success"].AsBoolean();
reason = r["reason"].AsString();
ipaddress = r["your_ip"].AsString();
}
catch (NullReferenceException e)
{
m_log.InfoFormat("[GATEKEEPER SERVICE CONNECTOR]: exception on UnpackResponse of DoCreateChildAgentCall {0}", e.Message);
reason = "Internal error";
result = false;
}
}
}
} }
} }

View File

@ -73,6 +73,13 @@ namespace OpenSim.Services.Connectors.Hypergrid
{ {
} }
public bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint ipaddress, out string reason)
{
// not available over remote calls
reason = "Method not available over remote calls";
return false;
}
public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
{ {
reason = String.Empty; reason = String.Empty;

View File

@ -77,8 +77,26 @@ namespace OpenSim.Services.Connectors.Simulation
public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
{ {
HttpWebRequest AgentCreateRequest = null;
reason = String.Empty; reason = String.Empty;
if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
{
string response = GetResponse(AgentCreateRequest, out reason);
bool success = true;
UnpackResponse(response, out success, out reason);
return success;
}
return false;
}
protected bool SendRequest(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason, out HttpWebRequest AgentCreateRequest)
{
reason = String.Empty;
AgentCreateRequest = null;
if (destination == null) if (destination == null)
{ {
reason = "Destination is null"; reason = "Destination is null";
@ -101,7 +119,7 @@ namespace OpenSim.Services.Connectors.Simulation
//Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
HttpWebRequest AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
AgentCreateRequest.Method = "POST"; AgentCreateRequest.Method = "POST";
AgentCreateRequest.ContentType = "application/json"; AgentCreateRequest.ContentType = "application/json";
AgentCreateRequest.Timeout = 10000; AgentCreateRequest.Timeout = 10000;
@ -134,7 +152,7 @@ namespace OpenSim.Services.Connectors.Simulation
AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send AgentCreateRequest.ContentLength = buffer.Length; //Count bytes to send
os = AgentCreateRequest.GetRequestStream(); os = AgentCreateRequest.GetRequestStream();
os.Write(buffer, 0, strBuffer.Length); //Send it os.Write(buffer, 0, strBuffer.Length); //Send it
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}", m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted CreateAgent request to remote sim {0}, region {1}, x={2} y={3}",
uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY); uri, destination.RegionName, destination.RegionLocX, destination.RegionLocY);
} }
//catch (WebException ex) //catch (WebException ex)
@ -150,11 +168,18 @@ namespace OpenSim.Services.Connectors.Simulation
os.Close(); os.Close();
} }
return true;
}
protected string GetResponse(HttpWebRequest AgentCreateRequest, out string reason)
{
// Let's wait for the response // Let's wait for the response
//m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall"); //m_log.Info("[REMOTE SIMULATION CONNECTOR]: Waiting for a reply after DoCreateChildAgentCall");
reason = string.Empty;
WebResponse webResponse = null; WebResponse webResponse = null;
StreamReader sr = null; StreamReader sr = null;
string response = string.Empty;
try try
{ {
webResponse = AgentCreateRequest.GetResponse(); webResponse = AgentCreateRequest.GetResponse();
@ -166,37 +191,15 @@ namespace OpenSim.Services.Connectors.Simulation
{ {
sr = new StreamReader(webResponse.GetResponseStream()); sr = new StreamReader(webResponse.GetResponseStream());
string response = sr.ReadToEnd().Trim(); response = sr.ReadToEnd().Trim();
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response); m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: DoCreateChildAgentCall reply was {0} ", response);
if (!String.IsNullOrEmpty(response))
{
try
{
// we assume we got an OSDMap back
OSDMap r = Util.GetOSDMap(response);
bool success = r["success"].AsBoolean();
reason = r["reason"].AsString();
return success;
}
catch (NullReferenceException e)
{
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message);
// check for old style response
if (response.ToLower().StartsWith("true"))
return true;
return false;
}
}
} }
} }
catch (WebException ex) catch (WebException ex)
{ {
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message); m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", ex.Message);
reason = "Destination did not reply"; reason = "Destination did not reply";
return false; return string.Empty;
} }
finally finally
{ {
@ -204,7 +207,33 @@ namespace OpenSim.Services.Connectors.Simulation
sr.Close(); sr.Close();
} }
return true; return response;
}
protected void UnpackResponse(string response, out bool result, out string reason)
{
result = true;
reason = string.Empty;
if (!String.IsNullOrEmpty(response))
{
try
{
// we assume we got an OSDMap back
OSDMap r = Util.GetOSDMap(response);
result = r["success"].AsBoolean();
reason = r["reason"].AsString();
}
catch (NullReferenceException e)
{
m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of DoCreateChildAgentCall {0}", e.Message);
// check for old style response
if (response.ToLower().StartsWith("true"))
result = true;
result = false;
}
}
} }
protected virtual OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion destination, uint flags) protected virtual OSDMap PackCreateAgentArguments(AgentCircuitData aCircuit, GridRegion destination, uint flags)

View File

@ -225,17 +225,23 @@ namespace OpenSim.Services.HypergridService
// May want to authorize // May want to authorize
bool isFirstLogin = false;
// //
// Login the presence // Login the presence, if it's not there yet (by the login service)
// //
if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID)) PresenceInfo presence = m_PresenceService.GetAgent(aCircuit.SessionID);
{ if (presence != null) // it has been placed there by the login service
reason = "Unable to login presence"; isFirstLogin = true;
m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.",
aCircuit.firstname, aCircuit.lastname); else
return false; if (!m_PresenceService.LoginAgent(aCircuit.AgentID.ToString(), aCircuit.SessionID, aCircuit.SecureSessionID))
} {
m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok"); reason = "Unable to login presence";
m_log.InfoFormat("[GATEKEEPER SERVICE]: Presence login failed for foreign agent {0} {1}. Refusing service.",
aCircuit.firstname, aCircuit.lastname);
return false;
}
m_log.DebugFormat("[GATEKEEPER SERVICE]: Login presence ok");
// //
// Get the region // Get the region
@ -274,7 +280,9 @@ namespace OpenSim.Services.HypergridService
// //
// Finally launch the agent at the destination // Finally launch the agent at the destination
// //
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); Constants.TeleportFlags loginFlag = isFirstLogin ? Constants.TeleportFlags.ViaLogin : Constants.TeleportFlags.ViaHGLogin;
m_log.DebugFormat("[GATEKEEPER SERVICE]: launching agent {0}", loginFlag);
return m_SimulationService.CreateAgent(destination, aCircuit, (uint)loginFlag, out reason);
} }
protected bool Authenticate(AgentCircuitData aCircuit) protected bool Authenticate(AgentCircuitData aCircuit)

View File

@ -131,10 +131,11 @@ namespace OpenSim.Services.HypergridService
return home; return home;
} }
public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason) public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason)
{ {
m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} to grid {2}", m_log.DebugFormat("[USER AGENT SERVICE]: Request to login user {0} {1} (@{2}) to grid {3}",
agentCircuit.firstname, agentCircuit.lastname, gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort); agentCircuit.firstname, agentCircuit.lastname, ((clientIP == null) ? "stored IP" : clientIP.Address.ToString()),
gatekeeper.ExternalHostName +":"+ gatekeeper.HttpPort);
// Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination // Take the IP address + port of the gatekeeper (reg) plus the info of finalDestination
GridRegion region = new GridRegion(gatekeeper); GridRegion region = new GridRegion(gatekeeper);
@ -149,11 +150,12 @@ namespace OpenSim.Services.HypergridService
//bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason);
bool success = false; bool success = false;
string myExternalIP = string.Empty;
string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort;
if (m_GridName == gridName) if (m_GridName == gridName)
success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason);
else else
success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out myExternalIP, out reason);
if (!success) if (!success)
{ {
@ -167,15 +169,26 @@ namespace OpenSim.Services.HypergridService
return false; return false;
} }
m_log.DebugFormat("[USER AGENT SERVICE]: Gatekeeper sees me as {0}", myExternalIP);
// else set the IP addresses associated with this client
if (clientIP != null)
m_TravelingAgents[agentCircuit.SessionID].ClientIPAddress = clientIP.Address.ToString();
m_TravelingAgents[agentCircuit.SessionID].MyIpAddress = myExternalIP;
return true; return true;
} }
public void SetClientToken(UUID sessionID, string token) public bool LoginAgentToGrid(AgentCircuitData agentCircuit, GridRegion gatekeeper, GridRegion finalDestination, out string reason)
{
reason = string.Empty;
return LoginAgentToGrid(agentCircuit, gatekeeper, finalDestination, null, out reason);
}
private void SetClientIP(UUID sessionID, string ip)
{ {
if (m_TravelingAgents.ContainsKey(sessionID)) if (m_TravelingAgents.ContainsKey(sessionID))
{ {
m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID); m_log.DebugFormat("[USER AGENT SERVICE]: Setting IP {0} for session {1}", ip, sessionID);
m_TravelingAgents[sessionID].ClientToken = token; m_TravelingAgents[sessionID].ClientIPAddress = ip;
} }
} }
@ -196,7 +209,7 @@ namespace OpenSim.Services.HypergridService
travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort;
travel.ServiceToken = agentCircuit.ServiceSessionID; travel.ServiceToken = agentCircuit.ServiceSessionID;
if (old != null) if (old != null)
travel.ClientToken = old.ClientToken; travel.ClientIPAddress = old.ClientIPAddress;
return old; return old;
} }
@ -233,15 +246,22 @@ namespace OpenSim.Services.HypergridService
return travel.GridExternalName == thisGridExternalName; return travel.GridExternalName == thisGridExternalName;
} }
public bool VerifyClient(UUID sessionID, string token) public bool VerifyClient(UUID sessionID, string reportedIP)
{ {
if (m_BypassClientVerification) if (m_BypassClientVerification)
return true; return true;
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with reported IP {1}.",
sessionID, reportedIP);
if (m_TravelingAgents.ContainsKey(sessionID)) if (m_TravelingAgents.ContainsKey(sessionID))
return m_TravelingAgents[sessionID].ClientToken == token; {
m_log.DebugFormat("[USER AGENT SERVICE]: Comparing with login IP {0} and MyIP {1}",
m_TravelingAgents[sessionID].ClientIPAddress, m_TravelingAgents[sessionID].MyIpAddress);
return m_TravelingAgents[sessionID].ClientIPAddress == reportedIP ||
m_TravelingAgents[sessionID].MyIpAddress == reportedIP; // NATed
}
return false; return false;
} }
@ -266,7 +286,8 @@ namespace OpenSim.Services.HypergridService
public UUID UserID; public UUID UserID;
public string GridExternalName = string.Empty; public string GridExternalName = string.Empty;
public string ServiceToken = string.Empty; public string ServiceToken = string.Empty;
public string ClientToken = string.Empty; public string ClientIPAddress = string.Empty; // as seen from this user agent service
public string MyIpAddress = string.Empty; // the user agent service's external IP, as seen from the next gatekeeper
} }
} }

View File

@ -48,13 +48,15 @@ namespace OpenSim.Services.Interfaces
/// </summary> /// </summary>
public interface IUserAgentService public interface IUserAgentService
{ {
// called by login service only
bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint clientIP, out string reason);
// called by simulators
bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason); bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, out string reason);
void SetClientToken(UUID sessionID, string token);
void LogoutAgent(UUID userID, UUID sessionID); void LogoutAgent(UUID userID, UUID sessionID);
GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt); GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt);
bool AgentIsComingHome(UUID sessionID, string thisGridExternalName); bool AgentIsComingHome(UUID sessionID, string thisGridExternalName);
bool VerifyAgent(UUID sessionID, string token); bool VerifyAgent(UUID sessionID, string token);
bool VerifyClient(UUID sessionID, string token); bool VerifyClient(UUID sessionID, string reportedIP);
} }
} }

View File

@ -761,12 +761,8 @@ namespace OpenSim.Services.LLLoginService
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason) private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, IPEndPoint clientIP, out string reason)
{ {
m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName);
if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, clientIP, out reason))
{
IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address);
m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */);
return true; return true;
}
return false; return false;
} }

View File

@ -46,6 +46,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
using OpenSim.Services.Interfaces; using OpenSim.Services.Interfaces;
using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Mock;
@ -63,6 +64,7 @@ namespace OpenSim.Tests.Common.Setup
private static ISharedRegionModule m_inventoryService = null; private static ISharedRegionModule m_inventoryService = null;
private static ISharedRegionModule m_gridService = null; private static ISharedRegionModule m_gridService = null;
private static ISharedRegionModule m_userAccountService = null; private static ISharedRegionModule m_userAccountService = null;
private static ISharedRegionModule m_presenceService = null;
/// <summary> /// <summary>
/// Set up a test scene /// Set up a test scene
@ -180,7 +182,7 @@ namespace OpenSim.Tests.Common.Setup
else else
StartAssetService(testScene, false); StartAssetService(testScene, false);
// For now, always started a 'real' authenication service // For now, always started a 'real' authentication service
StartAuthenticationService(testScene, true); StartAuthenticationService(testScene, true);
if (realServices.Contains("inventory")) if (realServices.Contains("inventory"))
@ -188,10 +190,9 @@ namespace OpenSim.Tests.Common.Setup
else else
StartInventoryService(testScene, false); StartInventoryService(testScene, false);
if (realServices.Contains("grid")) StartGridService(testScene, true);
StartGridService(testScene, true);
StartUserAccountService(testScene); StartUserAccountService(testScene);
StartPresenceService(testScene);
} }
// If not, make sure the shared module gets references to this new scene // If not, make sure the shared module gets references to this new scene
else else
@ -202,11 +203,15 @@ namespace OpenSim.Tests.Common.Setup
m_inventoryService.RegionLoaded(testScene); m_inventoryService.RegionLoaded(testScene);
m_userAccountService.AddRegion(testScene); m_userAccountService.AddRegion(testScene);
m_userAccountService.RegionLoaded(testScene); m_userAccountService.RegionLoaded(testScene);
m_presenceService.AddRegion(testScene);
m_presenceService.RegionLoaded(testScene);
} }
m_inventoryService.PostInitialise(); m_inventoryService.PostInitialise();
m_assetService.PostInitialise(); m_assetService.PostInitialise();
m_userAccountService.PostInitialise(); m_userAccountService.PostInitialise();
m_presenceService.PostInitialise();
testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random(); testScene.RegionInfo.EstateSettings.EstateOwner = UUID.Random();
testScene.SetModuleInterfaces(); testScene.SetModuleInterfaces();
@ -225,7 +230,11 @@ namespace OpenSim.Tests.Common.Setup
m_inventoryService = null; m_inventoryService = null;
m_gridService = null; m_gridService = null;
m_userAccountService = null; m_userAccountService = null;
m_presenceService = null;
testScene.RegionInfo.EstateSettings = new EstateSettings();
testScene.LoginsDisabled = false;
return testScene; return testScene;
} }
@ -336,6 +345,32 @@ namespace OpenSim.Tests.Common.Setup
testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService); testScene.AddRegionModule(m_userAccountService.Name, m_userAccountService);
} }
/// <summary>
/// Start a presence service
/// </summary>
/// <param name="testScene"></param>
private static void StartPresenceService(Scene testScene)
{
IConfigSource config = new IniConfigSource();
config.AddConfig("Modules");
config.AddConfig("PresenceService");
config.Configs["Modules"].Set("PresenceServices", "LocalPresenceServicesConnector");
config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll");
config.Configs["PresenceService"].Set(
"LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService");
if (m_presenceService == null)
{
ISharedRegionModule presenceService = new LocalPresenceServicesConnector();
presenceService.Initialise(config);
m_presenceService = presenceService;
}
m_presenceService.AddRegion(testScene);
m_presenceService.RegionLoaded(testScene);
testScene.AddRegionModule(m_presenceService.Name, m_presenceService);
}
/// <summary> /// <summary>
/// Setup modules for a scene using their default settings. /// Setup modules for a scene using their default settings.
/// </summary> /// </summary>
@ -446,9 +481,14 @@ namespace OpenSim.Tests.Common.Setup
{ {
string reason; string reason;
// We emulate the proper login sequence here by doing things in three stages // We emulate the proper login sequence here by doing things in four stages
// Stage 0: log the presence
scene.PresenceService.LoginAgent(agentData.AgentID.ToString(), agentData.SessionID, agentData.SecureSessionID);
// Stage 1: simulate login by telling the scene to expect a new user connection // Stage 1: simulate login by telling the scene to expect a new user connection
scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason); if (!scene.NewUserConnection(agentData, (uint)TeleportFlags.ViaLogin, out reason))
Console.WriteLine("NewUserConnection failed: " + reason);
// Stage 2: add the new client as a child agent to the scene // Stage 2: add the new client as a child agent to the scene
TestClient client = new TestClient(agentData, scene); TestClient client = new TestClient(agentData, scene);
@ -459,7 +499,7 @@ namespace OpenSim.Tests.Common.Setup
//scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE //scene.AgentCrossing(agentData.AgentID, new Vector3(90, 90, 90), false); OBSOLETE
ScenePresence scp = scene.GetScenePresence(agentData.AgentID); ScenePresence scp = scene.GetScenePresence(agentData.AgentID);
scp.MakeRootAgent(new Vector3(90,90,90), true); scp.MakeRootAgent(new Vector3(90, 90, 90), true);
return client; return client;
} }

View File

@ -300,7 +300,7 @@
; What is reported as the "X-Secondlife-Shard" ; What is reported as the "X-Secondlife-Shard"
; Defaults to the user server url if not set ; Defaults to the user server url if not set
; The old default is "OpenSim", set here fro compatibility ; The old default is "OpenSim", set here for compatibility
shard = "OpenSim" shard = "OpenSim"
; What is reported as the "User-Agent" when using llHTTPRequest ; What is reported as the "User-Agent" when using llHTTPRequest
@ -309,6 +309,18 @@
; " (Mozilla Compatible)" to the text where there are problems with a web server ; " (Mozilla Compatible)" to the text where there are problems with a web server
;user_agent = "OpenSim LSL (Mozilla Compatible)" ;user_agent = "OpenSim LSL (Mozilla Compatible)"
[XMLRPC]
; ##
; ## Scripting XMLRPC mapper
; ##
; If enabled, this will post an event, "xmlrpc_uri(string)" to the
; script concurrently with the first remote_data event.
; This will contain the fully qualified URI an external site needs
; to use to send XMLRPC requests to that script
;XmlRpcRouterModule = "XmlRpcRouterModule"
;XmlRpcPort = 20800
[ClientStack.LindenUDP] [ClientStack.LindenUDP]
; Set this to true to process incoming packets asynchronously. Networking is ; Set this to true to process incoming packets asynchronously. Networking is
@ -1180,37 +1192,38 @@ UseSafetyCommit = true
;vivox_channel_clamping_distance = 10 ;vivox_channel_clamping_distance = 10
[FreeSwitchVoice] [FreeSwitchVoice]
; In order for this to work you need a functioning freeswitch pbx set ; In order for this to work you need a functioning FreeSWITCH PBX set up.
; up. Configuration for that will be posted in the wiki soon. ; Configuration details at http://opensimulator.org/wiki/Freeswitch_Module
enabled = false enabled = false
;FreeSwitch server is going to contact us and ask us all ; FreeSWITCH server is going to contact us and ask us all sorts of things
;sorts of things.
freeswitch_server_user = freeswitch freeswitch_server_user = freeswitch
freeswitch_server_pass = password freeswitch_server_pass = password
freeswitch_api_prefix = /api freeswitch_api_prefix = /api
; this is the IP of your sim ; external IP address of your OpenSim voice enabled region
; note: all regions running on same OpenSim.exe will be enabled
freeswitch_service_server = ip.address.of.your.sim freeswitch_service_server = ip.address.of.your.sim
;freeswitch_service_port = 80
; this should be the same port the region listens on ; this should be the same port the region listens on
freeswitch_service_port = 9000 freeswitch_service_port = 9000
freeswitch_realm = ip.address.of.freeswitch.server freeswitch_realm = ip.address.of.freeswitch.server
freeswitch_sip_proxy = ip.address.of.freeswitch.server:5060 freeswitch_sip_proxy = ip.address.of.freeswitch.server:5060
; STUN = Simple Traversal of UDP through NATs
; See http://wiki.freeswitch.org/wiki/NAT_Traversal
; stun.freeswitch.org is not guaranteed to be running so use it in production at your own risk
freeswitch_attempt_stun = false freeswitch_attempt_stun = false
freeswitch_stun_server = ip.address.of.freeswitch.server freeswitch_stun_server = ip.address.of.stun.server
freeswitch_echo_server = ip.address.of.freeswitch.server freeswitch_echo_server = ip.address.of.freeswitch.server
freeswitch_echo_port = 50505 freeswitch_echo_port = 50505
freeswitch_well_known_ip = ip.address.of.freeswitch.server freeswitch_well_known_ip = ip.address.of.freeswitch.server
;
;Type the address of your http server here, hostname is allowed. This is provided so you can specify a hostname ; Type the address of your http server here, hostname is allowed. This is provided so you can specify a hostname
;This is used by client for account verification. By default, it's the same as the freeswitch service server. ; This is used by client for account verification. By default, it's the same as the freeswitch service server.
;
;opensim_well_known_http_address = Address_Of_your_SIM_HTTP_Server_Hostname_Allowed ; opensim_well_known_http_address = Address_Of_Your_SIM_HTTP_Server_Hostname_Allowed
;
freeswitch_default_timeout = 5000 freeswitch_default_timeout = 5000
freeswitch_subscribe_retry = 120 freeswitch_subscribe_retry = 120
; freeswitch_password_reset_url = ; freeswitch_password_reset_url =
[Groups] [Groups]
Enabled = false Enabled = false
@ -1331,16 +1344,8 @@ Message = "The MOTD module is working!"
[Modules] [Modules]
Include-modules = "addon-modules/*/config/*.ini" Include-modules = "addon-modules/*/config/*.ini"
[XMLRPC]
; ##
; ## Scripting XMLRPC mapper
; ##
; If enabled, this will post an event, "xmlrpc_uri(string)" to the
; script concurrently with the first remote_data event.
; This will contain the fully qualified URI an external site needs
; to use to send XMLRPC requests to that script
;XmlRpcRouterModule = "XmlRpcRouterModule"
;XmlRpcPort = 20800
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ENSURE [Architecture] and [Modules] Sections with their "includes"
;; are last to allow for overrides
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@ -1,15 +1,25 @@
;; Configurations for enabling HG1.5 ; * Run
;; ; * $ Robust.exe -inifile Robust.HG.ini
;; Run ; *
;; $ Robust.exe -inifile Robust.HG.ini
;; HG1.5 handlers are: OpenSim.Server.Handlers.dll:GatekeeperService
;; OpenSim.Server.Handlers.dll:UserAgentService
;; Additional OpenSim.Server.Handlers.dll:AssetServiceConnector and
;; OpenSim.Server.Handlers.dll:XInventoryInConnector
;; are started in port 8002, outside the firewall
;;
; * Configurations for enabling HG1.5
; *
; * HG1.5 handlers are: OpenSim.Server.Handlers.dll:GatekeeperService
; * OpenSim.Server.Handlers.dll:UserAgentService
; * Additional OpenSim.Server.Handlers.dll:AssetServiceConnector and
; * OpenSim.Server.Handlers.dll:XInventoryInConnector
; * are started in port 8002, outside the firewall
; *
; * The startup section lists all the connectors to start up in this server
; * instance. This may be only one, or it may be the entire server suite.
; * Multiple connectors should be separated by commas.
; *
; * These are the IN connectors the server uses, the in connectors
; * read this config file and load the needed service and database connectors
; *
; * The full syntax of a connector string is:
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
; *
[Startup] [Startup]
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector" ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:AssetServiceConnector"
@ -52,10 +62,10 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * ; *
[GridService] [GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
Realm = "regions" ; Realm = "regions"
; AllowDuplicateNames = "True" ; AllowDuplicateNames = "True"
; Check4096 = "False" ; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions ;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>" ;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>" ;; or: Region_<RegionID> = "<flags>"
@ -70,12 +80,13 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the new style authentication service. Currently, only MySQL ; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup. ; * is implemented. "Realm" is the table that is used for user lookup.
; * By setting it to "users", you can use the old style users table ; * It defaults to "useraccounts", which uses the new style.
; * as an authentication source. ; * Realm = "users" will use the legacy tables as an authentication source
; * ; *
[AuthenticationService] [AuthenticationService]
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
; Realm = "useraccounts"
[OpenIdService] [OpenIdService]
; for the server connector ; for the server connector
@ -89,7 +100,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[UserAccountService] [UserAccountService]
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService"
;; These are for creating new accounts by the service ; Realm = "usersaccounts"
; These are for creating new accounts by the service
AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
@ -161,32 +174,25 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; login page: optional: if it exists it will be used to tell the client to use ; login page: optional: if it exists it will be used to tell the client to use
; this as splash page ; this as splash page
; currently unused
;welcome = http://127.0.0.1/welcome ;welcome = http://127.0.0.1/welcome
; helper uri: optional: if it exists if will be used to tell the client to use ; helper uri: optional: if it exists if will be used to tell the client to use
; this for all economy related things ; this for all economy related things
; currently unused
;economy = http://127.0.0.1:9000/ ;economy = http://127.0.0.1:9000/
; web page of grid: optional: page providing further information about your grid ; web page of grid: optional: page providing further information about your grid
; currently unused
;about = http://127.0.0.1/about/ ;about = http://127.0.0.1/about/
; account creation: optional: page providing further information about obtaining ; account creation: optional: page providing further information about obtaining
; a user account on your grid ; a user account on your grid
; currently unused
;register = http://127.0.0.1/register ;register = http://127.0.0.1/register
; help: optional: page providing further assistance for users of your grid ; help: optional: page providing further assistance for users of your grid
; currently unused
;help = http://127.0.0.1/help ;help = http://127.0.0.1/help
; password help: optional: page providing password assistance for users of your grid ; password help: optional: page providing password assistance for users of your grid
; currently unused
;password = http://127.0.0.1/password ;password = http://127.0.0.1/password
[GatekeeperService] [GatekeeperService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:GatekeeperService"
;; for the service ;; for the service
@ -200,9 +206,9 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; CHANGE THIS ; CHANGE THIS
ExternalName = "http://127.0.0.1:8002" ExternalName = "http://127.0.0.1:8002"
; Does this grid allow incoming links to any region in it? ; Does this grid allow incoming links to any region in it?
; If false, HG TPs happen only to the Default regions specified in [GridService] section ; If false, HG TPs happen only to the Default regions specified in [GridService] section
AllowTeleportsToAnyRegion = true AllowTeleportsToAnyRegion = true
[UserAgentService] [UserAgentService]
LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService" LocalServiceModule = "OpenSim.Services.HypergridService.dll:UserAgentService"
@ -211,12 +217,12 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
;; The interface that local users get when they are in other grids. ; * The interface that local users get when they are in other grids.
;; This restricts the inventory operations while in other grids. ; * This restricts the inventory operations while in other grids.
;; Still not completely safe, especially if users perform inventory operations ; * Still not completely safe, especially if users perform inventory operations
;; while in those grids. The more the user accesses his/her inventory, the more ; * while in those grids. The more the user accesses his/her inventory, the more
;; those simulators will know about the user's inventory. ; * those simulators will know about the user's inventory.
; *
[HGInventoryService] [HGInventoryService]
; For the InventoryServiceInConnector ; For the InventoryServiceInConnector
LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService" LocalServiceModule = "OpenSim.Services.InventoryService.dll:HGInventoryService"

View File

@ -1,16 +1,18 @@
; * Run
; * $ Robust.exe -inifile Robust.ini
; *
; * The startup section lists all the connectors to start up in this server ; * The startup section lists all the connectors to start up in this server
; * instance. This may be only one, or it may be the entire server suite. ; * instance. This may be only one, or it may be the entire server suite.
; * Multiple connectors should be seaprated by commas. ; * Multiple connectors should be separated by commas.
; * The startup section lists all the connectors to start up in this server
; * instance. This may be only one, or it may be the entire server suite.
; * Multiple connectors should be seaprated by commas.
; * ; *
; * These are the IN connectors the server uses, the in connectors ; * These are the IN connectors the server uses, the in connectors
; * read this config file and load the needed service and database connectors ; * read this config file and load the needed service and database connectors
; * ; *
; * The full syntax of a connector string is:
; * [[<ConfigName>@]<port>/]<dll name>[:<class name>]
; * ; *
[Startup] [Startup]
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector" ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector"
; * This is common for all services, it's the network setup for the entire ; * This is common for all services, it's the network setup for the entire
@ -30,7 +32,6 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
StorageProvider = "OpenSim.Data.MySQL.dll" StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=*****;Old Guids=true;"
; * As an example, the below configuration precisely mimicks the legacy ; * As an example, the below configuration precisely mimicks the legacy
; * asset server. It is read by the asset IN connector (defined above) ; * asset server. It is read by the asset IN connector (defined above)
; * and it then loads the OUT connector (a local database module). That, ; * and it then loads the OUT connector (a local database module). That,
@ -54,8 +55,10 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * ; *
[GridService] [GridService]
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
Realm = "regions" ; Realm = "regions"
; AllowDuplicateNames = "True" ; AllowDuplicateNames = "True"
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions ;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>" ;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>" ;; or: Region_<RegionID> = "<flags>"
@ -70,8 +73,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the new style authentication service. Currently, only MySQL ; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup. ; * is implemented. "Realm" is the table that is used for user lookup.
; * By setting it to "users", you can use the old style users table ; * It defaults to "users", which uses the legacy tables as an
; * as an authentication source. ; * authentication source.
; * ; *
[AuthenticationService] [AuthenticationService]
; for the server connector ; for the server connector
@ -82,15 +85,17 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService"
; * This is the new style user service. ; * This is the new style authentication service. Currently, only MySQL
; * "Realm" is the table that is used for user lookup. ; * is implemented. "Realm" is the table that is used for user lookup.
; * It defaults to "users", which uses the legacy tables ; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source
; * ; *
[UserAccountService] [UserAccountService]
; for the server connector ; for the server connector
LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService" LocalServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService"
; Realm = "useraccounts" ; Realm = "useraccounts"
;; These are for creating new accounts by the service
; These are for creating new accounts by the service
AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
@ -158,27 +163,21 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; login page: optional: if it exists it will be used to tell the client to use ; login page: optional: if it exists it will be used to tell the client to use
; this as splash page ; this as splash page
; currently unused
;welcome = http://127.0.0.1/welcome ;welcome = http://127.0.0.1/welcome
; helper uri: optional: if it exists if will be used to tell the client to use ; helper uri: optional: if it exists if will be used to tell the client to use
; this for all economy related things ; this for all economy related things
; currently unused
;economy = http://127.0.0.1:9000/ ;economy = http://127.0.0.1:9000/
; web page of grid: optional: page providing further information about your grid ; web page of grid: optional: page providing further information about your grid
; currently unused
;about = http://127.0.0.1/about/ ;about = http://127.0.0.1/about/
; account creation: optional: page providing further information about obtaining ; account creation: optional: page providing further information about obtaining
; a user account on your grid ; a user account on your grid
; currently unused
;register = http://127.0.0.1/register ;register = http://127.0.0.1/register
; help: optional: page providing further assistance for users of your grid ; help: optional: page providing further assistance for users of your grid
; currently unused
;help = http://127.0.0.1/help ;help = http://127.0.0.1/help
; password help: optional: page providing password assistance for users of your grid ; password help: optional: page providing password assistance for users of your grid
; currently unused
;password = http://127.0.0.1/password ;password = http://127.0.0.1/password