Implement ban functionality

- Added ban module
- Added Ban and Unban commands, supporting banning and unbanning players through various command parameters.
- Added timestamp formatting method in Utils utility class for displaying ban expiration times
- Introduced PlayerErrorCode enum defining various error codes including ErrBan
- Added dual ban checking for both IP and user during player login
- Optimized login failure responses to provide specific error reasons and parameters
This commit is contained in:
HongchengQ authored and Melledy committed 2025-12-10 16:33:41 -08:00
1 parent 6483e8a5a7
commit 3a6387c2bd
11 files changed
+750 -9

No files matched your search

@@ -1,5 +1,6 @@
package emu.nebula.server.handlers;
import emu.nebula.game.player.PlayerErrorCode;
import emu.nebula.net.NetHandler;
import emu.nebula.net.NetMsgId;
import emu.nebula.proto.PlayerSignatureEdit.PlayerSignatureEditReq;
@@ -27,7 +28,9 @@ public class HandlerPlayerSignatureEdit extends NetHandler {
return session.encodeMsg(
NetMsgId.player_signature_edit_failed_ack,
Error.newInstance().setCode(119902).addArguments("\nCommand Result: " + result.getMessage())
Error.newInstance()
.setCode(PlayerErrorCode.ErrConfig.getValue())
.addArguments("\nCommand Result: " + result.getMessage())
);
}