aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Base/HttpServerBase.cs
diff options
context:
space:
mode:
authorMelanie2019-08-21 21:15:58 +0100
committerMelanie2019-08-21 21:15:58 +0100
commit7e136c67fd89f6c559420093acdee867967773bb (patch)
tree6b9f5d4d81dff6821937684a5baf1e6c3ad75efc /OpenSim/Server/Base/HttpServerBase.cs
parentMassive console refactor. Greatly simplify interface. (diff)
downloadopensim-SC-7e136c67fd89f6c559420093acdee867967773bb.zip
opensim-SC-7e136c67fd89f6c559420093acdee867967773bb.tar.gz
opensim-SC-7e136c67fd89f6c559420093acdee867967773bb.tar.bz2
opensim-SC-7e136c67fd89f6c559420093acdee867967773bb.tar.xz
Call SetServer on consoles reflectively to avoid having type checks in places where it tends to be forgotten to update them.
Diffstat (limited to '')
-rwxr-xr-x[-rw-r--r--]OpenSim/Server/Base/HttpServerBase.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Server/Base/HttpServerBase.cs b/OpenSim/Server/Base/HttpServerBase.cs
index 3357250..5e76156 100644..100755
--- a/OpenSim/Server/Base/HttpServerBase.cs
+++ b/OpenSim/Server/Base/HttpServerBase.cs
@@ -149,12 +149,14 @@ namespace OpenSim.Server.Base
149 149
150 MainServer.RegisterHttpConsoleCommands(MainConsole.Instance); 150 MainServer.RegisterHttpConsoleCommands(MainConsole.Instance);
151 151
152 if (MainConsole.Instance is RemoteConsole) 152 MethodInfo mi = m_console.GetType().GetMethod("SetServer", BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(BaseHttpServer) }, null);
153
154 if (mi != null)
153 { 155 {
154 if (m_consolePort == 0) 156 if (m_consolePort == 0)
155 ((RemoteConsole)MainConsole.Instance).SetServer(MainServer.Instance); 157 mi.Invoke(MainConsole.Instance, new object[] { MainServer.Instance });
156 else 158 else
157 ((RemoteConsole)MainConsole.Instance).SetServer(MainServer.GetHttpServer(m_consolePort)); 159 mi.Invoke(MainConsole.Instance, new object[] { MainServer.GetHttpServer(m_consolePort) });
158 } 160 }
159 } 161 }
160 } 162 }