Compare commits

...

2 Commits
2.0.0 ... 2.0.2

Author SHA1 Message Date
zznty
45068ea932 remove requirement o sta thread in no gui scenarios 2023-04-22 02:51:29 +07:00
zznty
181e9297a1 fix packaging 2023-04-14 11:36:04 +07:00
3 changed files with 19 additions and 18 deletions

View File

@@ -75,6 +75,6 @@ jobs:
- run: dotnet pack -c Release ./Torch.API/Torch.API.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build - run: dotnet pack -c Release ./Torch.API/Torch.API.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build
- run: dotnet pack -c Release ./Torch/Torch.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build - run: dotnet pack -c Release ./Torch/Torch.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build
- run: dotnet pack -c Release ./Torch.Server/Torch.Server.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build - run: dotnet pack -c Release ./Torch.Server/Torch.Server.csproj -o pack --include-symbols -p:SymbolPackageFormat=snupkg -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" --no-build
- run: mkdir blank && sed -i 's/torchVersion/${{ steps.version.outputs.version }}/g' Torch.Server.ReferenceAssemblies.net7.nuspec && nuget pack Torch.Server.ReferenceAssemblies.net7.nuspec -BasePath ./blank -p:Version="${{ steps.version.outputs.version }}" -p:AssemblyVersion="${{ steps.version.outputs.version }}" -OutputDirectory pack -NonInteractive -NoPackageAnalysis - run: mkdir blank && sed -i 's/torchVersion/${{ steps.version.outputs.version }}/g' Torch.Server.ReferenceAssemblies.net7.nuspec && nuget pack Torch.Server.ReferenceAssemblies.net7.nuspec -BasePath ./blank -OutputDirectory pack -NonInteractive -NoPackageAnalysis
- run: dotnet nuget push ./pack/*.nupkg -s github - run: dotnet nuget push ./pack/*.nupkg -s github

View File

@@ -102,25 +102,26 @@ namespace Torch.Server
} }
#endif #endif
var gameThread = new Thread(() => var uiThread = new Thread(() =>
{ {
_server.Init(); var ui = new TorchUI(_server);
if (Config.Autostart || Config.TempAutostart) SynchronizationContext.SetSynchronizationContext(
{ new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher));
Config.TempAutostart = false;
_server.Start(); ui.ShowDialog();
}
}); });
gameThread.Start(); uiThread.SetApartmentState(ApartmentState.STA);
uiThread.Start();
var ui = new TorchUI(_server);
_server.Init();
SynchronizationContext.SetSynchronizationContext(
new DispatcherSynchronizationContext(Dispatcher.CurrentDispatcher)); if (Config.Autostart || Config.TempAutostart)
{
ui.ShowDialog(); Config.TempAutostart = false;
_server.Start();
}
} }
} }

View File

@@ -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()