Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
45068ea932 |
@@ -102,8 +102,19 @@ namespace Torch.Server
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
var gameThread = new Thread(() =>
|
var uiThread = new Thread(() =>
|
||||||
{
|
{
|
||||||
|
var ui = new TorchUI(_server);
|
||||||
|
|
||||||
|
SynchronizationContext.SetSynchronizationContext(
|
||||||
|
new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
|
||||||
|
|
||||||
|
ui.ShowDialog();
|
||||||
|
});
|
||||||
|
|
||||||
|
uiThread.SetApartmentState(ApartmentState.STA);
|
||||||
|
uiThread.Start();
|
||||||
|
|
||||||
_server.Init();
|
_server.Init();
|
||||||
|
|
||||||
if (Config.Autostart || Config.TempAutostart)
|
if (Config.Autostart || Config.TempAutostart)
|
||||||
@@ -111,16 +122,6 @@ namespace Torch.Server
|
|||||||
Config.TempAutostart = false;
|
Config.TempAutostart = false;
|
||||||
_server.Start();
|
_server.Start();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
gameThread.Start();
|
|
||||||
|
|
||||||
var ui = new TorchUI(_server);
|
|
||||||
|
|
||||||
SynchronizationContext.SetSynchronizationContext(
|
|
||||||
new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
|
|
||||||
|
|
||||||
ui.ShowDialog();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,7 +12,7 @@ namespace Torch.Server
|
|||||||
{
|
{
|
||||||
internal static class Program
|
internal static class Program
|
||||||
{
|
{
|
||||||
[STAThread]
|
[MTAThread]
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
var configurationBuilder = new ConfigurationBuilder()
|
var configurationBuilder = new ConfigurationBuilder()
|
||||||
|
Reference in New Issue
Block a user