Implements a DbBuilder class to streamline the creation of database connections for both SQLite and MySQL storage types.
Enhances error handling for database setup and ensures that necessary directories are created dynamically based on configuration settings.
This refactor improves code maintainability and readability, consolidating connection logic into a dedicated builder class.
This also kicks those who never finish handshaking upon chat now. (To free up the resources a bit I guess?)
Before a player finishes the connection handshake, the server will check if it's necessary to send them a packet - it checks against a list of necessary packets like:
- ContinueConnecting (Send User Slot),
- PlayerSpawnSelf (CompleteConnectionAndSpawn),
- WorldInfo (Which the server does a further check if the player is at the appropriate state to be sent the world info)
- Status
- Disconnection
- TileFrameSection & TileSendSection
- The player will only finish the handshake once they spawn their player, a normal client would always do this eventually.
- They cannot chat, even if they request world data but just not spawn their player.
- Other clients will not be notified of their join/leave in both cases (dont request WD or do but dont spawn)
- And most importantly, they do not show on the in game player list but still show on the server console /playing cmd.
The `AchievementTagHandler` expects `Main.Achievements` to be non-null,
which is not normally the case on dedicated servers. When trying to
parse an achievement chat tag, it will instead throw.
The tag is parsed when calling `ChatManager.ParseMessage`, which is used
in TShock when writing chat messages to the console. Our `OnChat`
handler uses `Utils.Broadcast`, which will send the message to all
connected clients, write the message to the console and the log. Due to
the order of execution, the message ends up being sent to all connected
clients, but throws whilst trying to write to the console, and never
gets written to the log.
To solve the issue, we make achievements available on the server,
allowing the tag handler to work as expected, and even allowing the
localization of achievements names to appear in the console.
This allows the tshock tile providers to be switched via the config instead of cli args via tsapi, for environments where the command line args cannot be changed.