mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-04 23:23:20 +08:00
A
: check account state before getPlayer
This commit is contained in:
parent
76fd5b2e9c
commit
85001441a2
@ -42,6 +42,15 @@ public class HandlerGetPlayerTokenReq extends PacketHandler {
|
||||
// Set account
|
||||
session.setAccount(account);
|
||||
|
||||
// Checks if the player is banned
|
||||
if (session.getAccount().isBanned()) {
|
||||
session.setState(SessionState.ACCOUNT_BANNED);
|
||||
session.send(
|
||||
new PacketGetPlayerTokenRsp(
|
||||
session, 21, "FORBID_CHEATING_PLUGINS", session.getAccount().getBanEndTime()));
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if player object exists in server
|
||||
// NOTE: CHECKING MUST SITUATED HERE (BEFORE getPlayerByUid)! because to save firstly ,to load
|
||||
// secondly !!!
|
||||
@ -93,15 +102,6 @@ public class HandlerGetPlayerTokenReq extends PacketHandler {
|
||||
// Set player object for session
|
||||
session.setPlayer(player);
|
||||
|
||||
// Checks if the player is banned
|
||||
if (session.getAccount().isBanned()) {
|
||||
session.setState(SessionState.ACCOUNT_BANNED);
|
||||
session.send(
|
||||
new PacketGetPlayerTokenRsp(
|
||||
session, 21, "FORBID_CHEATING_PLUGINS", session.getAccount().getBanEndTime()));
|
||||
return;
|
||||
}
|
||||
|
||||
// Load player from database
|
||||
player.loadFromDatabase();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user