fix : playerID == hashkey 통일 / long => int로 변경

This commit is contained in:
qornwh1
2026-03-08 20:47:23 +09:00
parent 1b7f0003fb
commit 5165b9e6dc
12 changed files with 63 additions and 63 deletions

View File

@@ -3,20 +3,20 @@ namespace MMOserver.Utils;
public class UuidGenerator
{
// 0 ~ 1000 은 더미 클라이언트 예약 범위
private const long DUMMY_RANGE_MAX = 1000;
private const int DUMMY_RANGE_MAX = 1000;
private readonly object idLock = new();
private readonly HashSet<long> usedIds = new();
private readonly HashSet<int> usedIds = new();
// 고유 랜덤 long ID 발급 (1001번 이상, 충돌 시 재생성)
public long Create()
// 고유 랜덤 int ID 발급 (1001번 이상, 충돌 시 재생성)
public int Create()
{
lock (idLock)
{
long id;
int id;
do
{
id = Random.Shared.NextInt64(DUMMY_RANGE_MAX + 1, long.MaxValue);
id = Random.Shared.Next(DUMMY_RANGE_MAX + 1, int.MaxValue);
} while (usedIds.Contains(id));
usedIds.Add(id);
@@ -25,7 +25,7 @@ public class UuidGenerator
}
// 로그아웃 / 세션 만료 시 ID 반납
public bool Release(long id)
public bool Release(int id)
{
lock (idLock)
{