Skip to content
This repository was archived by the owner on Dec 10, 2025. It is now read-only.

Conversation

@twisti-dev
Copy link
Contributor

This pull request introduces a new TestPacket class and integrates it into various parts of the project. The changes include adding dependencies, creating the TestPacket class, updating build files, and adding handling and sending capabilities for the new packet.

New TestPacket class and related integrations:

  • Creation of TestPacket class:

    • Added TestPacket class with various fields and methods in surf-cloud-api/surf-cloud-api-common/api/surf-cloud-api-common.api.
    • Implemented TestPacket class in Kotlin with serialization and companion object methods in surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/TestPacket.kt.
  • Dependency updates:

    • Added kotlin-byte-buf-serializer dependency in gradle/libs.versions.toml. [1] [2]
    • Included kotlin-byte-buf-serializer in surf-cloud-api/surf-cloud-api-common/build.gradle.kts with an exclusion for io.netty.
  • Packet handling and sending:

    • Updated packet-extension.kt to support serialization and deserialization of TestPacket using Buf. [1] [2]
    • Added command to send TestPacket in BukkitMain.kt and imported necessary classes. [1] [2]
    • Created a listener for TestPacket in TestPacketListener.kt to log received packets.

@twisti-dev twisti-dev requested a review from Copilot April 8, 2025 21:18
@twisti-dev twisti-dev linked an issue Apr 8, 2025 that may be closed by this pull request
@twisti-dev twisti-dev self-assigned this Apr 8, 2025
@twisti-dev twisti-dev merged commit 00f71b5 into master Apr 8, 2025
@twisti-dev twisti-dev deleted the 24-support-kotlin-serialization-for-netty-packets branch April 8, 2025 21:19
Copy link
Contributor

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.

Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (2)
  • surf-cloud-api/surf-cloud-api-common/api/surf-cloud-api-common.api: Language not supported
  • surf-cloud-api/surf-cloud-api-common/build.gradle.kts: Language not supported
Comments suppressed due to low confidence (3)

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/TestPacket.kt:13

  • [nitpick] The field name 'boolean' is ambiguous; consider renaming it to a more descriptive name such as 'flag' or 'isActive'.
val boolean: Boolean,

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/TestPacket.kt:15

  • [nitpick] The field name 'map' is generic; consider renaming it to something more descriptive like 'dataMap' or 'attributeMap'.
val map: Map<String, String>,

surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/netty/packet/packet-extension.kt:89

  • The unchecked cast to KSerializer may lead to runtime issues if the serializer type is not compatible; ensure that the cast is safe or add an appropriate check.
Buf.encodeToBuf(buf, serializer as KSerializer<V>, value)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Kotlin Serialization for Netty Packets

2 participants