mirror of
https://github.com/opensim/opensim.git
synced 2026-05-14 18:55:39 +08:00
Call SetServer on consoles reflectively to avoid having type checks in places where it tends to be forgotten to update them.
This commit is contained in:
8
OpenSim/Server/Base/HttpServerBase.cs
Normal file → Executable file
8
OpenSim/Server/Base/HttpServerBase.cs
Normal file → Executable file
@@ -149,12 +149,14 @@ namespace OpenSim.Server.Base
|
||||
|
||||
MainServer.RegisterHttpConsoleCommands(MainConsole.Instance);
|
||||
|
||||
if (MainConsole.Instance is RemoteConsole)
|
||||
MethodInfo mi = m_console.GetType().GetMethod("SetServer", BindingFlags.Public | BindingFlags.Instance, null, new Type[] { typeof(BaseHttpServer) }, null);
|
||||
|
||||
if (mi != null)
|
||||
{
|
||||
if (m_consolePort == 0)
|
||||
((RemoteConsole)MainConsole.Instance).SetServer(MainServer.Instance);
|
||||
mi.Invoke(MainConsole.Instance, new object[] { MainServer.Instance });
|
||||
else
|
||||
((RemoteConsole)MainConsole.Instance).SetServer(MainServer.GetHttpServer(m_consolePort));
|
||||
mi.Invoke(MainConsole.Instance, new object[] { MainServer.GetHttpServer(m_consolePort) });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user