mirror of
https://github.com/Melledy/Nebula.git
synced 2026-11-04 21:36:51 +01:00
Implement potential selector in monoliths
This commit is contained in:
1 parent
d57caeffe1
commit
08feedc766
10 files changed
+492
-47
No files matched your search
@@ -0,0 +1,20 @@
|
||||
package emu.nebula.server.handlers;
|
||||
|
||||
import emu.nebula.net.NetHandler;
|
||||
import emu.nebula.net.NetMsgId;
|
||||
import emu.nebula.proto.StarTowerBuildWhetherSave.StarTowerBuildWhetherSaveReq;
|
||||
import emu.nebula.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@HandlerId(NetMsgId.star_tower_build_whether_save_req)
|
||||
public class HandlerStarTowerBuildWhetherSaveReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
var req = StarTowerBuildWhetherSaveReq.parseFrom(message);
|
||||
|
||||
// TODO
|
||||
return this.encodeMsg(NetMsgId.star_tower_build_whether_save_succeed_ack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package emu.nebula.server.handlers;
|
||||
|
||||
import emu.nebula.net.NetHandler;
|
||||
import emu.nebula.net.NetMsgId;
|
||||
import emu.nebula.proto.StarTowerGiveUp.StarTowerGiveUpResp;
|
||||
import emu.nebula.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@HandlerId(NetMsgId.star_tower_give_up_req)
|
||||
public class HandlerStarTowerGiveUpReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
var instance = session.getPlayer().getStarTowerManager().giveUp();
|
||||
|
||||
if (instance == null) {
|
||||
return this.encodeMsg(NetMsgId.star_tower_give_up_failed_ack);
|
||||
}
|
||||
|
||||
// Build response
|
||||
var rsp = StarTowerGiveUpResp.newInstance()
|
||||
.setFloor(instance.getFloor());
|
||||
|
||||
rsp.getMutableChange();
|
||||
rsp.setBuild(instance.getBuild().toProto());
|
||||
|
||||
return this.encodeMsg(NetMsgId.star_tower_give_up_succeed_ack, rsp);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user