aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-13 20:35:45 +0000
committerJustin Clarke Casey2008-10-13 20:35:45 +0000
commit97f4226666b5d3525999550e1362180be182cc87 (patch)
treeeb0a19c238f42bf34960f28f92c1c4c1b75aa374 /OpenSim
parentUpdate svn properties. (diff)
downloadopensim-SC_OLD-97f4226666b5d3525999550e1362180be182cc87.zip
opensim-SC_OLD-97f4226666b5d3525999550e1362180be182cc87.tar.gz
opensim-SC_OLD-97f4226666b5d3525999550e1362180be182cc87.tar.bz2
opensim-SC_OLD-97f4226666b5d3525999550e1362180be182cc87.tar.xz
* 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 grid
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/EstateSettings.cs2
-rw-r--r--OpenSim/Framework/GridConfig.cs12
-rw-r--r--OpenSim/Framework/PacketPool.cs2
-rw-r--r--OpenSim/Framework/RegionSettings.cs2
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs23
-rw-r--r--OpenSim/Grid/GridServer/GridServerBase.cs33
6 files changed, 67 insertions, 7 deletions
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index b7dccdb..f8595e0 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -290,7 +290,7 @@ namespace OpenSim.Framework
290 l_EstateManagers.Clear(); 290 l_EstateManagers.Clear();
291 configMember.performConfigurationRetrieve(); 291 configMember.performConfigurationRetrieve();
292 } 292 }
293 catch (Exception e) 293 catch (Exception)
294 { 294 {
295 } 295 }
296 } 296 }
diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs
index 889f345..52bc3d6 100644
--- a/OpenSim/Framework/GridConfig.cs
+++ b/OpenSim/Framework/GridConfig.cs
@@ -34,6 +34,7 @@ namespace OpenSim.Framework
34 public static uint DefaultHttpPort = 8001; 34 public static uint DefaultHttpPort = 8001;
35 35
36 public string AllowForcefulBanlines = "TRUE"; 36 public string AllowForcefulBanlines = "TRUE";
37 public bool AllowRegionRegistration = true;
37 public string AssetRecvKey = String.Empty; 38 public string AssetRecvKey = String.Empty;
38 public string AssetSendKey = String.Empty; 39 public string AssetSendKey = String.Empty;
39 40
@@ -90,7 +91,13 @@ namespace OpenSim.Framework
90 91
91 configMember.addConfigurationOption("allow_forceful_banlines", 92 configMember.addConfigurationOption("allow_forceful_banlines",
92 ConfigurationOption.ConfigurationTypes.TYPE_STRING, 93 ConfigurationOption.ConfigurationTypes.TYPE_STRING,
93 "Allow Forceful Banlines", "TRUE", true); 94 "Allow Forceful Banlines", "TRUE", true);
95
96 configMember.addConfigurationOption("allow_region_registration",
97 ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN,
98 "Allow regions to register immediately upon grid server startup? true/false",
99 "True",
100 false);
94 } 101 }
95 102
96 public bool handleIncomingConfiguration(string configuration_key, object configuration_result) 103 public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
@@ -133,6 +140,9 @@ namespace OpenSim.Framework
133 case "allow_forceful_banlines": 140 case "allow_forceful_banlines":
134 AllowForcefulBanlines = (string) configuration_result; 141 AllowForcefulBanlines = (string) configuration_result;
135 break; 142 break;
143 case "allow_region_registration":
144 AllowRegionRegistration = (bool)configuration_result;
145 break;
136 } 146 }
137 147
138 return true; 148 return true;
diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs
index 807403e..e24da42 100644
--- a/OpenSim/Framework/PacketPool.cs
+++ b/OpenSim/Framework/PacketPool.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Framework
36 { 36 {
37 private static readonly PacketPool instance = new PacketPool(); 37 private static readonly PacketPool instance = new PacketPool();
38 38
39 private const bool packetPoolEnabled = false; 39 private bool packetPoolEnabled = false;
40 40
41 private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>(); 41 private readonly Dictionary<PacketType, Stack<Packet>> pool = new Dictionary<PacketType, Stack<Packet>>();
42 42
diff --git a/OpenSim/Framework/RegionSettings.cs b/OpenSim/Framework/RegionSettings.cs
index 6281d6c..ba04513 100644
--- a/OpenSim/Framework/RegionSettings.cs
+++ b/OpenSim/Framework/RegionSettings.cs
@@ -50,7 +50,7 @@ namespace OpenSim.Framework
50 configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true); 50 configMember = new ConfigurationMember(Path.Combine(Util.configDir(), "estate_settings.xml"), "ESTATE SETTINGS", LoadConfigurationOptions, HandleIncomingConfiguration, true);
51 configMember.performConfigurationRetrieve(); 51 configMember.performConfigurationRetrieve();
52 } 52 }
53 catch (Exception e) 53 catch (Exception)
54 { 54 {
55 } 55 }
56 } 56 }
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index 1e8ac00..7739a55 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -377,6 +377,15 @@ namespace OpenSim.Grid.GridServer
377 m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); 377 m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
378 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); 378 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString());
379 } 379 }
380
381 if (!Config.AllowRegionRegistration)
382 {
383 m_log.InfoFormat(
384 "[LOGIN END]: Disabled region registration blocked login request from simulator: {0}",
385 sim.regionName);
386
387 return ErrorResponse("The grid is currently not accepting region registrations.");
388 }
380 389
381 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); 390 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
382 391
@@ -1206,6 +1215,20 @@ namespace OpenSim.Grid.GridServer
1206 } 1215 }
1207 return response; 1216 return response;
1208 } 1217 }
1218
1219 /// <summary>
1220 /// Construct an XMLRPC registration disabled response
1221 /// </summary>
1222 /// <param name="error"></param>
1223 /// <returns></returns>
1224 public static XmlRpcResponse XmlRPCRegionRegistrationDisabledResponse(string error)
1225 {
1226 XmlRpcResponse errorResponse = new XmlRpcResponse();
1227 Hashtable errorResponseData = new Hashtable();
1228 errorResponse.Value = errorResponseData;
1229 errorResponseData["restricted"] = error;
1230 return errorResponse;
1231 }
1209 } 1232 }
1210 1233
1211 /// <summary> 1234 /// <summary>
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs
index 2ffeb57..36ea238 100644
--- a/OpenSim/Grid/GridServer/GridServerBase.cs
+++ b/OpenSim/Grid/GridServer/GridServerBase.cs
@@ -63,15 +63,42 @@ namespace OpenSim.Grid.GridServer
63 MainConsole.Instance = m_console; 63 MainConsole.Instance = m_console;
64 } 64 }
65 65
66 public void managercallback(string cmd) 66 public override void RunCmd(string cmd, string[] cmdparams)
67 { 67 {
68 base.RunCmd(cmd, cmdparams);
69
68 switch (cmd) 70 switch (cmd)
69 { 71 {
70 case "shutdown": 72 case "disable-reg":
71 RunCmd("shutdown", new string[0]); 73 m_config.AllowRegionRegistration = false;
74 m_log.Info("Region registration disabled");
75 break;
76 case "enable-reg":
77 m_config.AllowRegionRegistration = true;
78 m_log.Info("Region registration enabled");
79 break;
80 }
81 }
82
83 public override void Show(string[] showParams)
84 {
85 base.Show(showParams);
86
87 switch (showParams[0])
88 {
89 case "status":
90 if (m_config.AllowRegionRegistration)
91 {
92 m_log.Info("Region registration enabled.");
93 }
94 else
95 {
96 m_log.Info("Region registration disabled.");
97 }
72 break; 98 break;
73 } 99 }
74 } 100 }
101
75 102
76 protected override void StartupSpecific() 103 protected override void StartupSpecific()
77 { 104 {