Skip to content

MongoDB Data Structure

We use MongoDB to store player profiles and permissions.

Connection Logic

When a game server starts up, it attempts to connect to Mongo using the hostname specified in the Environment.

The Player Model

PropertyBSON TypeDescription
_idStringDashed UUID
usernameStringUsername
coinsInt32Current coin balance
experienceInt32Network experience (used to calculate level)
punishmentsArray (Punishment)List of active and past punishments
achievementsArray (empty)List of earned achievements (not implemented yet)
statisticsList of tracked statistics
cosmeticsArray (Cosmetic)List of owned cosmetics and whether they are currently equipped
lastJoinDateInt64The last time the player’s data was loaded as a Unix timestamp

Supplemental Structure Types

Punishment

Represents an active or expired punishment.

PropertyBSON TypeDescription
typeStringEither BAN or MUTE
idStringA UUID (with dashes) that uniquely identifies the punishment
issuedAtInt64The time the punishment was issued, represented as a Unix timestamp
expiresAtInt64The time the punishment will expire/has expired, represented as a Unix timestamp
moderatorStringThe UUID of the player which enacted the punishment
reasonStringA short string description of why the punishment was enacted, provided by the moderator.
activeBoolA boolean representing whether the punishment is currently effective

The active field allows a manual override of the punishment. Even if active is set to true on a punishment, the expiration date should be checked. If the has passed, the punishment should not affect the player.

Cosmetic

Represents a cosmetic that a player owns.

PropertyBSON TypeDescription
idStringA string identifier for the cosmetic
activeStringWhether the cosmetic is equipped or not