feat: 최대 강화 단계, 현재 골드 기반 랭크 추가

This commit is contained in:
bumpsoo 2026-02-08 17:08:37 +09:00
parent 30debc44f5
commit 71e09915b7
6 changed files with 197 additions and 9 deletions

View file

@ -139,6 +139,31 @@ PacketHandler::HandlePacket(std::shared_ptr<Session> session,
SessionManager::GetInstance().Broadcast(packet.header, packet.payload);
} break;
case PacketID::CS_RankingRequest: {
Protocol::CS_RankingRequest pkt;
if (!pkt.ParseFromArray(packet.payload.data(), packet.payload.size())) {
Logger::Log("랭킹 요청 패킷 파싱 실패");
co_return;
}
auto rankResult = co_await DatabaseManager::GetInstance().GetRanking(
(int)pkt.type(), session->GetNickname());
Protocol::SC_RankingList res;
res.set_type(pkt.type());
res.set_my_rank(rankResult.myRank);
res.set_my_value(rankResult.myValue);
for (const auto &entry : rankResult.topEntries) {
auto *newEntry = res.add_entries();
newEntry->set_rank(entry.rank);
newEntry->set_nickname(entry.nickname);
newEntry->set_value(entry.value);
}
session->SendPacket(PacketID::SC_RankingList, res);
} break;
default:
Logger::Log("알 수 없는 패킷 ID: ", packet.header.id);
break;