This repository was archived by the owner on Dec 10, 2025. It is now read-only.
feat: introduce AfkStateChangeEvent for AFK state tracking#98
Merged
twisti-dev merged 2 commits intomasterfrom Aug 16, 2025
Merged
feat: introduce AfkStateChangeEvent for AFK state tracking#98twisti-dev merged 2 commits intomasterfrom
AfkStateChangeEvent for AFK state tracking#98twisti-dev merged 2 commits intomasterfrom
Conversation
- Added `AfkStateChangeEvent` to track player AFK state changes. - Updated player implementation to use `AtomicBoolean` for thread-safe AFK state management. - Integrated `AfkStateChangeEvent` posting in AFK state update logic across client and standalone modules.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new event system for tracking AFK (Away From Keyboard) state changes and improves thread safety in AFK state management. The implementation adds proper event notification when players transition between AFK and active states.
- Added
AfkStateChangeEventto notify when player AFK status changes - Replaced simple boolean with
AtomicBooleanfor thread-safe AFK state management in standalone implementation - Integrated event posting in both client and standalone modules when AFK state updates
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| surf-cloud-api/surf-cloud-api-common/src/main/kotlin/dev/slne/surf/cloud/api/common/event/player/afk/AfkStateChangeEvent.kt | Defines the new event class for AFK state changes |
| surf-cloud-standalone/src/main/kotlin/dev/slne/surf/cloud/standalone/player/StandaloneCloudPlayerImpl.kt | Updates AFK state management to use AtomicBoolean and posts AfkStateChangeEvent |
| surf-cloud-core/surf-cloud-core-client/src/main/kotlin/dev/slne/surf/cloud/core/client/netty/network/ClientRunningPacketListenerImpl.kt | Adds event posting when receiving AFK state updates via network packets |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
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.
AfkStateChangeEventto track player AFK state changes.AtomicBooleanfor thread-safe AFK state management.AfkStateChangeEventposting in AFK state update logic across client and standalone modules.