server-master/srcs/GameChannel/WorldServerSingleton.cs
2026-02-10 18:21:30 +01:00

21 lines
No EOL
1.2 KiB
C#

using System;
using GameChannel.Utils;
using WingsAPI.Communication.ServerApi.Protocol;
using WingsEmu.DTOs.Account;
namespace GameChannel
{
public static class WorldServerSingleton
{
public static SerializableGameServer Instance { get; } = new()
{
EndPointIp = Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_IP) ?? "127.0.0.1",
EndPointPort = Convert.ToInt32(Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_PORT) ?? "8000"),
WorldGroup = Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_GROUP) ?? "NosWings",
AccountLimit = Convert.ToInt32(Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_SESSION_LIMIT) ?? "500"),
ChannelId = Convert.ToInt32(Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_CHANNEL_ID) ?? "1"),
ChannelType = Enum.Parse<GameChannelType>(Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_CHANNEL_TYPE) ?? GameChannelType.PVE_NORMAL.ToString(), true),
Authority = (AuthorityType)Convert.ToInt32(Environment.GetEnvironmentVariable(EnvironmentConsts.GAME_SERVER_AUTHORITY) ?? $"{((int)AuthorityType.User).ToString()}")
};
}
}