Implement vampire survivor records

This commit is contained in:
Melledy
2025-11-14 18:12:07 -08:00
parent 300d51aaf2
commit 30d0dfbaee
9 changed files with 165 additions and 17 deletions

View File

@@ -16,7 +16,7 @@ public class HandlerVampireSurvivorApplyReq extends NetHandler {
var req = VampireSurvivorApplyReq.parseFrom(message);
// Apply
var game = session.getPlayer().getVampireSurvivorManager().apply(req.getId());
var game = session.getPlayer().getVampireSurvivorManager().apply(req.getId(), req.getBuildIds());
if (game == null) {
return session.encodeMsg(NetMsgId.vampire_survivor_apply_failed_ack);

View File

@@ -25,7 +25,7 @@ public class HandlerVampireSurvivorSettleReq extends NetHandler {
// Calculate victory + score
boolean victory = !req.getDefeat();
int score = 0;
int score = 1;
// Settle
session.getPlayer().getVampireSurvivorManager().settle(victory, score);

View File

@@ -4,6 +4,7 @@ import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.VampireTalentDetail.VampireTalentDetailResp;
import emu.nebula.net.HandlerId;
import emu.nebula.net.GameSession;
@HandlerId(NetMsgId.vampire_talent_detail_req)
@@ -11,9 +12,13 @@ public class HandlerVampireTalentDetailReq extends NetHandler {
@Override
public byte[] handle(GameSession session, byte[] message) throws Exception {
// Get vampire surv manager
var manager = session.getPlayer().getVampireSurvivorManager();
// Build response
var rsp = VampireTalentDetailResp.newInstance()
.setNodes(new byte[8]);
.setNodes(manager.getTalents().toByteArray())
.setActiveCount(manager.getTalentPoints());
// Encode and send
return session.encodeMsg(NetMsgId.vampire_talent_detail_succeed_ack, rsp);