Skip to content

feat: Implement versioning, use for gear sharing#16

Merged
ShadowCat117 merged 1 commit intomasterfrom
versioning
Oct 16, 2025
Merged

feat: Implement versioning, use for gear sharing#16
ShadowCat117 merged 1 commit intomasterfrom
versioning

Conversation

@ShadowCat117
Copy link
Copy Markdown
Member

@ShadowCat117 ShadowCat117 commented Oct 14, 2025

@DevScyu DevScyu requested review from DevScyu and Copilot October 14, 2025 22:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Implements versioning system for the Hades protocol to support gear sharing functionality. The PR adds version tracking to authentication packets and establishes a foundation for protocol compatibility management.

  • Adds HadesVersion enum with UNKNOWN and VERSION_0_6_1 values
  • Modifies HCPacketAuthenticate to include version field with backward compatibility
  • Implements optional version reading/writing in packet serialization

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
HadesVersion.java New enum defining protocol versions including gear sharing support
HCPacketAuthenticate.java Updated to include version field with backward-compatible serialization

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Override
public void writeData(HadesBuffer buffer) {
buffer.writeString(token);
buffer.writeEnum(version);
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The writeData method always writes the version, but readData only reads it conditionally. This creates an asymmetric serialization pattern that could cause deserialization issues when version is null or when communicating with older clients that don't expect the version field.

Suggested change
buffer.writeEnum(version);
if (version != null && version != HadesVersion.UNKNOWN) {
buffer.writeEnum(version);
}

Copilot uses AI. Check for mistakes.
public HCPacketAuthenticate() { }

public HCPacketAuthenticate(String token) {
this.token = token;
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The single-parameter constructor doesn't initialize the version field, leaving it null. This will cause a NullPointerException when writeData calls buffer.writeEnum(version) with a null value.

Suggested change
this.token = token;
this.token = token;
this.version = HadesVersion.UNKNOWN;

Copilot uses AI. Check for mistakes.
@ShadowCat117 ShadowCat117 merged commit bd46060 into master Oct 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants