Content generated with AI — it may contain mistakes.

ExyliaSurvivalCore/ReferenceUpdated in v1.2.2

Understand the database

The thirty-eight tables, which module owns each, what they hold, how the lib's wipe reads them, and the schema quirks worth knowing.

Page 21 of 387 min read

Every module that stores anything opens its own tables, and a module that is off creates none. All of them go through one connection, configured in database.yml (ExyliaLib's file; the engine and the Redis block are described in the library's database page).

Tables are created from the record definitions with CREATE TABLE IF NOT EXISTS, the first time each repository is opened. There is no schema file to apply and no migration to run.

Every table declares what it holds (@Table(data = …)) and which column is the player, so /exylialib wipe and /exylialib resetplayer cover them without any command of this plugin's own. The Kind column is that declaration (account, progress, history, world, setup or cache), which is what the lib's wipe uses to decide what to clear.

Tables of modules that moved out

Supply drops, power-ups, loot chests, regen zones, duel rooms, bounties, crates, the shop, the market, vaults, graves, protections, rewards, votes, mines, AFK zones and the economy are no longer created by this plugin. Their old sc_* and exylia_* tables stay in the database untouched; the plugins that took them over read them, so do not drop them. See each plugin's own documentation, such as ExyliaEconomy, ExyliaMarket and ExyliaCrates.

Movement#

TableKindKeyHolds
spawn_datasetupidThe spawn location. One row
sc_spawn_seenprogressthe player UUIDThat the player has joined some server of the network, and how many times. This is what "first join" asks, so a hop to another server is not treated as a new player
homesprogressid = a UUIDThe owner (indexed), name, location and icon
sc_warpssetupidDisplay name, enabled, cost, permission, icon, location
sc_warp_cooldownscache<playerUuid>:<warpId>When the player last used that warp
tpa_settingsaccountplayeruuidWhether they accept requests, auto-accept and confirm
rtp_cooldownscacheidPlayer (indexed), world, when it was used
sc_backcachethe player UUIDWhere they last left from, and when
survival_portalssetupidThe region, the destination and the command list (only with the portals module on)
sc_jumpadssetupidServer, power, direction, glide, and the block locations (only with jumpads on)

/back and the warp cooldowns are rows rather than memory because a warp can put the player on another server, and the server they arrive on has to know both. survival_portals is the one table with the survival_ prefix rather than sc_.

Statistics#

TableKindKeyHolds
player_statsprogressplayeruuidName, kills, deaths, best kill streak
stat_cachecache<uuid>:<statId>One cached stat value per player, for the leaderboards
sc_stat_countersprogress<uuid>:<key>Every counter a module keeps: player name, counter key, amount

player_stats carries three descending indexes — on kills, deaths and best streak — so a leaderboard is a bounded read. sc_stat_counters is what a COUNTER stat in stats.yml, a mission and a season all read, so counting something new never needs a table of its own.

Progression#

TableKindKeyHolds
rankup_dataprogressplayeruuidCurrent rank, completed ranks, prestige level
farming_dataprogressplayeruuidPer-category counts
sc_farming_claimsprogress<playerUuid>:<category>:<milestone>One farming milestone of one player: claimed or not, and when
reclaim_dataprogressplayeruuidWhat has been claimed once
sc_reclaim_claimsprogress<playerUuid>:<section>When the player last reclaimed one section (0 means never, or reset)
player_join_dataprogressthe player UUIDFirst join, join number, total joins
sc_scheduled_runssetup<server>:<section> or network:<section>When a scheduled-commands section last ran

Farming milestones and reclaim sections are a row each, rather than a list inside the player's row, so two servers racing for the same claim cannot pay it twice: of the two conditional writes, only one lands.

Missions, seasons, projects and reputation#

TableKindKeyHolds
sc_missionsprogress<uuid>|<pool>|<period>|<missionId>One mission a player was dealt: pool, period, mission, the counter value it started from, the target, claimed
sc_seasonsworld<track>:<period>The season a track is counting right now, and when it started
sc_season_resultshistory<seasonId>:<position>A closed season's board: track, period, position, player, score, when it closed
sc_projectsworldthe project idWhether the project is open, completed or settled, and when
sc_project_progressworldcomposed id (project and material)How much of one material the project has received
sc_project_contributionsworldcomposed id (project and player)How many items one player gave one project (indexed for the largest-first read)
sc_project_payoutsworldcomposed id (project and player)Whether one contributor of a completed project has been paid
sc_reputationprogressthe player UUIDName, positive and negative ratings received
sc_reputation_pairscache<rater>:<target>When one player's rating of another last counted
sc_reputation_ticketscachea generated idOne deal a rater may still rate: target, where it happened (trade, market or auctions), when

See Reputation and projects.

Kits, boosters and tools#

TableKindKeyHolds
sc_kitssetupidThe whole kit: items, commands, cooldown, uses, icon, order, flags
sc_kit_player_dataprogress<playerId>:<kitId>Last claim and use count. Player indexed
sc_boostersworldidOwner (empty for a global booster), type, source, multiplier, duration, when it expires (0 while not started), who granted it
sc_booster_presetssetupidA booster ready to hand out: name, icon, type, source, multiplier, duration. Giving one copies it, so editing a preset never changes a booster already given
sc_item_spawnerssetupidServer, locations, the interval range and the loot table (only without ExyliaSpawners)
sc_item_updatessetupthe group nameThe item that is replaced and the item it becomes

Quality of life#

TableKindKeyHolds
player_utils_dataaccountplayeruuidWhether flight and night vision are on
sc_player_settingsaccountplayeruuidThe preferences the player has turned off

Modules that store nothing#

death, enchantments, near, optimization and repair. Kill streaks are counted in memory and lost on a restart.

Things worth knowing before you touch a table by hand#

A stored location can name another server

Homes, warps, portals and jump pads store server,world,x,y,z,yaw,pitch, where - means "this server". That is what makes /home and /warp work across a network. A row naming a server that is not this one has no local location at all, which is why the API offers a teleport method rather than coordinates. Places saved under a previous server id are read as this server's.

Some rows are claimed by deleting or moving them

A season is closed, a reputation ticket is rated, a scheduled run is taken and a project is completed or paid by whichever server manages to delete or move the row first — only one write succeeds, which is what makes each of those happen once across a network. Editing such a row by hand is not a clean-up: it pays nothing, closes nothing, or runs the action twice.

The tables the plugin has had the longest also carry created_at and updated_at; the newer ones carry only the columns above. Nothing has a unique constraint beyond its primary key.

Sharing across servers#

Point every server at the same database and homes, warps, kits, ranks, statistics, boosters, projects and the rest are shared. Tables with no server column are network-wide by design; tables that do carry one (homes, warps, jump pads, portals) are shared but each row remembers where it was set.

Something missing on this page? Tell us on Discord