Data Model
The schema lives in Moondog.Core and is created with EF Core migrations.
Entities
User
- Identity fields via ASP.NET Core Identity
DisplayNameRole(PlayerorAdmin)CreatedAt,LastLoginAt
Character
- User ownership
- name (unique), class, level, experience, health
- 3D transform (
PosX,PosY,PosZ,RotY, velocities) - zone id
- created/updated timestamps
Session
- user/character linkage
- server id
- IP address
- connected/disconnected timestamps
Ban
- user id
- reason
- active flag
- optional expiry
- creator
ServerStatus
- name (unique)
- state (
Online,Maintenance,Draining,Offline) - online players
- max players
- heartbeat
ServerCommand
- type
- JSON payload
- requesting user
- status and acknowledgement metadata
ChatMessage
- character
- zone
- text
- timestamp
AuditLog
- actor
- action
- target type/id
- JSON details
- timestamp
Important indexes and constraints
- Character name is unique.
- Server status name is unique.
- Character belongs to user with cascade delete.
- Sessions and bans use foreign keys to users.
JSON payloads
Commands and audit details are stored as jsonb/text to keep the control protocol flexible.