mirror of
https://github.com/Melledy/Nebula.git
synced 2026-11-04 21:36:51 +01:00
Implement daily shop reward
This commit is contained in:
1 parent
8d772b3365
commit
5e8b2cb9cf
3 files changed
+59
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.net.HandlerId;
|
||||
import emu.nebula.net.GameSession;
|
||||
|
||||
@HandlerId(NetMsgId.daily_shop_reward_receive_req)
|
||||
public class HandlerDailyShopRewardReceiveReq extends NetHandler {
|
||||
|
||||
@Override
|
||||
public byte[] handle(GameSession session, byte[] message) throws Exception {
|
||||
// Claim daily reward
|
||||
var change = session.getPlayer().getQuestManager().claimDailyReward();
|
||||
|
||||
if (change == null) {
|
||||
return session.encodeMsg(NetMsgId.daily_shop_reward_receive_failed_ack);
|
||||
}
|
||||
|
||||
// Encode and send
|
||||
return session.encodeMsg(NetMsgId.daily_shop_reward_receive_succeed_ack, change.toProto());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user