feat: tower defense activity

Bare minimum work done.
This commit is contained in:
Fishia
2025-12-06 01:21:28 -08:00
committed by Melledy
parent f44262f427
commit 3df873e385
5 changed files with 137 additions and 0 deletions
@@ -0,0 +1,17 @@
package emu.nebula.server.handlers;
import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.net.HandlerId;
import emu.nebula.net.GameSession;
@HandlerId(NetMsgId.activity_tower_defense_level_apply_req)
public class HandlerActivityTowerDefenseLevelApplyReq extends NetHandler {
@Override
public byte[] handle(GameSession session, byte[] message) throws Exception {
// Encode and send
return session.encodeMsg(NetMsgId.activity_tower_defense_level_apply_succeed_ack);
}
}
@@ -0,0 +1,22 @@
package emu.nebula.server.handlers;
import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.net.HandlerId;
import emu.nebula.game.player.PlayerChangeInfo;
import emu.nebula.net.GameSession;
@HandlerId(NetMsgId.activity_tower_defense_level_settle_req)
public class HandlerActivityTowerDefenseLevelSettleReq extends NetHandler {
@Override
public byte[] handle(GameSession session, byte[] message) throws Exception {
// Initialize change info
// TODO: Handle this properly
var changeInfo = new PlayerChangeInfo();
// Encode and send
return session.encodeMsg(NetMsgId.activity_tower_defense_level_settle_succeed_ack, changeInfo.toProto());
}
}