Minecraft 26.2#1807
Conversation
Looking at the src the client now uses the I haven't done any testing, but the old 26.1 client should only return true for |
|
In
If // minecraft:color renamed to minecraft:team_color in 26.2
empty(id("minecraft:color", mapSet(MINECRAFT_26_2, -1), mapSet(MINECRAFT_1_19, 16)));
...
empty(id("minecraft:team_color", mapSet(MINECRAFT_26_2, 16))); // renamed from color in 26.2That makes ID 16 resolve to |
| success.setProperties(player.getGameProfileProperties()); | ||
| success.setUuid(player.getUniqueId()); | ||
| if (inbound.getProtocolVersion().noLessThan(ProtocolVersion.MINECRAFT_26_2)) { | ||
| success.setSessionId(UUID.randomUUID()); // use random uuid for now |
There was a problem hiding this comment.
Interestingly, mojang seems to be a "use the same session ID for everybody but regenerate it when the server is empty"
https://mcsrc.dev/1/26.2-rc-2/net/minecraft/server/network/ServerConnectionListener#L225
https://mcsrc.dev/1/26.2-rc-2/net/minecraft/server/network/ServerConnectionListener#L241
This is used purely for metrics on mojangs side, I guess the "good behavior" here would probably be to reproduce that logic
There was a problem hiding this comment.
I'm wondering what Mojang sees as a "session" in this case. Does a new session occur the moment the last player online disconnects (or the moment the first player connects, going from 0 -> 1 players, effectively the same), or does a new session only occur when the server was "paused" due to it being empty (correct me if I'm wrong, but a vanilla server should pause processing ticks after no players have been online for x seconds (30?))
If it's the latter that's harder to match in Velocity... Though regardless, if the client expects the session ID to be the same for everyone connected at the same time, it's most likely better to match this behavior. Easiest is to just generate a session ID on boot.
There was a problem hiding this comment.
(or uh, grab the session ID from the backend? is that possible here? why do we need to generate our own in velocity land?)
There was a problem hiding this comment.
session ID is sent from the proxy long before we have a backend, so that's not an option;
And I guess their modal is basically single player servers where people join in the eveing, have a "play session" together, and leave, and come back in a day or a few hours or whatever. For a larger server which always had players on that would always be shared
There was a problem hiding this comment.
Then again, doesn't really translate to proxies, do we just sent 0,0? I'll ask mojang...
There was a problem hiding this comment.
I have a hunch the session ID will be used in the new friends feature that got dropped from the 26.2 release. I'd guess you would be able to easily add players that are on the same server as you. As this will be done through Mojang's own API, the client can just report the session UUID it got from the connected server, and Mojang can match players against the same session UUID and consider them in the same server.
This would break with the current random UUID per connection approach (and also a zero UUID as youre suggesting). Though, it might also be useful for plugins to be able to control this. I could imagine a feature where certain players want to turn this off (staff? content people?). A plugin would be able to check a permission, and override the session UUID with a random one. Though that's all assuming it will be used for the dropped social/friends feature.
|
@electronicboy beat me by 11 minutes, but I had also dug into the duplicate registration -- tl;dr it works as-is but it's a bit fragile, and there's a cleaner way to express it. It's not actually problematic on the wire. It looks like this is a rename rather than an insertion too, so Mojang just renamed slot 16 color -> team_color in 26.2. For 1.19+ the string identifier is purely cosmetic. What I'd suggest is overloading
Since this touches |
|
Yea, I mean, on the wire it doesn't matter but can be an odd moment when debugging it, I'd rather just keep it as two seperate enteries for the sake of not having to worry about that, being able to read back the data when debugging is nice rather than tripping myself up because the id is unexpected I did in part just want to give claude a spin here |
I agree! Retiring the 1.19 - 26.1 registration in favor of this rename for 26.2+ is the canonical solution, ignore my comment :) |
No description provided.