Snowflake/RPG.Services.Gameserver/Program.cs

38 lines
1.3 KiB
C#

using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RPG.GameCore.Excel;
using RPG.GameCore.Extensions;
using RPG.GameCore.Level;
using RPG.Services.Core.Extensions;
using RPG.Services.Gameserver.Extensions;
using RPG.Services.Gameserver.Game.Entity;
using RPG.Services.Gameserver.Game.Entity.Factory;
using RPG.Services.Gameserver.Game.Maze;
using RPG.Services.Gameserver.Modules;
using RPG.Services.Gameserver.Network.Command;
using RPG.Services.Gameserver.Session;
namespace RPG.Services.Gameserver;
internal static class Program
{
private static async Task Main(string[] args)
{
Console.Title = "Snowflake | Gameserver";
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.SetupRPGService<RPGGameserver, GameserverCommandHandler>()
.Services.UseLocalResources()
.AddModules()
.AddScoped<ModuleManager>()
.AddScoped<MazeManager>()
.AddScoped<EntityManager>()
.AddScoped<EntityFactory>()
.AddSingleton<ExcelTables>()
.AddSingleton<LevelTables>()
.AddScoped<IEntityEventListener, SessionEntityEventListener>();
await builder.Build().RunAsync();
}
}