1
0
mirror of synced 2024-11-23 22:41:01 +01:00

Modify settings to directly use server without reverse proxy

This commit is contained in:
asesidaa 2022-09-22 22:14:55 +08:00
parent 20b0765598
commit 5d904c1ed7
11 changed files with 34 additions and 22 deletions

Binary file not shown.

View File

@ -116,7 +116,7 @@ public static class FlagCalculator
{ {
if (id >= bitArraySize) if (id >= bitArraySize)
{ {
logger.LogWarning("Id out of range!"); logger.LogWarning("Id {Id} out of range!", id);
continue; continue;
} }
bitSet.Set((int)id, true); bitSet.Set((int)id, true);

View File

@ -23,11 +23,8 @@ try
// Manually enable tls 1.0 // Manually enable tls 1.0
builder.WebHost.UseKestrel(kestrelOptions => builder.WebHost.UseKestrel(kestrelOptions =>
{ {
kestrelOptions.ConfigureHttpsDefaults(httpsOptions => kestrelOptions.ConfigureHttpsDefaults(options =>
{ options.SslProtocols = SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13);
httpsOptions.SslProtocols =
SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12 | SslProtocols.Tls13;
});
}); });
builder.Host.UseSerilog((context, configuration) => builder.Host.UseSerilog((context, configuration) =>

View File

@ -47,6 +47,9 @@
<Content Update="wwwroot\data\music_attribute.bin"> <Content Update="wwwroot\data\music_attribute.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Update="wwwroot\data\music_attribute.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -36,8 +36,20 @@
"Kestrel": { "Kestrel": {
"Endpoints": { "Endpoints": {
"Server": { "BaseServer": {
"Url": "http://0.0.0.0:5000" "Url": "http://0.0.0.0:5000"
},
"AmAuthServer": {
"Url": "http://0.0.0.0:80"
},
"MuchaServer": {
"Url": "https://0.0.0.0:10122"
},
"GameServer1": {
"Url": "https://0.0.0.0:54430"
},
"GameServer2": {
"Url": "https://0.0.0.0:54431"
} }
}, },
"Certificates": { "Certificates": {

View File

@ -7,7 +7,7 @@ builder.RootComponents.Add<HeadOutlet>("head::after");
builder.Services.AddSingleton(sp => new HttpClient builder.Services.AddSingleton(sp => new HttpClient
{ {
BaseAddress = new Uri(builder.Configuration.GetValue<string>("BaseUrl")) BaseAddress = new Uri(builder.HostEnvironment.BaseAddress)
}); });
builder.Services.AddMudServices(); builder.Services.AddMudServices();
builder.Services.AddSingleton<IGameDataService, GameDataService>(); builder.Services.AddSingleton<IGameDataService, GameDataService>();
@ -15,10 +15,6 @@ builder.Services.AddSingleton<IGameDataService, GameDataService>();
var host = builder.Build(); var host = builder.Build();
var gameDataService = host.Services.GetRequiredService<IGameDataService>(); var gameDataService = host.Services.GetRequiredService<IGameDataService>();
#if DEBUG await gameDataService.InitializeAsync(builder.HostEnvironment.BaseAddress);
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("DataBaseUrl"));
#else
await gameDataService.InitializeAsync(builder.Configuration.GetValue<string>("BaseUrl"));
#endif
await host.RunAsync(); await host.RunAsync();

View File

@ -30,6 +30,7 @@ public class GameDataService : IGameDataService
public async Task InitializeAsync(string dataBaseUrl) public async Task InitializeAsync(string dataBaseUrl)
{ {
dataBaseUrl = dataBaseUrl.TrimEnd('/');
var musicInfo = await GetData<MusicInfo>(dataBaseUrl, Constants.MUSIC_INFO_BASE_NAME); var musicInfo = await GetData<MusicInfo>(dataBaseUrl, Constants.MUSIC_INFO_BASE_NAME);
var wordList = await GetData<WordList>(dataBaseUrl, Constants.WORD_LIST_BASE_NAME); var wordList = await GetData<WordList>(dataBaseUrl, Constants.WORD_LIST_BASE_NAME);
var musicOrder = await GetData<MusicOrder>(dataBaseUrl, Constants.MUSIC_ORDER_BASE_NAME); var musicOrder = await GetData<MusicOrder>(dataBaseUrl, Constants.MUSIC_ORDER_BASE_NAME);

View File

@ -20,9 +20,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Update="wwwroot\appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\musicinfo.bin"> <Content Update="wwwroot\data\musicinfo.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
@ -32,6 +29,18 @@
<Content Update="wwwroot\data\wordlist.bin"> <Content Update="wwwroot\data\wordlist.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Update="wwwroot\data\music_attribute.bin">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\music_order.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\musicinfo.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\data\wordlist.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -1,3 +0,0 @@
{
"DataBaseUrl": "http://localhost:5000"
}

View File

@ -1,3 +0,0 @@
{
"BaseUrl": "http://localhost:5000"
}