Update mail state more often

This commit is contained in:
Melledy
2025-10-31 01:53:49 -07:00
parent 36004b3fc3
commit c18bafae85
5 changed files with 66 additions and 16 deletions

View File

@@ -2,9 +2,7 @@ package emu.nebula.server.handlers;
import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.net.PacketHelper;
import emu.nebula.proto.PlayerPing.Pong;
import emu.nebula.proto.Public.MailState;
import emu.nebula.net.HandlerId;
import emu.nebula.Nebula;
import emu.nebula.net.GameSession;
@@ -18,20 +16,6 @@ public class HandlerPlayerPingReq extends NetHandler {
var rsp = Pong.newInstance()
.setServerTs(Nebula.getCurrentTime());
// Update mail state flag
if (session.getPlayer().getMailbox().isNewState()) {
// Clear
session.getPlayer().getMailbox().clearNewState();
// Send mail state notify
byte[] nextPackage = PacketHelper.encodeMsg(
NetMsgId.mail_state_notify,
MailState.newInstance().setNew(true)
);
rsp.setNextPackage(nextPackage);
}
return session.encodeMsg(NetMsgId.player_ping_succeed_ack, rsp);
}