Skip to content

Log the Floodgate login message after the handshake instead of on join - #688

Open
eduardomazolini wants to merge 1 commit into
GeyserMC:masterfrom
eduardomazolini:feat/log-uuid-on-handshake
Open

eduardomazolini wants to merge 1 commit into
GeyserMC:masterfrom
eduardomazolini:feat/log-uuid-on-handshake

Conversation

@eduardomazolini

Copy link
Copy Markdown

Resolves the todo in SpigotListener / BungeeListener:

we should probably move this log message earlier in the process, so that we know that Floodgate has done its job

Why

floodgate.ingame.login_name ("Floodgate player logged in as X joined (UUID: ...)") was only logged on join (Spigot) or login (Bungee). A Bedrock player refused before that, for example by the server whitelist, therefore never had their Floodgate UUID printed anywhere:

[Geyser-Spigot] Player connected with username SomePlayer (...)
Disconnecting /1.2.3.4:0: You are not whitelisted on this server!
[floodgate] Floodgate player logged in as .SomePlayer disconnected

Together with #304 (the Global API not knowing every gamertag yet), this left server owners without a simple way to whitelist a Bedrock player who already tried to join: the UUID needed for whitelist.json / fwhitelist add <uuid> was not in the console.

Related: #304 (fwhitelist add <name> fails when the Global API does not know the gamertag) and #357 (whitelisting players that never joined). This PR does not change the name lookup; it makes the UUID of anyone who already tried to join available, so fwhitelist add <uuid> can be used meanwhile.

What

  • Log floodgate.ingame.login_name in FloodgateHandshakeHandler, right after the player has been verified and added (only when the handshake does not disconnect them).
  • Remove the now duplicated log calls from SpigotListener and BungeeListener.
  • Velocity, which did not log this message before, now logs it as well.

The message key and its translations are unchanged.

Testing

  • ./gradlew build passes.
  • On a Paper 26.2 server (Geyser 2.11.3, whitelist on), with this build:
    • a Bedrock player not on the whitelist (and not an operator) now has the UUID logged before the kick:
      [floodgate] Floodgate player logged in as .X joined (UUID: 00000000-0000-0000-0009-...)
      Disconnecting /...: You are not whitelisted on this server!
      
    • a whitelisted Bedrock player gets that line once, right after the handshake (2 s before "joined the game"),
      with no duplicate from the listener.

The "Floodgate player logged in as X joined (UUID: ...)" message was only
logged on join (Spigot) / login (Bungee), so it never showed up for Bedrock
players that are refused before that, for example by the server whitelist.
Their Floodgate UUID was then nowhere in the console, and since the Global
API does not always know the gamertag yet, there was no easy way to
whitelist them.

Log it right after Floodgate has verified the player in the handshake, as
the existing todo suggested. This also covers Velocity, which did not log
this message before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant