Skip to content

feat: offline player service #782

Open
IWareQ wants to merge 11 commits intomasterfrom
feat/offline-player
Open

feat: offline player service #782
IWareQ wants to merge 11 commits intomasterfrom
feat/offline-player

Conversation

@IWareQ
Copy link
Member

@IWareQ IWareQ commented Jan 8, 2026

Closes: #605

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

❌ Patch coverage is 60.71429% with 110 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...java/org/allaymc/server/player/AllayLoginData.java 0.00% 27 Missing ⚠️
...laymc/server/player/AllayOfflinePlayerManager.java 86.52% 10 Missing and 9 partials ⚠️
...laymc/server/player/AllayNBTFilePlayerStorage.java 41.93% 17 Missing and 1 partial ⚠️
.../org/allaymc/server/player/AllayOfflinePlayer.java 61.76% 12 Missing and 1 partial ⚠️
.../network/processor/login/LoginPacketProcessor.java 0.00% 12 Missing ⚠️
...c/main/java/org/allaymc/api/player/PlayerData.java 60.00% 4 Missing ⚠️
...rc/main/java/org/allaymc/api/player/LoginData.java 0.00% 3 Missing ⚠️
...a/org/allaymc/api/player/OfflinePlayerManager.java 0.00% 3 Missing ⚠️
...i/src/main/java/org/allaymc/api/player/Player.java 0.00% 3 Missing ⚠️
...ain/java/org/allaymc/api/player/PlayerStorage.java 0.00% 3 Missing ⚠️
... and 4 more
Files with missing lines Coverage Δ Complexity Δ
...ain/java/org/allaymc/api/player/OfflinePlayer.java 66.66% <66.66%> (ø) 1.00 <1.00> (?)
.../src/main/java/org/allaymc/server/AllayServer.java 50.41% <75.00%> (+1.26%) 11.00 <0.00> (ø)
...in/java/org/allaymc/server/player/AllayPlayer.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
.../org/allaymc/server/player/AllayPlayerManager.java 17.60% <60.00%> (+0.33%) 3.00 <1.00> (ø)
...rc/main/java/org/allaymc/api/player/LoginData.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...a/org/allaymc/api/player/OfflinePlayerManager.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...i/src/main/java/org/allaymc/api/player/Player.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...ain/java/org/allaymc/api/player/PlayerStorage.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...c/main/java/org/allaymc/api/player/PlayerData.java 66.66% <60.00%> (+66.66%) 4.00 <0.00> (+4.00)
.../network/processor/login/LoginPacketProcessor.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
... and 4 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@smartcmd
Copy link
Member

smartcmd commented Jan 9, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

writeVector3f(builder, "Pos", currentPos);
playerData.setNbt(builder.build());
// Save new player data back to storage
playerManager.getPlayerStorage().savePlayerData(this.loginData.getUuid(), playerData);

P1 Badge Save corrected data using storage UUID

PlayerStorage now uses the per-player storage UUID, but this branch still writes the corrected NBT back under loginData.getUuid(). When the storage UUID differs (which it will after the offline service assigns a random storage UUID), the fix is persisted to the wrong file, leaving the real player data unchanged and creating orphaned files; the player will continue to respawn in the invalid world/dimension on subsequent logins. Use player.getStorageUuid() (or savePlayerData(player)) here.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@IWareQ IWareQ requested a review from smartcmd January 9, 2026 11:52
@smartcmd
Copy link
Member

smartcmd commented Jan 10, 2026

I think the new system involved in this PR is too complicated, and the feature we really need is really just to get the player's name via uuid, which is enough. What your idea (?

We could just add a getPlayerName(UUID uuid) method to the existing PlayerStorage class

@IWareQ
Copy link
Member Author

IWareQ commented Jan 10, 2026

What is the point of getting a player’s name from a UUID if the developer still has to work with “raw” data anyway? That’s not a very good solution.
I’ve also seen many projects where developers implemented their own nickname systems, and because Nukkit and its forks can’t properly update nicknames, this caused a lot of problems.
Searching by XUID is much more convenient since it is unique, and the developer doesn’t have to worry about data being lost or going out of sync under certain conditions.

@smartcmd smartcmd added this to the 0.10.5 (API 0.22.0) Release milestone Jan 12, 2026
@smartcmd smartcmd moved this to In progress in Allay Roadmap Jan 12, 2026
@smartcmd smartcmd moved this from In progress to In review in Allay Roadmap Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

proposal: add a way to get the name of offline player by its uuid

2 participants