-
Notifications
You must be signed in to change notification settings - Fork 0
Remove dead code and add add todos #87
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.utilimports withsurfapi.core.api.utilimports - 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") |
Copilot
AI
Jul 24, 2025
There was a problem hiding this comment.
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.
| TODO("Implement me") | |
| return it.unimi.dsi.fastutil.objects.ObjectOpenHashSet() |
| @AutoService(CloudPlayerManager::class) | ||
| class VelocityCloudPlayerManagerImpl : | ||
| CommonClientCloudPlayerManagerImpl<Player, VelocityClientCloudPlayerImpl>() { | ||
| CommonClientCloudPlayerManagerImpl<Player, VelocityClientCloudPlayerImpl>() { // FIXME: 24.07.2025 19:39 implement missing code |
Copilot
AI
Jul 24, 2025
There was a problem hiding this comment.
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.
| name // FIXME: 24.07.2025 19:40 implement missing code | ||
| ) { |
Copilot
AI
Jul 24, 2025
There was a problem hiding this comment.
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.
| 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 | |
| } | |
| } |
| 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 |
Copilot
AI
Jul 24, 2025
There was a problem hiding this comment.
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.
| .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) | |
| } | |
| } |
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
buildSrc/build.gradle.ktsandbuildSrc/src/main/kotlin/core-convention.gradle.kts. This includes outdated Kotlin and Dokka dependencies. [1] [2]Utility Consolidation
fast-util-util.ktfile, 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
TestPacketclass and associated metadata, which were no longer in use.dokka-convention.gradle.ktsfile, which contained unused Dokka documentation generation configurations.Dependency Version Cleanup
gradle/libs.versions.toml, includingdiscord-webhooks,ehcache, and others. [1] [2]Minor Adjustments
mutableObjectSetOfto thePlaytimeinterface to align with the updated utility imports.