From: dirk husemann <hud@zurich.ibm.com>
attached is a patch set that * adds further robustness checks for the CreateUser and CreateRegion XmlRpc * fixes SceneManager.TryGetScene(IPEndPoint, Scene) --- contrary to my expectation IPEndPoint.Address is not sufficient for a comparision, IPEndPoint.Address.Address (the long representation) does work however. * add [RemoteAdmin] section to OpenSim.ini.example * fixes XML doc comments good night, dirk0.6.0-stable
parent
06d05bd339
commit
62d02e079e
|
@ -234,6 +234,29 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
m_app.Shutdown();
|
m_app.Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void checkStringParameters(XmlRpcRequest request, string[] param)
|
||||||
|
{
|
||||||
|
Hashtable requestData = (Hashtable) request.Params[0];
|
||||||
|
foreach (string p in param)
|
||||||
|
{
|
||||||
|
if (!requestData.Contains(p))
|
||||||
|
throw new Exception(String.Format("missing string parameter {0}", p));
|
||||||
|
if (String.IsNullOrEmpty((string)requestData[p]))
|
||||||
|
throw new Exception(String.Format("parameter {0} is empty", p));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkIntegerParams(XmlRpcRequest request, string[] param)
|
||||||
|
{
|
||||||
|
Hashtable requestData = (Hashtable) request.Params[0];
|
||||||
|
foreach (string p in param)
|
||||||
|
{
|
||||||
|
if (!requestData.Contains(p))
|
||||||
|
throw new Exception(String.Format("missing integer parameter {0}", p));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create a new region.
|
/// Create a new region.
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -250,21 +273,24 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
/// <item><term>region_id</term>
|
/// <item><term>region_id</term>
|
||||||
/// <description>(optional) desired region UUID</description></item>
|
/// <description>(optional) desired region UUID</description></item>
|
||||||
/// <item><term>region_x</term>
|
/// <item><term>region_x</term>
|
||||||
/// <description>desired region X coordinate</description></item>
|
/// <description>desired region X coordinate (integer)</description></item>
|
||||||
/// <item><term>region_y</term>
|
/// <item><term>region_y</term>
|
||||||
/// <description>desired region Y coordinate</description></item>
|
/// <description>desired region Y coordinate (integer)</description></item>
|
||||||
/// <item><term>region_master_first</term>
|
/// <item><term>region_master_first</term>
|
||||||
/// <description>firstname of region master</description></item>
|
/// <description>firstname of region master</description></item>
|
||||||
/// <item><term>region_master_last</term>
|
/// <item><term>region_master_last</term>
|
||||||
/// <description>lastname of region master</description></item>
|
/// <description>lastname of region master</description></item>
|
||||||
/// <item><term>listen_ip</term>
|
/// <item><term>listen_ip</term>
|
||||||
/// <description>internal IP address</description></item>
|
/// <description>internal IP address (dotted quad)</description></item>
|
||||||
/// <item><term>listen_port</term>
|
/// <item><term>listen_port</term>
|
||||||
/// <description>internal port</description></item>
|
/// <description>internal port (integer)</description></item>
|
||||||
/// <item><term>external_address</term>
|
/// <item><term>external_address</term>
|
||||||
/// <description>external IP address</description></item>
|
/// <description>external IP address</description></item>
|
||||||
/// <item><term>datastore</term>
|
/// <item><term>datastore</term>
|
||||||
/// <description>datastore parameter (?)</description></item>
|
/// <description>datastore parameter (?)</description></item>
|
||||||
|
/// <item><term>persist</term>
|
||||||
|
/// <description>if true, persist the region info
|
||||||
|
/// ('true' or 'false')</description></item>
|
||||||
/// </list>
|
/// </list>
|
||||||
///
|
///
|
||||||
/// XmlRpcCreateRegionMethod returns
|
/// XmlRpcCreateRegionMethod returns
|
||||||
|
@ -288,16 +314,12 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
Hashtable responseData = new Hashtable();
|
Hashtable responseData = new Hashtable();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// check completeness
|
checkStringParameters(request, new string[] { "password",
|
||||||
foreach (string p in new string[] { "password",
|
"region_name",
|
||||||
"region_name", "region_x", "region_y",
|
|
||||||
"region_master_first", "region_master_last",
|
"region_master_first", "region_master_last",
|
||||||
"region_master_password",
|
"region_master_password",
|
||||||
"listen_ip", "listen_port", "external_address"})
|
"listen_ip", "external_address"});
|
||||||
{
|
checkIntegerParams(request, new string[] { "region_x", "region_y", "listen_port"});
|
||||||
if (!requestData.Contains(p))
|
|
||||||
throw new Exception(String.Format("missing parameter {0}", p));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check password
|
// check password
|
||||||
if (!String.IsNullOrEmpty(requiredPassword) &&
|
if (!String.IsNullOrEmpty(requiredPassword) &&
|
||||||
|
@ -350,6 +372,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
new IPEndPoint(IPAddress.Parse((string) requestData["listen_ip"]), 0);
|
new IPEndPoint(IPAddress.Parse((string) requestData["listen_ip"]), 0);
|
||||||
|
|
||||||
region.InternalEndPoint.Port = (Int32) requestData["listen_port"];
|
region.InternalEndPoint.Port = (Int32) requestData["listen_port"];
|
||||||
|
if (0 == region.InternalEndPoint.Port) throw new Exception("listen_port is 0");
|
||||||
if (m_app.SceneManager.TryGetScene(region.InternalEndPoint, out scene))
|
if (m_app.SceneManager.TryGetScene(region.InternalEndPoint, out scene))
|
||||||
throw new Exception(String.Format("region internal IP {0} and port {1} already in use by region {2}, UUID {3}, <{4},{5}>",
|
throw new Exception(String.Format("region internal IP {0} and port {1} already in use by region {2}, UUID {3}, <{4},{5}>",
|
||||||
region.InternalEndPoint.Address,
|
region.InternalEndPoint.Address,
|
||||||
|
@ -445,13 +468,9 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// check completeness
|
// check completeness
|
||||||
foreach (string p in new string[] { "password",
|
checkStringParameters(request, new string[] { "password", "user_firstname",
|
||||||
"user_firstname", "user_lastname", "user_password",
|
"user_lastname", "user_password" });
|
||||||
"start_region_x", "start_region_y" })
|
checkIntegerParams(request, new string[] { "start_region_x", "start_region_y" });
|
||||||
{
|
|
||||||
if (!requestData.Contains(p))
|
|
||||||
throw new Exception(String.Format("missing parameter {0}", p));
|
|
||||||
}
|
|
||||||
|
|
||||||
// check password
|
// check password
|
||||||
if (!String.IsNullOrEmpty(requiredPassword) &&
|
if (!String.IsNullOrEmpty(requiredPassword) &&
|
||||||
|
|
|
@ -297,8 +297,10 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
foreach (Scene mscene in m_localScenes)
|
foreach (Scene mscene in m_localScenes)
|
||||||
{
|
{
|
||||||
if (mscene.RegionInfo.InternalEndPoint.Address == ipEndPoint.Address &&
|
// .NET WEIRDNESS ALERT: need to compare the long
|
||||||
mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port)
|
// values of address...
|
||||||
|
if ((mscene.RegionInfo.InternalEndPoint.Address.Address == ipEndPoint.Address.Address) &&
|
||||||
|
(mscene.RegionInfo.InternalEndPoint.Port == ipEndPoint.Port))
|
||||||
{
|
{
|
||||||
scene = mscene;
|
scene = mscene;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -141,6 +141,10 @@ whisper_distance = 10
|
||||||
say_distance = 30
|
say_distance = 30
|
||||||
shout_distance = 100
|
shout_distance = 100
|
||||||
|
|
||||||
|
[RemoteAdmin]
|
||||||
|
enabled = false
|
||||||
|
access_password = unknown
|
||||||
|
|
||||||
; Uncomment the following for IRC bridge
|
; Uncomment the following for IRC bridge
|
||||||
; experimental, so if it breaks... keep both parts... yada yada
|
; experimental, so if it breaks... keep both parts... yada yada
|
||||||
; also, not good error detection when it fails
|
; also, not good error detection when it fails
|
||||||
|
|
Loading…
Reference in New Issue