Merge branch 'master' into careminster-presence-refactor
commit
b94cace547
|
@ -20,6 +20,7 @@
|
||||||
<delete dir="${distbindir}/.nant"/>
|
<delete dir="${distbindir}/.nant"/>
|
||||||
<delete>
|
<delete>
|
||||||
<fileset basedir="${distbindir}">
|
<fileset basedir="${distbindir}">
|
||||||
|
<include name="BUILDING.txt"/>
|
||||||
<include name="Makefile"/>
|
<include name="Makefile"/>
|
||||||
<include name="nant-color"/>
|
<include name="nant-color"/>
|
||||||
<include name="OpenSim.*"/>
|
<include name="OpenSim.*"/>
|
||||||
|
|
|
@ -36,6 +36,7 @@ namespace OpenSim.Framework
|
||||||
public class AgentCircuitManager
|
public class AgentCircuitManager
|
||||||
{
|
{
|
||||||
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
|
public Dictionary<uint, AgentCircuitData> AgentCircuits = new Dictionary<uint, AgentCircuitData>();
|
||||||
|
public Dictionary<UUID, AgentCircuitData> AgentCircuitsByUUID = new Dictionary<UUID, AgentCircuitData>();
|
||||||
|
|
||||||
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
|
public virtual AuthenticateResponse AuthenticateSession(UUID sessionID, UUID agentID, uint circuitcode)
|
||||||
{
|
{
|
||||||
|
@ -86,10 +87,12 @@ namespace OpenSim.Framework
|
||||||
if (AgentCircuits.ContainsKey(circuitCode))
|
if (AgentCircuits.ContainsKey(circuitCode))
|
||||||
{
|
{
|
||||||
AgentCircuits[circuitCode] = agentData;
|
AgentCircuits[circuitCode] = agentData;
|
||||||
|
AgentCircuitsByUUID[agentData.AgentID] = agentData;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AgentCircuits.Add(circuitCode, agentData);
|
AgentCircuits.Add(circuitCode, agentData);
|
||||||
|
AgentCircuitsByUUID.Add(agentData.AgentID, agentData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,10 +102,26 @@ namespace OpenSim.Framework
|
||||||
lock (AgentCircuits)
|
lock (AgentCircuits)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey(circuitCode))
|
if (AgentCircuits.ContainsKey(circuitCode))
|
||||||
|
{
|
||||||
|
UUID agentID = AgentCircuits[circuitCode].AgentID;
|
||||||
AgentCircuits.Remove(circuitCode);
|
AgentCircuits.Remove(circuitCode);
|
||||||
|
AgentCircuitsByUUID.Remove(agentID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void RemoveCircuit(UUID agentID)
|
||||||
|
{
|
||||||
|
lock (AgentCircuits)
|
||||||
|
{
|
||||||
|
if (AgentCircuitsByUUID.ContainsKey(agentID))
|
||||||
|
{
|
||||||
|
uint circuitCode = AgentCircuitsByUUID[agentID].circuitcode;
|
||||||
|
AgentCircuits.Remove(circuitCode);
|
||||||
|
AgentCircuitsByUUID.Remove(agentID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
public AgentCircuitData GetAgentCircuitData(uint circuitCode)
|
public AgentCircuitData GetAgentCircuitData(uint circuitCode)
|
||||||
{
|
{
|
||||||
AgentCircuitData agentCircuit = null;
|
AgentCircuitData agentCircuit = null;
|
||||||
|
@ -110,6 +129,13 @@ namespace OpenSim.Framework
|
||||||
return agentCircuit;
|
return agentCircuit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AgentCircuitData GetAgentCircuitData(UUID agentID)
|
||||||
|
{
|
||||||
|
AgentCircuitData agentCircuit = null;
|
||||||
|
AgentCircuitsByUUID.TryGetValue(agentID, out agentCircuit);
|
||||||
|
return agentCircuit;
|
||||||
|
}
|
||||||
|
|
||||||
public void UpdateAgentData(AgentCircuitData agentData)
|
public void UpdateAgentData(AgentCircuitData agentData)
|
||||||
{
|
{
|
||||||
if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
|
if (AgentCircuits.ContainsKey((uint) agentData.circuitcode))
|
||||||
|
|
|
@ -99,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
|
||||||
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
|
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
|
||||||
|
|
||||||
//private string eventQueue = "0100/";
|
//private string eventQueue = "0100/";
|
||||||
|
private IScene m_Scene;
|
||||||
private IHttpServer m_httpListener;
|
private IHttpServer m_httpListener;
|
||||||
private UUID m_agentID;
|
private UUID m_agentID;
|
||||||
private IAssetService m_assetCache;
|
private IAssetService m_assetCache;
|
||||||
|
@ -130,9 +131,10 @@ namespace OpenSim.Framework.Capabilities
|
||||||
public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
|
public FetchInventoryDescendentsCAPS CAPSFetchInventoryDescendents = null;
|
||||||
public GetClientDelegate GetClient = null;
|
public GetClientDelegate GetClient = null;
|
||||||
|
|
||||||
public Caps(IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
|
public Caps(IScene scene, IAssetService assetCache, IHttpServer httpServer, string httpListen, uint httpPort, string capsPath,
|
||||||
UUID agent, bool dumpAssetsToFile, string regionName)
|
UUID agent, bool dumpAssetsToFile, string regionName)
|
||||||
{
|
{
|
||||||
|
m_Scene = scene;
|
||||||
m_assetCache = assetCache;
|
m_assetCache = assetCache;
|
||||||
m_capsObjectPath = capsPath;
|
m_capsObjectPath = capsPath;
|
||||||
m_httpListener = httpServer;
|
m_httpListener = httpServer;
|
||||||
|
@ -278,7 +280,13 @@ namespace OpenSim.Framework.Capabilities
|
||||||
public string CapsRequest(string request, string path, string param,
|
public string CapsRequest(string request, string path, string param,
|
||||||
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
OSHttpRequest httpRequest, OSHttpResponse httpResponse)
|
||||||
{
|
{
|
||||||
//m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
|
||||||
|
|
||||||
|
if (!m_Scene.CheckClient(m_agentID, httpRequest.RemoteIPEndPoint))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[CAPS]: Unauthorized CAPS client");
|
||||||
|
return string.Empty;
|
||||||
|
}
|
||||||
|
|
||||||
string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
|
string result = LLSDHelpers.SerialiseLLSDReply(m_capsHandlers.CapsDetails);
|
||||||
|
|
||||||
|
|
|
@ -102,5 +102,7 @@ namespace OpenSim.Framework
|
||||||
void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
|
void AddCommand(object module, string command, string shorthelp, string longhelp, CommandDelegate callback);
|
||||||
|
|
||||||
ISceneObject DeserializeObject(string representation);
|
ISceneObject DeserializeObject(string representation);
|
||||||
|
|
||||||
|
bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) Contributors, http://opensimulator.org/
|
|
||||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
|
||||||
*
|
|
||||||
* Redistribution and use in source and binary forms, with or without
|
|
||||||
* modification, are permitted provided that the following conditions are met:
|
|
||||||
* * Redistributions of source code must retain the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer.
|
|
||||||
* * Redistributions in binary form must reproduce the above copyright
|
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
|
||||||
* documentation and/or other materials provided with the distribution.
|
|
||||||
* * Neither the name of the OpenSimulator Project nor the
|
|
||||||
* names of its contributors may be used to endorse or promote products
|
|
||||||
* derived from this software without specific prior written permission.
|
|
||||||
*
|
|
||||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
|
||||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
|
||||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
* 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
|
|
||||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace OpenSim.Framework.Servers
|
|
||||||
{
|
|
||||||
public class MessageServerInfo
|
|
||||||
{
|
|
||||||
public string URI;
|
|
||||||
public string sendkey;
|
|
||||||
public string recvkey;
|
|
||||||
public List<ulong> responsibleForRegions;
|
|
||||||
|
|
||||||
public MessageServerInfo()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return URI;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -105,7 +105,7 @@ namespace OpenSim
|
||||||
|
|
||||||
// Check if the system is compatible with OpenSimulator.
|
// Check if the system is compatible with OpenSimulator.
|
||||||
// Ensures that the minimum system requirements are met
|
// Ensures that the minimum system requirements are met
|
||||||
m_log.Info("Performing compatibility checks... ");
|
m_log.Info("Performing compatibility checks... \n");
|
||||||
string supported = String.Empty;
|
string supported = String.Empty;
|
||||||
if (Util.IsEnvironmentSupported(ref supported))
|
if (Util.IsEnvironmentSupported(ref supported))
|
||||||
{
|
{
|
||||||
|
@ -120,6 +120,113 @@ namespace OpenSim
|
||||||
Culture.SetCurrentCulture();
|
Culture.SetCurrentCulture();
|
||||||
|
|
||||||
|
|
||||||
|
// Validate that the user has the most basic configuration done
|
||||||
|
// If not, offer to do the most basic configuration for them warning them along the way of the importance of
|
||||||
|
// reading these files.
|
||||||
|
/*
|
||||||
|
m_log.Info("Checking for reguired configuration...\n");
|
||||||
|
|
||||||
|
bool OpenSim_Ini = (File.Exists(Path.Combine(Util.configDir(), "OpenSim.ini")))
|
||||||
|
|| (File.Exists(Path.Combine(Util.configDir(), "opensim.ini")))
|
||||||
|
|| (File.Exists(Path.Combine(Util.configDir(), "openSim.ini")))
|
||||||
|
|| (File.Exists(Path.Combine(Util.configDir(), "Opensim.ini")));
|
||||||
|
|
||||||
|
bool StanaloneCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
|
||||||
|
bool StanaloneCommon_lowercased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "standalonecommon.ini"));
|
||||||
|
bool GridCommon_ProperCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "GridCommon.ini"));
|
||||||
|
bool GridCommon_lowerCased = File.Exists(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "gridcommon.ini"));
|
||||||
|
|
||||||
|
if ((OpenSim_Ini)
|
||||||
|
&& (
|
||||||
|
(StanaloneCommon_ProperCased
|
||||||
|
|| StanaloneCommon_lowercased
|
||||||
|
|| GridCommon_ProperCased
|
||||||
|
|| GridCommon_lowerCased
|
||||||
|
)))
|
||||||
|
{
|
||||||
|
m_log.Info("Required Configuration Files Found\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MainConsole.Instance = new LocalConsole("Region");
|
||||||
|
string resp = MainConsole.Instance.CmdPrompt(
|
||||||
|
"\n\n*************Required Configuration files not found.*************\n\n OpenSimulator will not run without these files.\n\nRemember, these file names are Case Sensitive in Linux and Proper Cased.\n1. ./OpenSim.ini\nand\n2. ./config-include/StandaloneCommon.ini \nor\n3. ./config-include/GridCommon.ini\n\nAlso, you will want to examine these files in great detail because only the basic system will load by default. OpenSimulator can do a LOT more if you spend a little time going through these files.\n\n" + ": " + "Do you want to copy the most basic Defaults from standalone?",
|
||||||
|
"yes");
|
||||||
|
if (resp == "yes")
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!(OpenSim_Ini))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Copy(Path.Combine(Util.configDir(), "OpenSim.ini.example"),
|
||||||
|
Path.Combine(Util.configDir(), "OpenSim.ini"));
|
||||||
|
} catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, Make sure OpenSim has have the required permissions\n");
|
||||||
|
} catch (ArgumentException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
|
||||||
|
} catch (System.IO.PathTooLongException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the Path to these files is too long.\n");
|
||||||
|
} catch (System.IO.DirectoryNotFoundException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the current directory is reporting as not found.\n");
|
||||||
|
} catch (System.IO.FileNotFoundException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
|
||||||
|
} catch (System.IO.IOException)
|
||||||
|
{
|
||||||
|
// Destination file exists already or a hard drive failure... .. so we can just drop this one
|
||||||
|
//MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
|
||||||
|
} catch (System.NotSupportedException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, The current directory is invalid.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (!(StanaloneCommon_ProperCased || StanaloneCommon_lowercased))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.Copy(Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini.example"),
|
||||||
|
Path.Combine(Path.Combine(Util.configDir(), "config-include"), "StandaloneCommon.ini"));
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, Make sure OpenSim has the required permissions\n");
|
||||||
|
}
|
||||||
|
catch (ArgumentException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
|
||||||
|
}
|
||||||
|
catch (System.IO.PathTooLongException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the Path to these files is too long.\n");
|
||||||
|
}
|
||||||
|
catch (System.IO.DirectoryNotFoundException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the current directory is reporting as not found.\n");
|
||||||
|
}
|
||||||
|
catch (System.IO.FileNotFoundException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, the example is not found, please make sure that the example files exist.\n");
|
||||||
|
}
|
||||||
|
catch (System.IO.IOException)
|
||||||
|
{
|
||||||
|
// Destination file exists already or a hard drive failure... .. so we can just drop this one
|
||||||
|
//MainConsole.Instance.Output("Unable to Copy OpenSim.ini.example to OpenSim.ini, the example is not found, please make sure that the example files exist.\n");
|
||||||
|
}
|
||||||
|
catch (System.NotSupportedException)
|
||||||
|
{
|
||||||
|
MainConsole.Instance.Output("Unable to Copy StandaloneCommon.ini.example to StandaloneCommon.ini, The current directory is invalid.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MainConsole.Instance = null;
|
||||||
|
}
|
||||||
|
*/
|
||||||
configSource.Alias.AddAlias("On", true);
|
configSource.Alias.AddAlias("On", true);
|
||||||
configSource.Alias.AddAlias("Off", false);
|
configSource.Alias.AddAlias("Off", false);
|
||||||
configSource.Alias.AddAlias("True", true);
|
configSource.Alias.AddAlias("True", true);
|
||||||
|
@ -145,6 +252,8 @@ namespace OpenSim
|
||||||
// load Crash directory config
|
// load Crash directory config
|
||||||
m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
|
m_crashDir = configSource.Configs["Startup"].GetString("crash_dir", m_crashDir);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (background)
|
if (background)
|
||||||
{
|
{
|
||||||
m_sim = new OpenSimBackground(configSource);
|
m_sim = new OpenSimBackground(configSource);
|
||||||
|
@ -152,8 +261,14 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_sim = new OpenSim(configSource);
|
m_sim = new OpenSim(configSource);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_sim.Startup();
|
m_sim.Startup();
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
|
|
@ -107,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities
|
||||||
}
|
}
|
||||||
|
|
||||||
Caps caps
|
Caps caps
|
||||||
= new Caps(
|
= 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.Port,
|
||||||
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
|
capsObjectPath, agentId, m_scene.DumpAssetsToFile, m_scene.RegionInfo.RegionName);
|
||||||
|
|
|
@ -286,6 +286,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||||
fromName = avatar.Name;
|
fromName = avatar.Name;
|
||||||
sourceType = ChatSourceType.Agent;
|
sourceType = ChatSourceType.Agent;
|
||||||
}
|
}
|
||||||
|
else if (c.SenderUUID != UUID.Zero)
|
||||||
|
{
|
||||||
|
fromID = c.SenderUUID;
|
||||||
|
}
|
||||||
|
|
||||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||||
if (c.Scene != null)
|
if (c.Scene != null)
|
||||||
|
|
|
@ -144,9 +144,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Combat.CombatModule
|
||||||
|
|
||||||
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
|
private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
|
||||||
{
|
{
|
||||||
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
ILandObject obj = avatar.Scene.LandChannel.GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y);
|
||||||
|
|
||||||
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
|
if ((obj.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0)
|
||||||
{
|
{
|
||||||
avatar.Invulnerable = false;
|
avatar.Invulnerable = false;
|
||||||
|
|
|
@ -2657,17 +2657,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
||||||
|
|
||||||
// Do the verification here
|
// Do the verification here
|
||||||
System.Net.EndPoint ep = client.GetClientEP();
|
System.Net.IPEndPoint ep = (System.Net.IPEndPoint)client.GetClientEP();
|
||||||
if (aCircuit != null)
|
if (aCircuit != null)
|
||||||
{
|
{
|
||||||
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
|
if (!VerifyClient(aCircuit, ep, out vialogin))
|
||||||
{
|
|
||||||
m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
|
||||||
vialogin = true;
|
|
||||||
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
|
|
||||||
if (userVerification != null && ep != null)
|
|
||||||
{
|
|
||||||
if (!userVerification.VerifyClient(aCircuit, ep.ToString()))
|
|
||||||
{
|
{
|
||||||
// uh-oh, this is fishy
|
// uh-oh, this is fishy
|
||||||
m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
|
m_log.WarnFormat("[Scene]: Agent {0} with session {1} connecting with unidentified end point {2}. Refusing service.",
|
||||||
|
@ -2682,10 +2675,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} returned true", aCircuit.firstname, aCircuit.lastname);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
|
m_log.Debug("[Scene] Adding new agent " + client.Name + " to scene " + RegionInfo.RegionName);
|
||||||
|
@ -2710,7 +2699,65 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
EventManager.TriggerOnClientLogin(client);
|
EventManager.TriggerOnClientLogin(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool VerifyClient(AgentCircuitData aCircuit, System.Net.IPEndPoint ep, out bool vialogin)
|
||||||
|
{
|
||||||
|
vialogin = false;
|
||||||
|
|
||||||
|
// Do the verification here
|
||||||
|
if ((aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[Scene]: Incoming client {0} {1} in region {2} via Login", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||||
|
vialogin = true;
|
||||||
|
IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>();
|
||||||
|
if (userVerification != null && ep != null)
|
||||||
|
{
|
||||||
|
if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString()))
|
||||||
|
{
|
||||||
|
// 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);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned true", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Called by Caps, on the first HTTP contact from the client
|
||||||
|
public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
|
||||||
|
{
|
||||||
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(agentID);
|
||||||
|
if (aCircuit != null)
|
||||||
|
{
|
||||||
|
bool vialogin = false;
|
||||||
|
if (!VerifyClient(aCircuit, ep, out vialogin))
|
||||||
|
{
|
||||||
|
// if it doesn't pass, we remove the agentcircuitdata altogether
|
||||||
|
// and the scene presence and the client, if they exist
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ScenePresence sp = GetScenePresence(agentID);
|
||||||
|
if (sp != null)
|
||||||
|
sp.ControllingClient.Close();
|
||||||
|
|
||||||
|
// BANG! SLASH!
|
||||||
|
m_authenticateHandler.RemoveCircuit(agentID);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[Scene]: Exception while closing aborted client: {0}", e.StackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Register for events from the client
|
/// Register for events from the client
|
||||||
|
|
|
@ -536,5 +536,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return false; }
|
get { return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract bool CheckClient(UUID agentID, System.Net.IPEndPoint ep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,6 +70,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep)
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
|
|
@ -204,6 +204,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
|
||||||
return args;
|
return args;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetClientToken(UUID sessionID, string token)
|
||||||
|
{
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
|
public GridRegion GetHomeRegion(UUID userID, out Vector3 position, out Vector3 lookAt)
|
||||||
{
|
{
|
||||||
position = Vector3.UnitY; lookAt = Vector3.UnitY;
|
position = Vector3.UnitY; lookAt = Vector3.UnitY;
|
||||||
|
|
|
@ -148,6 +148,15 @@ namespace OpenSim.Services.HypergridService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetClientToken(UUID sessionID, string token)
|
||||||
|
{
|
||||||
|
if (m_TravelingAgents.ContainsKey(sessionID))
|
||||||
|
{
|
||||||
|
m_log.DebugFormat("[USER AGENT SERVICE]: Setting token {0} for session {1}", token, sessionID);
|
||||||
|
m_TravelingAgents[sessionID].ClientToken = token;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region)
|
TravelingAgentInfo UpdateTravelInfo(AgentCircuitData agentCircuit, GridRegion region)
|
||||||
{
|
{
|
||||||
TravelingAgentInfo travel = new TravelingAgentInfo();
|
TravelingAgentInfo travel = new TravelingAgentInfo();
|
||||||
|
@ -203,22 +212,16 @@ namespace OpenSim.Services.HypergridService
|
||||||
|
|
||||||
public bool VerifyClient(UUID sessionID, string token)
|
public bool VerifyClient(UUID sessionID, string token)
|
||||||
{
|
{
|
||||||
return true;
|
m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token);
|
||||||
|
//return true;
|
||||||
|
|
||||||
// Commenting this for now until I understand better what part of a sender's
|
// Commenting this for now until I understand better what part of a sender's
|
||||||
// info stays unchanged throughout a session
|
// info stays unchanged throughout a session
|
||||||
//
|
|
||||||
//if (m_TravelingAgents.ContainsKey(sessionID))
|
if (m_TravelingAgents.ContainsKey(sessionID))
|
||||||
//{
|
return m_TravelingAgents[sessionID].ClientToken == token;
|
||||||
// // Aquiles heel. Must trust the first grid upon login
|
|
||||||
// if (m_TravelingAgents[sessionID].ClientToken == string.Empty)
|
return false;
|
||||||
// {
|
|
||||||
// m_TravelingAgents[sessionID].ClientToken = token;
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// return m_TravelingAgents[sessionID].ClientToken == token;
|
|
||||||
//}
|
|
||||||
//return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool VerifyAgent(UUID sessionID, string token)
|
public bool VerifyAgent(UUID sessionID, string token)
|
||||||
|
|
|
@ -49,6 +49,7 @@ namespace OpenSim.Services.Interfaces
|
||||||
public interface IUserAgentService
|
public interface IUserAgentService
|
||||||
{
|
{
|
||||||
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);
|
||||||
|
|
||||||
|
|
|
@ -58,21 +58,21 @@ namespace OpenSim.Services.LLLoginService
|
||||||
protected IInventoryService m_InventoryService;
|
protected IInventoryService m_InventoryService;
|
||||||
protected IGridService m_GridService;
|
protected IGridService m_GridService;
|
||||||
protected IPresenceService m_PresenceService;
|
protected IPresenceService m_PresenceService;
|
||||||
private ISimulationService m_LocalSimulationService;
|
protected ISimulationService m_LocalSimulationService;
|
||||||
private ISimulationService m_RemoteSimulationService;
|
protected ISimulationService m_RemoteSimulationService;
|
||||||
protected ILibraryService m_LibraryService;
|
protected ILibraryService m_LibraryService;
|
||||||
protected IFriendsService m_FriendsService;
|
protected IFriendsService m_FriendsService;
|
||||||
protected IAvatarService m_AvatarService;
|
protected IAvatarService m_AvatarService;
|
||||||
private IUserAgentService m_UserAgentService;
|
protected IUserAgentService m_UserAgentService;
|
||||||
|
|
||||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
protected GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
|
|
||||||
private string m_DefaultRegionName;
|
protected string m_DefaultRegionName;
|
||||||
protected string m_WelcomeMessage;
|
protected string m_WelcomeMessage;
|
||||||
private bool m_RequireInventory;
|
protected bool m_RequireInventory;
|
||||||
protected int m_MinLoginLevel;
|
protected int m_MinLoginLevel;
|
||||||
private string m_GatekeeperURL;
|
protected string m_GatekeeperURL;
|
||||||
private bool m_AllowRemoteSetLoginLevel;
|
protected bool m_AllowRemoteSetLoginLevel;
|
||||||
|
|
||||||
IConfig m_LoginServerConfig;
|
IConfig m_LoginServerConfig;
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
// Instantiate/get the simulation interface and launch an agent at the destination
|
// Instantiate/get the simulation interface and launch an agent at the destination
|
||||||
//
|
//
|
||||||
string reason = string.Empty;
|
string reason = string.Empty;
|
||||||
AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, out where, out reason);
|
AgentCircuitData aCircuit = LaunchAgentAtGrid(gatekeeper, destination, account, avatar, session, secureSession, position, where, clientVersion, clientIP, out where, out reason);
|
||||||
|
|
||||||
if (aCircuit == null)
|
if (aCircuit == null)
|
||||||
{
|
{
|
||||||
|
@ -595,7 +595,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
}
|
}
|
||||||
|
|
||||||
protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
|
protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar,
|
||||||
UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, out string where, out string reason)
|
UUID session, UUID secureSession, Vector3 position, string currentWhere, string viewer, IPEndPoint clientIP, out string where, out string reason)
|
||||||
{
|
{
|
||||||
where = currentWhere;
|
where = currentWhere;
|
||||||
ISimulationService simConnector = null;
|
ISimulationService simConnector = null;
|
||||||
|
@ -661,7 +661,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
{
|
{
|
||||||
circuitCode = (uint)Util.RandomClass.Next(); ;
|
circuitCode = (uint)Util.RandomClass.Next(); ;
|
||||||
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer);
|
aCircuit = MakeAgent(destination, account, avatar, session, secureSession, circuitCode, position, viewer);
|
||||||
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, out reason);
|
success = LaunchAgentIndirectly(gatekeeper, destination, aCircuit, clientIP, out reason);
|
||||||
if (!success && m_GridService != null)
|
if (!success && m_GridService != null)
|
||||||
{
|
{
|
||||||
// Try the fallback regions
|
// Try the fallback regions
|
||||||
|
@ -670,7 +670,7 @@ namespace OpenSim.Services.LLLoginService
|
||||||
{
|
{
|
||||||
foreach (GridRegion r in fallbacks)
|
foreach (GridRegion r in fallbacks)
|
||||||
{
|
{
|
||||||
success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, out reason);
|
success = LaunchAgentIndirectly(gatekeeper, r, aCircuit, clientIP, out reason);
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
where = "safe";
|
where = "safe";
|
||||||
|
@ -747,10 +747,18 @@ namespace OpenSim.Services.LLLoginService
|
||||||
return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason);
|
return simConnector.CreateAgent(region, aCircuit, (int)Constants.TeleportFlags.ViaLogin, out reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool LaunchAgentIndirectly(GridRegion gatekeeper, GridRegion destination, AgentCircuitData aCircuit, 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);
|
||||||
return m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason);
|
if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason))
|
||||||
|
{
|
||||||
|
// We may need to do this at some point,
|
||||||
|
// so leaving it here in comments.
|
||||||
|
//IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address);
|
||||||
|
m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Console Commands
|
#region Console Commands
|
||||||
|
|
|
@ -87,9 +87,6 @@
|
||||||
; YOU HAVE BEEN WARNED!!!
|
; YOU HAVE BEEN WARNED!!!
|
||||||
TrustBinaries = false
|
TrustBinaries = false
|
||||||
|
|
||||||
; How many prims to send to each avatar in the scene on each Update()
|
|
||||||
; MaxPrimsPerFrame = 200
|
|
||||||
|
|
||||||
; Combine all contiguous regions into one large region
|
; Combine all contiguous regions into one large region
|
||||||
; Order your regions from South to North, West to East in your regions.ini and then set this to true
|
; Order your regions from South to North, West to East in your regions.ini and then set this to true
|
||||||
; Warning! Don't use this with regions that have existing content!, This will likely break them
|
; Warning! Don't use this with regions that have existing content!, This will likely break them
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
|
|
||||||
[AvatarService]
|
[AvatarService]
|
||||||
LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService"
|
LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService"
|
||||||
ConnectionString = "URI=file:avatars.db,version=3"
|
|
||||||
|
|
||||||
[LibraryService]
|
[LibraryService]
|
||||||
LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"
|
LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"
|
||||||
|
@ -54,7 +53,6 @@
|
||||||
|
|
||||||
[AuthenticationService]
|
[AuthenticationService]
|
||||||
LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
|
LocalServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
|
||||||
ConnectionString = "URI=file:auth.db,version=3"
|
|
||||||
|
|
||||||
[GridService]
|
[GridService]
|
||||||
; LocalGridServicesConnector needs this
|
; LocalGridServicesConnector needs this
|
||||||
|
@ -82,7 +80,6 @@
|
||||||
|
|
||||||
[FriendsService]
|
[FriendsService]
|
||||||
LocalServiceModule = "OpenSim.Services.FriendsService.dll"
|
LocalServiceModule = "OpenSim.Services.FriendsService.dll"
|
||||||
ConnectionString = "URI=file:friends.db,version=3"
|
|
||||||
|
|
||||||
[Friends]
|
[Friends]
|
||||||
Connector = "OpenSim.Services.FriendsService.dll"
|
Connector = "OpenSim.Services.FriendsService.dll"
|
||||||
|
|
Loading…
Reference in New Issue