cheat logging

This commit is contained in:
2025-02-21 10:20:57 -06:00
parent 89e31fd159
commit 43631af53b
+9 -2
View File
@@ -13,6 +13,8 @@ import engine.Enum;
import engine.Enum.GameObjectType; import engine.Enum.GameObjectType;
import engine.gameManager.ConfigManager; import engine.gameManager.ConfigManager;
import engine.gameManager.DbManager; import engine.gameManager.DbManager;
import engine.net.DispatchMessage;
import engine.net.client.msg.chat.ChatSystemMsg;
import engine.objects.Account; import engine.objects.Account;
import engine.objects.PlayerCharacter; import engine.objects.PlayerCharacter;
import org.pmw.tinylog.Logger; import org.pmw.tinylog.Logger;
@@ -78,9 +80,9 @@ public class dbAccountHandler extends dbHandlerBase {
} }
public void SET_TRASH(String machineID, String type) { public void SET_TRASH(String machineID, String type) {
try (Connection connection = DbManager.getConnection(); try (Connection connection = DbManager.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO dyn_trash(`machineID`, `count`)" PreparedStatement preparedStatement = connection.prepareStatement(
"INSERT INTO dyn_trash(`machineID`, `count`, `type`)"
+ " VALUES (?, 1, ?) ON DUPLICATE KEY UPDATE `count` = `count` + 1;")) { + " VALUES (?, 1, ?) ON DUPLICATE KEY UPDATE `count` = `count` + 1;")) {
preparedStatement.setString(1, machineID); preparedStatement.setString(1, machineID);
@@ -90,6 +92,11 @@ public class dbAccountHandler extends dbHandlerBase {
} catch (SQLException e) { } catch (SQLException e) {
Logger.error(e); Logger.error(e);
} }
ChatSystemMsg chatMsg = new ChatSystemMsg(null, "Account: " + machineID + " has been kicked from game for cheating");
chatMsg.setMessageType(10);
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
DispatchMessage.dispatchMsgToAll(chatMsg);
} }
public ArrayList<String> GET_TRASH_LIST() { public ArrayList<String> GET_TRASH_LIST() {