Snowflake/RPG.Services.Gameserver/Program.cs

39 lines
1.3 KiB
C#
Raw Normal View History

2024-01-19 14:45:18 +00:00
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using RPG.GameCore.Excel;
using RPG.GameCore.Extensions;
using RPG.GameCore.Level;
2024-01-18 22:13:40 +00:00
using RPG.Services.Core.Extensions;
2024-01-19 14:45:18 +00:00
using RPG.Services.Gameserver.Extensions;
using RPG.Services.Gameserver.Game.Entity;
using RPG.Services.Gameserver.Game.Entity.Factory;
using RPG.Services.Gameserver.Game.Maze;
2024-01-19 14:45:18 +00:00
using RPG.Services.Gameserver.Modules;
2024-01-18 22:13:40 +00:00
using RPG.Services.Gameserver.Network.Command;
using RPG.Services.Gameserver.Session;
2024-01-18 16:18:25 +00:00
2024-01-18 22:13:40 +00:00
namespace RPG.Services.Gameserver;
internal static class Program
2024-01-18 16:18:25 +00:00
{
2024-01-18 22:13:40 +00:00
private static async Task Main(string[] args)
2024-01-18 16:18:25 +00:00
{
2024-01-18 22:13:40 +00:00
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>();
2024-01-18 22:13:40 +00:00
await builder.Build().RunAsync();
2024-01-18 16:18:25 +00:00
}
}