Implement character showcase

This commit is contained in:
Melledy committed 2025-11-11 05:16:47 -08:00
1 parent b106541f44
commit 080d345981
2 files changed
+78

No files matched your search

@@ -0,0 +1,24 @@
package emu.nebula.server.handlers;
import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.PlayerCharsShow.PlayerCharsShowReq;
import emu.nebula.net.HandlerId;
import emu.nebula.net.GameSession;
@HandlerId(NetMsgId.player_chars_show_req)
public class HandlerPlayerCharsShowReq extends NetHandler {
@Override
public byte[] handle(GameSession session, byte[] message) throws Exception {
// Parse req
var req = PlayerCharsShowReq.parseFrom(message);
// Set
boolean success = session.getPlayer().setShowChars(req.getCharIds());
// Encode and send
return session.encodeMsg(success ? NetMsgId.player_chars_show_succeed_ack : NetMsgId.player_chars_show_failed_ack);
}
}