mirror of
https://github.com/Melledy/Nebula.git
synced 2025-12-14 13:24:43 +01:00
28 lines
897 B
Java
28 lines
897 B
Java
package emu.nebula.server.handlers;
|
|
|
|
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)
|
|
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(manager.getTalents().toByteArray())
|
|
.setActiveCount(manager.getTalentPoints());
|
|
|
|
// Encode and send
|
|
return session.encodeMsg(NetMsgId.vampire_talent_detail_succeed_ack, rsp);
|
|
}
|
|
|
|
}
|