On login and first HG entrance to a foreign grid, perform query access checks before proceeding.
parent
3355bedaeb
commit
3c6becd524
|
@ -283,6 +283,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||
uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
|
||||
|
||||
if (theirversion != null)
|
||||
{
|
||||
float theirVersionNumber = 0f;
|
||||
string[] versionComponents = theirversion.Split(new char[] { '/' });
|
||||
if (versionComponents.Length >= 2)
|
||||
|
@ -295,6 +297,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
|||
reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
|
||||
m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber);
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason);
|
||||
|
|
|
@ -5514,6 +5514,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
int num = m_sceneGraph.GetRootAgentCount();
|
||||
|
||||
Console.WriteLine("{0} {1}", num, RegionInfo.RegionSettings.AgentLimit);
|
||||
if (num >= RegionInfo.RegionSettings.AgentLimit)
|
||||
{
|
||||
if (!Permissions.IsAdministrator(agentID))
|
||||
|
|
|
@ -432,6 +432,13 @@ namespace OpenSim.Services.HypergridService
|
|||
|
||||
m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag);
|
||||
|
||||
string version;
|
||||
|
||||
if (!m_SimulationService.QueryAccess(
|
||||
destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(),
|
||||
true, aCircuit.startpos, null, out version, out reason))
|
||||
return false;
|
||||
|
||||
return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,8 +85,10 @@ namespace OpenSim.Services.Interfaces
|
|||
/// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
|
||||
/// <param name="viaTeleport">True: via teleport; False: via cross (walking)</param>
|
||||
/// <param name="position">Position in the region</param>
|
||||
/// <param name="sversion">version that the requesting simulator is runing</param>
|
||||
/// <param name="version">version that the target simulator is running</param>
|
||||
/// <param name="sversion">
|
||||
/// Version that the requesting simulator is runing. If null then no version check is carried out.
|
||||
/// </param>
|
||||
/// <param name="version">Version that the target simulator is running</param>
|
||||
/// <param name="reason">[out] Optional error message</param>
|
||||
/// <returns>True: ok; False: not allowed</returns>
|
||||
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason);
|
||||
|
|
|
@ -959,12 +959,19 @@ namespace OpenSim.Services.LLLoginService
|
|||
|
||||
private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
|
||||
{
|
||||
string version;
|
||||
|
||||
if (!simConnector.QueryAccess(region, aCircuit.AgentID, null, true, aCircuit.startpos, null, out version, out reason))
|
||||
return false;
|
||||
|
||||
return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out 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);
|
||||
string version;
|
||||
|
||||
m_log.Debug("[LLOGIN SERVICE]: Launching agent at " + destination.RegionName);
|
||||
if (m_UserAgentService.LoginAgentToGrid(null, aCircuit, gatekeeper, destination, true, out reason))
|
||||
return true;
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue