JJM Modifications

Database

Database tables, views, and management queries for JM-AdminMenu.

JM-AdminMenu uses a MySQL/MariaDB database (via oxmysql) to persist all admin actions, bans, warnings, kicks, and player notes.

Tables#

TablePurpose
jm_bansAll player bans, permanent and temporary
jm_kicksRecord of every kick action
jm_warningsPlayer warnings with auto-ban threshold
jm_admin_logsFull audit log of every admin action
jm_player_notesNotes added to player profiles
jm_screenshotsScreenshot evidence storage
jm_whitelistOptional whitelist system
jm_commendationsPositive recognition records
jm_admin_sessionsAdmin activity session tracking

Views#

ViewDescription
v_active_bansAll currently active bans with status labels
v_player_historyCombined history of all actions against a player
v_admin_activityPer-admin action statistics

Key Behaviours#

  • Automatic ban checking: When a player connects, the system queries jm_bans and drops the player immediately if an active ban is found.
  • Warning auto-ban: When a player accumulates 3 active warnings, the system automatically issues a 7-day ban.
  • Temporary ban expiration: Bans with an expiry date are handled automatically; expired bans no longer block players.
  • Audit trail: Every kick, ban, unban, warning, and troll action is written to jm_admin_logs.

Useful Queries#

Check all active bans:

SELECT * FROM v_active_bans;

View a player's full history:

SELECT * FROM v_player_historyWHERE identifier = 'license:abc123'ORDER BY performed_at DESC;

View recent admin activity:

SELECT * FROM jm_admin_logsORDER BY performed_at DESCLIMIT 50;

Server statistics snapshot:

SELECT    (SELECT COUNT(*) FROM jm_bans     WHERE is_active = 1) AS active_bans,    (SELECT COUNT(*) FROM jm_warnings WHERE is_active = 1) AS active_warnings,    (SELECT COUNT(*) FROM jm_kicks)                        AS total_kicks;

Maintenance#

Clean old audit logs (optional):

DELETE FROM jm_admin_logsWHERE performed_at < DATE_SUB(NOW(), INTERVAL 90 DAY);

Backup your database regularly:

mysqldump -u username -p database_name > backup_$(date +%Y%m%d).sql

Ensure the MySQL event scheduler is enabled for automatic ban expiration:

SET GLOBAL event_scheduler = ON;

Add to your MySQL config file (my.cnf / my.ini) for persistence:

[mysqld]event_scheduler=ON
Warning

Never expose your database credentials. Use a dedicated MySQL user with only the permissions needed for this database, and back up regularly.