mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-12 00:38:48 -07:00
Update Program.cs
This commit is contained in:
parent
1bfbc75d36
commit
c852c3834f
@ -11,14 +11,12 @@ using System.Net;
|
|||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
// Add services to the container.
|
// Add services to the container.
|
||||||
bool ConsoleOptions = builder.Configuration.GetSection("ConsoleOptions").GetValue<bool>("Show logs");
|
|
||||||
bool GamePromptOptions = builder.Configuration.GetSection("GamePromptOptions").GetValue<bool>("Open Game");
|
|
||||||
|
|
||||||
// shows information about loading assets/api stuff
|
bool gameOpenEnable = builder.Configuration.GetSection("GamePromptOptions").GetValue<bool>("Enabled");
|
||||||
if (ConsoleOptions == true)
|
string ClientPath = builder.Configuration.GetSection("GamePromptOptions").GetValue<string>("ClientPath");
|
||||||
{
|
|
||||||
VerboseLogging.log();
|
// shows that the server is starting
|
||||||
}
|
ConsoleFunctions.log("Server Start");
|
||||||
|
|
||||||
builder.Services.Configure<AssetServerConfig>(builder.Configuration.GetSection("AssetServer"));
|
builder.Services.Configure<AssetServerConfig>(builder.Configuration.GetSection("AssetServer"));
|
||||||
builder.Services.Configure<ApiServerConfig>(builder.Configuration.GetSection("ApiServer"));
|
builder.Services.Configure<ApiServerConfig>(builder.Configuration.GetSection("ApiServer"));
|
||||||
@ -74,11 +72,21 @@ app.UseAuthorization();
|
|||||||
|
|
||||||
app.MapControllers();
|
app.MapControllers();
|
||||||
|
|
||||||
// Shows message that server started
|
// Shows message that server is running
|
||||||
VerboseLogging.ServerStartedMessage();
|
|
||||||
if (GamePromptOptions)
|
ConsoleFunctions.log("Server Running");
|
||||||
|
|
||||||
|
//asks the user to automally open the game client
|
||||||
|
if (gameOpenEnable == true)
|
||||||
{
|
{
|
||||||
OpenGamePrompt.prompt();
|
if (ClientPath.EndsWith("exe"))
|
||||||
|
{
|
||||||
|
ConsoleFunctions.prompt(ClientPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("Invalid or empty Configuration value, Check your configuration file appsettings.json ClientPath is incorrect");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
PrintInfo.print();
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user