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

Conversation

@ammodev
Copy link
Contributor

@ammodev ammodev commented Jul 24, 2025

This pull request primarily focuses on code cleanup, dependency updates, and the removal of unused or redundant utilities. The changes improve maintainability by removing outdated or unnecessary code and consolidating utility functions into a central module. Below is a summary of the most important changes:

Dependency and Plugin Cleanup

  • Removed unused dependencies and commented-out plugin configurations from buildSrc/build.gradle.kts and buildSrc/src/main/kotlin/core-convention.gradle.kts. This includes outdated Kotlin and Dokka dependencies. [1] [2]

Utility Consolidation

  • Removed the fast-util-util.kt file, which contained various utility functions for collections, and replaced its usage with imports from a centralized utility module (surfapi.core.api.util). [1] [2] [3] [4] [5] [6] [7]

Code Simplification

  • Deleted the TestPacket class and associated metadata, which were no longer in use.
  • Removed the dokka-convention.gradle.kts file, which contained unused Dokka documentation generation configurations.

Dependency Version Cleanup

  • Removed unused and commented-out dependency version entries from gradle/libs.versions.toml, including discord-webhooks, ehcache, and others. [1] [2]

Minor Adjustments

  • Added a new method mutableObjectSetOf to the Playtime interface to align with the updated utility imports.

Copilot AI review requested due to automatic review settings July 24, 2025 17:51
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.

Pull Request Overview

This pull request removes dead code and dependency cleanup, focusing on modernizing imports by consolidating utility functions from a deprecated fast-util-util.kt file into the centralized surfapi.core.api.util module. Additionally, it includes removal of commented-out and unused code, packaging restructuring for network protocol packets, and minor code formatting improvements.

  • Replaces deprecated dev.slne.surf.cloud.api.common.util imports with surfapi.core.api.util imports
  • Removes commented-out and unused code throughout the codebase
  • Restructures network protocol packets into organized subdirectories (clientbound, serverbound, bidirectional)

Reviewed Changes

Copilot reviewed 278 out of 279 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
surf-cloud-velocity/src/main/kotlin/.../VelocityListenerProcessor.kt Updates import for mutableObjectSetOf to use centralized utility
surf-cloud-velocity/src/main/kotlin/.../VelocityClientCloudPlayerImpl.kt Fixes import path for SilentDisconnectPlayerPacket and adds TODO comment
surf-cloud-standalone/src/main/kotlin/.../test/*.kt Removes entire test classes that are no longer used
surf-cloud-standalone/src/main/kotlin/.../player/StandaloneCloudPlayerImpl.kt Updates imports to use new packet organization structure
surf-cloud-core/.../playtime/PlaytimeImpl.kt Adds new mutableObjectSetOf method to interface implementation

Playtime {

override fun mutableObjectSetOf(): ObjectSet<String> {
TODO("Implement me")
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

The mutableObjectSetOf() method contains a TODO("Implement me") which indicates incomplete implementation. This method should be properly implemented or removed if not needed.

Suggested change
TODO("Implement me")
return it.unimi.dsi.fastutil.objects.ObjectOpenHashSet()

Copilot uses AI. Check for mistakes.
@AutoService(CloudPlayerManager::class)
class VelocityCloudPlayerManagerImpl :
CommonClientCloudPlayerManagerImpl<Player, VelocityClientCloudPlayerImpl>() {
CommonClientCloudPlayerManagerImpl<Player, VelocityClientCloudPlayerImpl>() { // FIXME: 24.07.2025 19:39 implement missing code
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

FIXME comment indicates missing implementation that needs to be addressed before production deployment.

Copilot uses AI. Check for mistakes.
Comment on lines +13 to 14
name // FIXME: 24.07.2025 19:40 implement missing code
) {
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

FIXME comment indicates missing implementation that needs to be addressed before production deployment.

Suggested change
name // FIXME: 24.07.2025 19:40 implement missing code
) {
validateName(name) // Validate the name before passing it to the superclass constructor
) {
companion object {
private fun validateName(name: String): String {
require(name.isNotBlank()) { "Player name cannot be blank or empty." }
require(name.length <= 16) { "Player name cannot exceed 16 characters." }
require(name.all { it.isLetterOrDigit() || it == '_' }) { "Player name can only contain letters, digits, or underscores." }
return name
}
}

Copilot uses AI. Check for mistakes.
override suspend fun playtime(): Playtime {
return player?.playtime() ?: service.loadPlaytimeEntries(uuid)
.let { if (it.isEmpty()) PlaytimeImpl.EMPTY else PlaytimeImpl(it) }
.let { if (it.isEmpty()) PlaytimeImpl.EMPTY else PlaytimeImpl(it) } // FIXME: 24.07.2025 19:34 implement missing code
Copy link

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

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

FIXME comment indicates missing implementation that needs to be addressed before production deployment.

Suggested change
.let { if (it.isEmpty()) PlaytimeImpl.EMPTY else PlaytimeImpl(it) } // FIXME: 24.07.2025 19:34 implement missing code
.let { entries ->
if (entries.isEmpty()) {
PlaytimeImpl.EMPTY
} else {
// Process and validate playtime entries before creating PlaytimeImpl
val validEntries = entries.filter { it.isValid() } // Assuming isValid() checks entry validity
if (validEntries.isEmpty()) PlaytimeImpl.EMPTY else PlaytimeImpl(validEntries)
}
}

Copilot uses AI. Check for mistakes.
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.

3 participants