diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Grid/GridServer/GridServerBase.cs | 63 |
1 files changed, 34 insertions, 29 deletions
diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 68edbd2..3fb07b5 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs | |||
@@ -39,7 +39,7 @@ namespace OpenSim.Grid.GridServer | |||
39 | { | 39 | { |
40 | /// <summary> | 40 | /// <summary> |
41 | /// </summary> | 41 | /// </summary> |
42 | public class GridServerBase : BaseOpenSimServer, conscmd_callback | 42 | public class GridServerBase : BaseOpenSimServer |
43 | { | 43 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
@@ -59,43 +59,34 @@ namespace OpenSim.Grid.GridServer | |||
59 | 59 | ||
60 | public GridServerBase() | 60 | public GridServerBase() |
61 | { | 61 | { |
62 | m_console = new ConsoleBase("Grid", this); | 62 | m_console = new ConsoleBase("Grid"); |
63 | MainConsole.Instance = m_console; | 63 | MainConsole.Instance = m_console; |
64 | } | 64 | } |
65 | 65 | ||
66 | public override void RunCmd(string cmd, string[] cmdparams) | 66 | private void HandleRegistration(string module, string[] cmd) |
67 | { | 67 | { |
68 | base.RunCmd(cmd, cmdparams); | 68 | switch (cmd[0]) |
69 | |||
70 | switch (cmd) | ||
71 | { | 69 | { |
72 | case "disable-reg": | 70 | case "enable": |
73 | m_config.AllowRegionRegistration = false; | 71 | m_config.AllowRegionRegistration = true; |
74 | m_log.Info("Region registration disabled"); | 72 | m_log.Info("Region registration enabled"); |
75 | break; | 73 | break; |
76 | case "enable-reg": | 74 | case "disable": |
77 | m_config.AllowRegionRegistration = true; | 75 | m_config.AllowRegionRegistration = false; |
78 | m_log.Info("Region registration enabled"); | 76 | m_log.Info("Region registration disabled"); |
79 | break; | 77 | break; |
80 | } | 78 | } |
81 | } | 79 | } |
82 | |||
83 | public override void Show(string[] showParams) | ||
84 | { | ||
85 | base.Show(showParams); | ||
86 | 80 | ||
87 | switch (showParams[0]) | 81 | private void HandleShowStatus(string module, string[] cmd) |
82 | { | ||
83 | if (m_config.AllowRegionRegistration) | ||
88 | { | 84 | { |
89 | case "status": | 85 | m_log.Info("Region registration enabled."); |
90 | if (m_config.AllowRegionRegistration) | 86 | } |
91 | { | 87 | else |
92 | m_log.Info("Region registration enabled."); | 88 | { |
93 | } | 89 | m_log.Info("Region registration disabled."); |
94 | else | ||
95 | { | ||
96 | m_log.Info("Region registration disabled."); | ||
97 | } | ||
98 | break; | ||
99 | } | 90 | } |
100 | } | 91 | } |
101 | 92 | ||
@@ -120,6 +111,20 @@ namespace OpenSim.Grid.GridServer | |||
120 | // Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. | 111 | // Timer simCheckTimer = new Timer(3600000 * 3); // 3 Hours between updates. |
121 | // simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); | 112 | // simCheckTimer.Elapsed += new ElapsedEventHandler(CheckSims); |
122 | // simCheckTimer.Enabled = true; | 113 | // simCheckTimer.Enabled = true; |
114 | |||
115 | base.StartupSpecific(); | ||
116 | |||
117 | m_console.Commands.AddCommand("gridserver", "enable registration", | ||
118 | "enable registration", | ||
119 | "Enable new regions to register", HandleRegistration); | ||
120 | |||
121 | m_console.Commands.AddCommand("gridserver", "disable registration", | ||
122 | "disable registration", | ||
123 | "Disable registering new regions", HandleRegistration); | ||
124 | |||
125 | m_console.Commands.AddCommand("gridserver", "show status", | ||
126 | "show status", | ||
127 | "Show registration status", HandleShowStatus); | ||
123 | } | 128 | } |
124 | 129 | ||
125 | protected void AddHttpHandlers() | 130 | protected void AddHttpHandlers() |