Browse Source

Admin command usages logged to database.

master
MagicBot 2 years ago
parent
commit
3f700f57a7
  1. 12
      src/engine/db/handlers/dbAccountHandler.java
  2. 1
      src/engine/gameManager/DevCmdManager.java

12
src/engine/db/handlers/dbAccountHandler.java

@ -47,11 +47,23 @@ public class dbAccountHandler extends dbHandlerBase {
return ac; return ac;
} }
public void WRITE_ADMIN_LOG(String adminName, String logEntry) {
prepareCallable("INSERT INTO dyn_admin_log(`DateTime`, `Account`, `Event`)"
+ " VALUES (?, ?, ?)");
setTimeStamp(1, System.currentTimeMillis());
setString(2, adminName);
setString(3, logEntry);
executeUpdate();
}
public void SET_TRASH(String machineID) { public void SET_TRASH(String machineID) {
prepareCallable("INSERT INTO dyn_trash(`machineID`, `count`)" prepareCallable("INSERT INTO dyn_trash(`machineID`, `count`)"
+ " VALUES (?, 1) ON DUPLICATE KEY UPDATE `count` = `count` + 1;"); + " VALUES (?, 1) ON DUPLICATE KEY UPDATE `count` = `count` + 1;");
setTimeStamp(4, System.currentTimeMillis());
setString(1, machineID); setString(1, machineID);
executeUpdate(); executeUpdate();

1
src/engine/gameManager/DevCmdManager.java

@ -204,6 +204,7 @@ public enum DevCmdManager {
+ ") '"; + ") '";
logString += cmd + ' ' + argString + '\''; logString += cmd + ' ' + argString + '\'';
Logger.info( logString); Logger.info( logString);
DbManager.AccountQueries.WRITE_ADMIN_LOG(pcName, cmd + " " + argString);
// execute command; // execute command;
try { try {

Loading…
Cancel
Save