AdvanceMMO Wiki

Ultimate RPG Documentation

Database

AdvanceMMO supports both SQLite (default) and MySQL/MariaDB databases. This guide covers database setup and management.

Database Types

SQLite (Default)

SQLite is the default database type and requires no setup:

  • No installation required
  • Database file stored locally
  • Perfect for small to medium servers
  • No external dependencies

Limitations: Not recommended for large servers or multiple servers sharing data.

MySQL/MariaDB (Recommended)

MySQL is recommended for production servers:

  • Better performance
  • Supports multiple servers
  • Better for large player bases
  • Easier backups

Requirements: MySQL or MariaDB server installed and accessible.

SQLite Setup

SQLite is used by default. No configuration needed! The database file is created at:

plugins/AdvanceMMO/database.db

Make sure to backup this file regularly.

MySQL Setup

Step 1: Create Database

Create a MySQL database for AdvanceMMO:

CREATE DATABASE advancemmo CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

Step 2: Create User (Optional)

Create a dedicated user for the plugin:

CREATE USER 'advancemmo'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON advancemmo. TO 'advancemmo'@'localhost';
FLUSH PRIVILEGES;

Step 3: Configure Plugin

Edit plugins/AdvanceMMO/config.yml:

database:
  type: mysql
  host: localhost
  port: 3306
  database: advancemmo
  username: advancemmo
  password: your_password

Step 4: Restart Server

Restart your server. The plugin will automatically create all necessary tables.

Database Tables

AdvanceMMO creates the following tables:

  • player_data - Player statistics and progress
  • player_classes - Class selections
  • player_races - Race selections
  • player_abilities - Ability levels
  • player_quests - Quest progress
  • player_professions - Profession data
  • player_achievements - Achievement progress
  • guilds - Guild information
  • guild_members - Guild membership
  • player_mana - Player mana data
  • player_active_skills - Active skill cooldowns
  • skill_combos - Skill combo tracking
  • dungeon_definitions - Dungeon type definitions
  • dungeon_instances - Active dungeon instances
  • dungeon_worlds - Dungeon world mappings
  • dungeon_portals - Portal locations and data

Dungeon Tables

dungeon_definitions

Stores dungeon type definitions:

  • id - Primary key
  • name - Internal dungeon name
  • display_name - Display name for players
  • description - Dungeon description
  • required_level - Minimum level required
  • reward_xp - XP reward for completion
  • reward_money - Money reward for completion
  • reward_items - Comma-separated item list
  • max_players - Maximum players allowed
  • time_limit - Time limit in seconds

dungeon_instances

Stores active dungeon instances:

  • id - Primary key
  • dungeon_name - Reference to dungeon definition
  • owner_uuid - UUID of instance owner
  • members - Comma-separated list of member UUIDs
  • created_at - Timestamp of creation
  • completed - Whether dungeon is completed
  • completed_at - Timestamp of completion

dungeon_worlds

Maps players to their dungeon world instances:

  • id - Primary key
  • world_name - Name of the dungeon world
  • player_uuid - UUID of the player
  • dungeon_name - Name of the dungeon type
  • created_at - Timestamp of world creation

dungeon_portals

Stores portal locations and data:

  • id - Primary key
  • world - World name where portal is located
  • x, y, z - Portal coordinates
  • target_world - Target world for teleportation
  • portal_type - Type: ENTRANCE or EXIT
  • dungeon_name - Associated dungeon name

Backup and Restore

SQLite Backup

Simply copy the database file:

cp plugins/AdvanceMMO/database.db backup/database_backup_$(date +%Y%m%d).db

MySQL Backup

Use mysqldump:

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

Restore

For SQLite, replace the database file. For MySQL:

mysql -u advancemmo -p advancemmo < backup_20240101.sql

Data Migration

To migrate from SQLite to MySQL:

  1. Stop the server
  2. Backup SQLite database
  3. Configure MySQL in config.yml
  4. Start server (tables will be created)
  5. Use migration tools if available

Performance Tips

  • Use MySQL for servers with 50+ concurrent players
  • Regularly optimize MySQL tables
  • Set up automatic backups
  • Monitor database size and performance
Tip: Always backup your database before making changes or updates!