초기커밋
This commit is contained in:
25
GameServer/Manager/UgcNpcCountManager.cs
Normal file
25
GameServer/Manager/UgcNpcCountManager.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user