WutheringWaves/GameServer/Program.cs

32 lines
1 KiB
C#
Raw Normal View History

2024-02-07 21:41:39 +00:00
using GameServer.Extensions;
using GameServer.Handlers;
using GameServer.Handlers.Factory;
2024-02-09 09:20:14 +00:00
using GameServer.Models;
2024-02-07 21:41:39 +00:00
using GameServer.Network;
2024-02-09 09:44:42 +00:00
using GameServer.Network.Kcp;
2024-02-07 21:41:39 +00:00
using GameServer.Network.Rpc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
namespace GameServer;
internal static class Program
{
private static async Task Main(string[] args)
{
HostApplicationBuilder builder = Host.CreateApplicationBuilder(args);
builder.Logging.AddConsole();
builder.Services.AddHandlers()
2024-02-09 09:44:42 +00:00
.AddSingleton<KcpGateway>().AddScoped<PlayerSession>()
2024-02-07 21:41:39 +00:00
.AddScoped<MessageManager>().AddSingleton<MessageHandlerFactory>()
.AddScoped<RpcManager>().AddScoped<IRpcEndPoint, RpcSessionEndPoint>()
.AddSingleton<SessionManager>()
2024-02-09 09:20:14 +00:00
.AddScoped<ModelManager>()
2024-02-07 21:41:39 +00:00
.AddHostedService<WWGameServer>();
await builder.Build().RunAsync();
}
}