* Apply a modified version of the part of http://opensimulator.org/mantis/view.php?id=2361 that allows region registration to be enabled/disabled on the grid server
* Region registration is enabled by default in the configuration unless the user chooses otherwise * On the console * show status - shows grid status * enable-reg - enables region registration to the grid * disable-reg - disables region registration * Enabling or disabling region registration will not affect any other grid functions or regions already on the grid0.6.0-stable
parent
3d26ff209d
commit
97f4226666
|
@ -290,7 +290,7 @@ namespace OpenSim.Framework
|
|||
l_EstateManagers.Clear();
|
||||
configMember.performConfigurationRetrieve();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ namespace OpenSim.Framework
|
|||
public static uint DefaultHttpPort = 8001;
|
||||
|
||||
public string AllowForcefulBanlines = "TRUE";
|
||||
public bool AllowRegionRegistration = true;
|
||||
public string AssetRecvKey = String.Empty;
|
||||
public string AssetSendKey = String.Empty;
|
||||
|
||||
|
@ -91,6 +92,12 @@ namespace OpenSim.Framework
|
|||
configMember.addConfigurationOption("allow_forceful_banlines",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
|
||||
"Allow Forceful Banlines", "TRUE", true);
|
||||
|
||||
configMember.addConfigurationOption("allow_region_registration",
|
||||
ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
|
||||
"Allow regions to register immediately upon grid server startup? true/false",
|
||||
"True",
|
||||
false);
|
||||
}
|
||||
|
||||
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
|
||||
|
@ -133,6 +140,9 @@ namespace OpenSim.Framework
|
|||
case "allow_forceful_banlines":
|
||||
AllowForcefulBanlines = (string) configuration_result;
|
||||
break;
|
||||
case "allow_region_registration":
|
||||
AllowRegionRegistration = (bool)configuration_result;
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace OpenSim.Framework
|
|||
{
|
||||
private static readonly PacketPool instance = new PacketPool();
|
||||
|
||||
private const bool packetPoolEnabled = false;
|
||||
private bool packetPoolEnabled = false;
|
||||
|
||||
private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>();
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace OpenSim.Framework
|
|||
configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true);
|
||||
configMember.performConfigurationRetrieve();
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -378,6 +378,15 @@ namespace OpenSim.Grid.GridServer
|
|||
return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString());
|
||||
}
|
||||
|
||||
if (!Config.AllowRegionRegistration)
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[LOGIN END]: Disabled region registration blocked login request from simulator: {0}",
|
||||
sim.regionName);
|
||||
|
||||
return ErrorResponse("The grid is currently not accepting region registrations.");
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
|
||||
|
||||
existingSim = GetRegion(sim.regionHandle);
|
||||
|
@ -1206,6 +1215,20 @@ namespace OpenSim.Grid.GridServer
|
|||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Construct an XMLRPC registration disabled response
|
||||
/// </summary>
|
||||
/// <param name="error"></param>
|
||||
/// <returns></returns>
|
||||
public static XmlRpcResponse XmlRPCRegionRegistrationDisabledResponse(string error)
|
||||
{
|
||||
XmlRpcResponse errorResponse = new XmlRpcResponse();
|
||||
Hashtable errorResponseData = new Hashtable();
|
||||
errorResponse.Value = errorResponseData;
|
||||
errorResponseData["restricted"] = error;
|
||||
return errorResponse;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -63,16 +63,43 @@ namespace OpenSim.Grid.GridServer
|
|||
MainConsole.Instance = m_console;
|
||||
}
|
||||
|
||||
public void managercallback(string cmd)
|
||||
public override void RunCmd(string cmd, string[] cmdparams)
|
||||
{
|
||||
base.RunCmd(cmd, cmdparams);
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case "shutdown":
|
||||
RunCmd("shutdown", new string[0]);
|
||||
case "disable-reg":
|
||||
m_config.AllowRegionRegistration = false;
|
||||
m_log.Info("Region registration disabled");
|
||||
break;
|
||||
case "enable-reg":
|
||||
m_config.AllowRegionRegistration = true;
|
||||
m_log.Info("Region registration enabled");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Show(string[] showParams)
|
||||
{
|
||||
base.Show(showParams);
|
||||
|
||||
switch (showParams[0])
|
||||
{
|
||||
case "status":
|
||||
if (m_config.AllowRegionRegistration)
|
||||
{
|
||||
m_log.Info("Region registration enabled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("Region registration disabled.");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void StartupSpecific()
|
||||
{
|
||||
m_config = new GridConfig("GRID SERVER", (Path.Combine(Util.configDir(), "GridServer_Config.xml")));
|
||||
|
|
Loading…
Reference in New Issue