Fix `APIContainer.Comm` not having `HTTP`/`Sockets` on first boot
This commit is contained in:
parent
2fa46efda6
commit
28c53cfa21
|
@ -428,6 +428,19 @@ namespace BizHawk.Client.EmuHawk
|
||||||
Controls.Add(_presentationPanel);
|
Controls.Add(_presentationPanel);
|
||||||
Controls.SetChildIndex(_presentationPanel, 0);
|
Controls.SetChildIndex(_presentationPanel, 0);
|
||||||
|
|
||||||
|
// set up networking before ApiManager (in ToolManager)
|
||||||
|
byte[] NetworkingTakeScreenshot()
|
||||||
|
=> (byte[]) new ImageConverter().ConvertTo(MakeScreenshotImage().ToSysdrawingBitmap(), typeof(byte[]));
|
||||||
|
NetworkingHelpers = (
|
||||||
|
_argParser.HTTPAddresses is var (httpGetURL, httpPostURL)
|
||||||
|
? new HttpCommunication(NetworkingTakeScreenshot, httpGetURL, httpPostURL)
|
||||||
|
: null,
|
||||||
|
new MemoryMappedFiles(NetworkingTakeScreenshot, _argParser.MMFFilename),
|
||||||
|
_argParser.SocketAddress is var (socketIP, socketPort)
|
||||||
|
? new SocketServer(NetworkingTakeScreenshot, socketIP, socketPort)
|
||||||
|
: null
|
||||||
|
);
|
||||||
|
|
||||||
ExtToolManager = new ExternalToolManager(Config.PathEntries, () => (Emulator.SystemId, Game.Hash));
|
ExtToolManager = new ExternalToolManager(Config.PathEntries, () => (Emulator.SystemId, Game.Hash));
|
||||||
Tools = new ToolManager(this, Config, DisplayManager, ExtToolManager, InputManager, Emulator, MovieSession, Game);
|
Tools = new ToolManager(this, Config, DisplayManager, ExtToolManager, InputManager, Emulator, MovieSession, Game);
|
||||||
|
|
||||||
|
@ -641,18 +654,6 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set up networking before Lua
|
|
||||||
byte[] NetworkingTakeScreenshot() => (byte[]) new ImageConverter().ConvertTo(MakeScreenshotImage().ToSysdrawingBitmap(), typeof(byte[]));
|
|
||||||
NetworkingHelpers = (
|
|
||||||
_argParser.HTTPAddresses == null
|
|
||||||
? null
|
|
||||||
: new HttpCommunication(NetworkingTakeScreenshot, _argParser.HTTPAddresses.Value.UrlGet, _argParser.HTTPAddresses.Value.UrlPost),
|
|
||||||
new MemoryMappedFiles(NetworkingTakeScreenshot, _argParser.MMFFilename),
|
|
||||||
_argParser.SocketAddress == null
|
|
||||||
? null
|
|
||||||
: new SocketServer(NetworkingTakeScreenshot, _argParser.SocketAddress.Value.IP, _argParser.SocketAddress.Value.Port)
|
|
||||||
);
|
|
||||||
|
|
||||||
//start Lua Console if requested in the command line arguments
|
//start Lua Console if requested in the command line arguments
|
||||||
if (_argParser.luaConsole)
|
if (_argParser.luaConsole)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue