mirror of
https://github.com/Melledy/Nebula.git
synced 2026-11-04 21:36:51 +01:00
Update to support game version 1.9.0.*
This commit is contained in:
1 parent
dbd9d7693e
commit
eef6572073
34 files changed
+11925
-892
No files matched your search
@@ -0,0 +1,32 @@
|
||||
package emu.nebula.server.handlers;
|
||||
|
||||
import emu.nebula.net.NetHandler;
|
||||
import emu.nebula.net.NetMsgId;
|
||||
import emu.nebula.proto.Public.UI32;
|
||||
import emu.nebula.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@HandlerId(NetMsgId.char_favorite_set_req)
|
||||
public class HandlerCharFavoriteSetReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
// Parse request
|
||||
var req = UI32.parseFrom(message);
|
||||
|
||||
// Get character
|
||||
var character = session.getPlayer().getCharacters().getCharacterById(req.getValue());
|
||||
|
||||
if (character == null) {
|
||||
return session.encodeMsg(NetMsgId.char_favorite_set_failed_ack);
|
||||
}
|
||||
|
||||
// Toggle favorite status
|
||||
character.setFavorite(!character.isFavorite());
|
||||
character.save();
|
||||
|
||||
// Encode and send
|
||||
return session.encodeMsg(NetMsgId.char_favorite_set_succeed_ack);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package emu.nebula.server.handlers;
|
||||
|
||||
import emu.nebula.net.NetHandler;
|
||||
import emu.nebula.net.NetMsgId;
|
||||
import emu.nebula.proto.PotentialPreselectionListOuterClass.PotentialPreselectionList;
|
||||
import emu.nebula.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@HandlerId(NetMsgId.potential_preselection_list_req)
|
||||
public class HandlerPotentialPreselectionListReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
// Create base response
|
||||
var rsp = PotentialPreselectionList.newInstance();
|
||||
|
||||
// Encode and send
|
||||
return session.encodeMsg(NetMsgId.potential_preselection_list_succeed_ack, rsp);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user