Skip to content

Add legacy offline-mode Minecraft protocol (protocol 47) connection and session manager, wire UI quick-connect - #1

Merged
WieszczY85 merged 1 commit into
mainfrom
syntaxdevteam-improvements/sprawdz-dokumentacje-aplikacji
Sep 30, 2026
Merged

WieszczY85 merged 1 commit into
mainfrom
syntaxdevteam-improvements/sprawdz-dokumentacje-aplikacji

Conversation

@WieszczY85

Copy link
Copy Markdown
Member

Motivation

  • Provide a minimal, packet-independent networking slice that can perform offline-mode login and basic play handling for Minecraft Java protocol 47 so the app can connect to legacy servers or proxies.
  • Introduce an observable session lifecycle and safe domain error mapping so UI can react to connection state changes without depending on packet types.
  • Surface a quick-connect UI path for direct TCP connections to a server endpoint using a username so the prototype can demonstrate end-to-end chat/command flow.

Description

  • Add a new packet codec and legacy protocol adapter: protocol/legacy/ProtocolCodec.kt and LegacyOfflineMinecraftConnection implementing MinecraftConnection with handshake, login, compression negotiation, keep-alive replies, position acknowledgement, chat and command sending, and typed MinecraftConnectionException results.
  • Introduce a session domain contract and models in domain/session including SessionManager, SessionManagerFactory, SessionSnapshot, ConnectionState, SessionError and SessionEvent.
  • Implement DefaultSessionManager (and DefaultSessionManagerFactory) which serializes lifecycle operations, publishes StateFlow/SharedFlow, and maps MinecraftConnectionException to SessionError values.
  • Wire UI to the new session API: CraftConnectApp now accepts a SessionManagerFactory, ServersScreen includes an offline quick-connect dialog and accepts a ConnectionState, and ChatScreen accepts an onSend callback hooked to SessionManager send methods; DemoRepository and resources/README/ARCHITECTURE updates document the change.
  • Update build configuration to add coroutines and test dependencies in gradle/libs.versions.toml and app/build.gradle.kts.

Testing

  • Added unit tests DefaultSessionManagerTest, ProtocolCodecTest and an integration-style local-socket test LegacyOfflineMinecraftConnectionTest under app/src/test and executed them via the Gradle test task (e.g. ./gradlew :app:testDebugUnitTest).
  • All added tests passed successfully.

Codex Task

@WieszczY85
WieszczY85 merged commit 5d2d876 into main Sep 30, 2026
1 check failed
@WieszczY85
WieszczY85 deleted the syntaxdevteam-improvements/sprawdz-dokumentacje-aplikacji branch September 30, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant