Implement MineChat spec v1.0.0, and improve performance & storage#2
Merged
Conversation
- Add ObjectBox and dependencies in build.gradle.kts and settings.gradle.kts - Replace JSON + in-memory caching with ObjectBox persistent storage for clients, bans and link codes - Implement UuidConverter for ObjectBox UUID support - Refactor ClientConnection to use CBOR + Zstd for communication - Update MineChatServerPlugin to use ObjectBox storage, adding: - Ban commands - TLS support for server socket - Removal of legacy Gson-based storage - Minor fixes and repository updates in build.gradle.kts
27a715e to
cc9e154
Compare
Changes include following the MineChat v1.0 specification
cc9e154 to
96deaa3
Compare
e523da7 to
19facef
Compare
Updated comment to indicate future RTT calculation implementation.
Replace Jackson CBOR with kotlinx.serialization CBOR to simplify packet encoding/decoding and reduce runtime reflection. The protocol envelope now stores raw CBOR payload bytes, allowing payloads to be decoded only when needed and improving efficiency. Summary of changes: - Replace Jackson CBOR with kotlinx.serialization CBOR - Add kotlinx-serialization-cbor dependency - Convert protocol models to @serializable - Store packet payloads as raw CBOR byte arrays - Update client packet encode/decode logic - Add generic sendMessage with reified serialization - Implement plugin-level broadcast serialization - Enforce LINK_OK -> CAPABILITIES -> AUTH_OK auth flow - Track client RTT via PING/PONG handling - Add moderation packets for ban and kick events - Add basic Markdown serializer for chat content - Broadcast moderation and admin reload events - Improve error handling and socket shutdown safety
- Implement Markdown parsing from client - Add broadcasting messages with gradients - Implement moderation enforcement
This commit improves packet processing robustness and debugging by adding detailed logging, safer error handling, and reconnection support for previously authenticated clients. Summary of changes: - Change zstd-jni dependency from compileOnly to implementation (will be added to the logger soon) - Add exhaustive packet processing and compression debug logging - Catch Zstd and CBOR deserialization errors explicitly - Handle EOFException for normal client disconnects - Implement client reconnection using empty link code - Simplify CBOR serialization calls across the codebase - Move MineChatPacket serializer into the class companion - Remove unused serialization annotations and imports - Rename MineChatPluginServices to PluginServices - Improve command feedback messages and placeholders - Change reload command to "minechat-reload" - Fix gradient broadcast message formatting
MiniMessage was instantiated directly in ClientConnection, bypassing the plugin-managed instance and causing unnecessary object allocation. This centralizes MiniMessage usage and removes redundant dependencies. Summary of changes: - Use plugin.miniMessage instead of new MiniMessage instance - Remove MiniMessage import from ClientConnection - Remove unused ExecutorService parameter from constructor as ClientConnection uses its per-instance one - Update ClientConnection instantiation in plugin - Refactor MarkdownSerializer parsing logic - Simplify deserialize implementation - Replace remaining/currentText with index-based parsing - Add buffer flushing helper for cleaner component building - Add helper for applying text decorations - Improve token detection for markdown markers - Simplify serialization decoration handling
TLS configuration was updated to use modern defaults and improve security. The plugin now expects a PKCS12 keystore and enforces TLS 1.3 for all connections. Summary of changes: - Switch keystore format from JKS to PKCS12 - Update README instructions for EC secp384r1 keystore generation - Enforce TLS 1.3 on the SSL server socket - Rename MineChatServerPlugin to MineChatPlugin - Rename MineChatCommandRegister to CommandRegister - Update default config keystore name to keystore.p12 - Refactor MavenLibraryResolver dependency setup - Update caffeine version to 3.2.0 - Change zstd-jni dependency to compileOnly - Clean up imports and minor build script improvements
Dependencies were previously declared inline in the build script, which made version management harder and duplicated version information. Moving them to the Gradle version catalog centralizes dependency versions and improves maintainability. Summary of changes: - Move dependency versions to libs.versions.toml - Replace inline dependency declarations with catalog refs - Add library mappings for all dependencies - Add version entries for zstd-jni, objectbox, paper, kotlin - Add version entries for asynccraftr, jackson, and junit - Remove outdated TODO comments in build.gradle.kts - Remove generated comments from Gradle config files
This commit removes unused functions and resolves compiler warnings while adding KDoc documentation to clarify responsibilities of core classes and interfaces. Summary of changes: * Add KDoc documentation to ClientConnection and its run method * Add KDoc documentation to PluginServices interface * Remove unused sendMessage overloads in ClientConnection * Remove unused remove method from ClientStorage * Fix unused constructor property in LinkCodeStorage * Clean up TODO comments related to resolved warnings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.