This repository was archived by the owner on Dec 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/player cache #107
Merged
Merged
Feat/player cache #107
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added `CloudPlayerCacheImpl` as the core implementation of player caching. - Introduced various cache types: `CacheListImpl`, `CacheSetImpl`, `CacheMapImpl`, and `CacheStructuredImpl` for structured data handling. - Developed `EntryMeta` to manage cache entry metadata, supporting multiple entry types. - Implemented delta packets (`PlayerCacheListDeltaPacket`, `PlayerCacheSetDeltaPacket`, etc.) for partial synchronization. - Created full synchronization packets (`PlayerCacheFullSyncPacket`, `PlayerCacheRequestFullSyncPacket`) to support player state consistency. - Included `ChangeCounter` for tracking cache mutations and ensuring synchronization accuracy. - Refactored `AdventureKeySerializer` to streamline serialization logic.
- Refactored `createIndexLookup` to use lambdas instead of `ToIntFunction` for improved Kotlin friendliness. - Introduced `ByIdMap` utility for sparse and continuous ID mapping with out-of-bounds strategies. - Updated `StringRepresentable` to replace `serializedName` property with a function for better extensibility. - Streamlined codecs with `idResolverCodec` and `orCompressed` for flexible encoding/decoding. - Added stubs for server and client cache handling operations to align with caching protocols. - Enhanced `PlayerCacheKeyRegistryImpl` and player cache packet listeners with method placeholders for synchronization.
…pplication customization - Introduced `FlywayDisabler` to handle dynamic Flyway configuration based on `StandaloneConfigHolder`. - Enhanced `StandaloneConfigHolder` to include Flyway-specific settings and a global configuration accessor. - Updated `PluginFlywayConfigurationCustomizer` with Flyway-related application customization. - Added `CloudSpringApplicationConfiguration` interface for modular Spring application configuration. - Centralized Flyway configuration logic with caching mechanisms for improved performance and reuse. - Refactored database configuration to include additional Flyway options.
- Introduced `PluginCommand` for managing and displaying plugin-related information via console commands. - Enhanced `Entrypoint` with a `toString` override for improved debug output. - Made `LaunchEntryPointHandler.get` function public to enable wider reuse within the application.
- Bumped `org.springframework.boot`, Netty, LuckPerms API, JLine, and other library versions for stability and improvements. - Refactored `FlywayDisabler` to `FlywayConfigurer` with support for custom Flyway configuration via `StandaloneConfigHolder`. - Simplified `PluginCommand` command registration logic and addressed minor redundant operations. - Removed unused `standalone-config.yml` reference in `CloudServerConfigProvider`.
- Updated element validation to ensure indices are within a continuous valid range. - Fixed incorrect object array creation for better type safety.
Contributor
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 PR introduces a comprehensive player cache system for the cloud platform, implementing caching mechanisms with network synchronization and persistence capabilities.
- Implements player cache infrastructure with server-side management and storage adapters
- Adds network protocols for cache operations, synchronization, and hydration
- Refactors configuration system for better database and Flyway management
Reviewed Changes
Copilot reviewed 92 out of 92 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| surf-cloud-standalone/.../FlywayConfigurer.kt | New Spring configuration for Flyway management |
| surf-cloud-standalone/.../ServerPlayerCacheManager.kt | Core server-side player cache management with operations and synchronization |
| surf-cloud-standalone/.../ServerPlayerCache.kt | Player cache implementation with concurrent operations and versioning |
| surf-cloud-standalone/.../StandaloneConfigHolder.kt | Configuration holder with Flyway enablement check |
| surf-cloud-core/.../PlayerCacheKeyRegistryImpl.kt | Implementation of cache key registry with TODO methods |
| surf-cloud-core/.../OperationCoders.kt | Encoding/decoding logic for cache operations |
| surf-cloud-core/.../ClientboundCacheDeltaPacket.kt | Network packet for cache delta synchronization |
| surf-cloud-api/.../CacheKey.kt | Interface definitions for different cache key types |
| surf-cloud-api/.../ByteBufCodecs.kt | Stream codecs for various data types including UUID, Sound, etc. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
...lone/src/main/kotlin/dev/slne/surf/cloud/standalone/player/cache/ServerPlayerCacheManager.kt
Show resolved
Hide resolved
...lone/src/main/kotlin/dev/slne/surf/cloud/standalone/player/cache/ServerPlayerCacheManager.kt
Show resolved
Hide resolved
...-standalone/src/main/kotlin/dev/slne/surf/cloud/standalone/player/cache/ServerPlayerCache.kt
Show resolved
Hide resolved
...in/kotlin/dev/slne/surf/cloud/standalone/netty/server/connection/ServerConnectionListener.kt
Show resolved
Hide resolved
...n/src/main/kotlin/dev/slne/surf/cloud/core/common/player/cache/PlayerCacheKeyRegistryImpl.kt
Show resolved
Hide resolved
...rc/main/kotlin/dev/slne/surf/cloud/standalone/ktor/routes/punish/create/CreatePunishRoute.kt
Show resolved
Hide resolved
...-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/util/StringRepresentable.kt
Show resolved
Hide resolved
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.