feat : 토큰 인증 RestApi 구현 / Token기반 haskKey구현 / Dummy, User Token체크 분기

This commit is contained in:
qornwh1
2026-03-04 15:53:15 +09:00
parent 053c5d23b9
commit 343ea43a03
12 changed files with 187 additions and 16 deletions

View File

@@ -149,18 +149,23 @@ public abstract class ServerBase : INetEventListener
}
// 0이라면 에코 서버 테스트용 따로 처리
if (type == 0)
if (type == 1000)
{
HandleEcho(peer, data);
return;
}
// Auth 패킷은 베이스에서 처리 (raw 8-byte long, protobuf 불필요)
if (type == (ushort)PacketType.Auth)
if (type == (ushort)PacketType.ACC_TOKEN)
{
HandleAuth(peer, payload);
return;
}
else if (type == (ushort)PacketType.DUMMY_ACC_TOKEN)
{
HandleAuthDummy(peer, payload);
return;
}
// 인증된 피어인지 확인
if (peer.Tag is not Session session)
@@ -204,7 +209,11 @@ public abstract class ServerBase : INetEventListener
protected abstract void HandleEcho(NetPeer peer, byte[] payload);
// ─── Auth 처리 (내부) ────────────────────────────────────────────────
// ─── Auth 처리 (더미) ────────────────────────────────────────────────
protected abstract void HandleAuthDummy(NetPeer peer, byte[] payload);
// ─── Auth 처리 ────────────────────────────────────────────────
protected abstract void HandleAuth(NetPeer peer, byte[] payload);