Skip to content

Implement MineChat spec v1.0.0, and improve performance & storage#2

Merged
walker84837 merged 30 commits into
mainfrom
refactor/performance-optimizations
Mar 14, 2026
Merged

Implement MineChat spec v1.0.0, and improve performance & storage#2
walker84837 merged 30 commits into
mainfrom
refactor/performance-optimizations

Conversation

@walker84837
Copy link
Copy Markdown
Collaborator

@walker84837 walker84837 commented May 13, 2025

  • Write GitHub Actions file to make a new release and upload the JAR when a new tag is made
  • Improve the usage of Caffeine
  • Reduce boilerplate
  • Improve performance
    • Consider replacing thread pool with thread executor for virtual threads

@walker84837 walker84837 added enhancement New feature or request good first issue Good for newcomers labels May 13, 2025
- 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
@walker84837 walker84837 force-pushed the refactor/performance-optimizations branch from 27a715e to cc9e154 Compare December 22, 2025 15:46
Changes include following the MineChat v1.0 specification
@walker84837 walker84837 force-pushed the refactor/performance-optimizations branch from cc9e154 to 96deaa3 Compare December 23, 2025 07:07
@walker84837 walker84837 force-pushed the refactor/performance-optimizations branch from e523da7 to 19facef Compare December 23, 2025 09:00
@walker84837 walker84837 changed the title Reduce GC allocations and improve GH automation Reduce GC allocations and improve GitHub automation Jan 7, 2026
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
@walker84837 walker84837 changed the title Reduce GC allocations and improve GitHub automation Implement MineChat spec v1.0.0, and improve performance & storage Mar 12, 2026
- 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
@walker84837 walker84837 marked this pull request as ready for review March 14, 2026 12:49
@walker84837 walker84837 merged commit 1345663 into main Mar 14, 2026
1 check passed
@walker84837 walker84837 deleted the refactor/performance-optimizations branch March 14, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant