The library handles some basic player connection stuff.
This is primarly used to get and set unique id's on users that join the server.
When a player joins a user_account is created for them if one does not already exist, here we can track things like the users vip levels, bans, permissions ranks and so on.
Connections functions are server side only.
Database Tables
The user_accounts table will be created automatically on load if one does not already exist.
If you wish to add anything additional to the table you are free to do so.
local CREATE_TABLE =[[ CREATE TABLE IF NOT EXISTS `user_accounts` ( `id` int NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `unique_id` varchar(255) NOT NULL, `rank` varchar(255) NOT NULL DEFAULT 'civ', `vip` int(1) NOT NULL DEFAULT 0, `priority` int(11) NOT NULL DEFAULT 0, `character_slots` int(11) NOT NULL DEFAULT 2, `license` varchar(255) NOT NULL, `discord` varchar(255), `tokens` json NOT NULL, `ip` varchar(255) NOT NULL, `banned` boolean DEFAULT false, `banned_by` varchar(255) NOT NULL DEFAULT 'auto_ban', `reason` text DEFAULT NULL, `created` timestamp NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`unique_id`), KEY (`license`), KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;]]