Files
caliverse_server/GameServer/Manager/UgcNpcCountManager.cs
2025-05-01 07:20:41 +09:00

25 lines
685 B
C#

using ServerCommon;
namespace GameServer;
public class UgcNpcCountManager
{
private static readonly Lazy<UgcNpcCountManager> m_instance = new(() => new UgcNpcCountManager());
public static UgcNpcCountManager Instance => m_instance.Value;
public int calculateNpcCount()
{
var count = 0;
// 1. 기본 Map 의 UgcNpc Count
count += GameServerApp.getServerLogic().getMap().getCurrCountAsAddConnectedUser();
// 2. Instance Room 의 UgcNpc Count
count += InstanceRoomManager.Instance.getInstanceRooms().Sum(room => room.Value.getMap().getCurrCountAsAddConnectedUser());
return count;
}
}