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
2025-12-09 22:21:57 +08:00
committed by Melledy
parent 6483e8a5a7
commit 3a6387c2bd
11 changed files with 750 additions and 9 deletions

View File

@@ -24,6 +24,7 @@ public class GameSession {
private String token;
private Account account;
private Player player;
private String ipAddress;
// Crypto
private int encryptMethod; // 0 = gcm, 1 = chacha20
@@ -143,6 +144,10 @@ public class GameSession {
this.lastActiveTime = System.currentTimeMillis();
}
public void updateIpAddress(String ip) {
this.ipAddress = ip;
}
// Packet encoding helper functions
@SneakyThrows