Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for splitscreen players #3109

Closed
wants to merge 17 commits into from

Conversation

markmetcalfe
Copy link

@markmetcalfe markmetcalfe commented Jul 3, 2022

This is an updated version of mtsr@9f32f59 for 1.19 (thanks @mtsr for your work!)

Because the bug with console subclients not sending a XUID through still exists, I've had to implement a hack where the XUIDs (xbox IDs) need to be manually stored in the Geyser config settings. An example of what this might look like is:

# Settings for splitscreen players
splitscreen:
  enabled: true 
  # Mappings of console profiles to Bedrock accounts.
  # This is necessary due to a bug in console clients not sending enough auth data to the server.
  # To get the XUID for a player, check the server logs when they log in normally (not via splitscreen)
  users:
    Splitscreen Player One:
      bedrock-username: Xbox Gamertag One
      xuid: 0000000123456789
    Player2:
      bedrock-username: Xbox Gamertag Two
      xuid: 1234567890000000

I have tested this on Playstation 4, with 3 users able to play simultaneously via splitscreen. I have tested this on paper and waterfall, and I haven't noticed any issues.

This will fix #750

Copy link
Member

@Camotoy Camotoy left a comment

Choose a reason for hiding this comment

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

Just a quick pass-through. I'm not sure if I like the proposed workaround for users with no Xbox UUIDs - if this bug just affects guest accounts, then maybe we shouldn't support those for now anyway because it won't cooperate with Floodgate as-is.

@markmetcalfe
Copy link
Author

Just a quick pass-through. I'm not sure if I like the proposed workaround for users with no Xbox UUIDs - if this bug just affects guest accounts, then maybe we shouldn't support those for now anyway because it won't cooperate with Floodgate as-is.

@Camotoy I found that this issue affects any account used for splitscreen on PS4, even if the PS4 account is logged into a valid Microsoft account in Minecraft and has a PSN account. I agree with you that this isn't ideal - this is very much a temporary workaround. I plan to revisit this and improve it so that Geyser automatically fetches gamertag & xbox user ID information from the Xbox API rather than having the server owner manually defining the mappings.

@markmetcalfe markmetcalfe requested a review from Camotoy July 3, 2022 07:00
@mtsr
Copy link

mtsr commented Jul 3, 2022

I found that this issue affects any account used for splitscreen on PS4, even if the PS4 account is logged into a valid Microsoft account in Minecraft and has a PSN account.

It seems quite similar to Switch: with a family subscription to Nintendo Online, there's still no ID sent for the second player. And Switch doesn't even have guest users, afaik you can only play with precreated users.

I agree with you that this isn't ideal - this is very much a temporary workaround. I plan to revisit this and improve it so that Geyser automatically fetches gamertag & xbox user ID information from the Xbox API rather than having the server owner manually defining the mappings.

The ticket I was following was this one https://bugs.mojang.com/browse/MCPE-71033 , which has since been closed for 'Awaiting response' (a response by Mojang, maybe?). Maybe it's worth trying to get it reopened? The thing is, it's also a problem (or at least was, last I tested it) with the official Realms.

@markmetcalfe
Copy link
Author

@mtsr Yeah it definitely would be good to get that ticket reopened. I'm not hugely optimistic that it would get fixed anytime soon though, not because of past experience with Mojang or anything, just a gut feeling.

@markmetcalfe markmetcalfe force-pushed the splitscreen branch 2 times, most recently from 79f754c to d662aa8 Compare July 3, 2022 09:13
@markmetcalfe
Copy link
Author

Associated language strings added in this PR: GeyserMC/languages#100
And have added documentation to the wiki in this PR: GeyserMC/GeyserWiki#63

@mtsr
Copy link

mtsr commented Jul 3, 2022

@mtsr Yeah it definitely would be good to get that ticket reopened. I'm not hugely optimistic that it would get fixed anytime soon though, not because of past experience with Mojang or anything, just a gut feeling.

Agreed. The fact that such a relatively significant bug hasn't gotten attention previously at least suggests it's not a priority. What I don't understand is the lack of feedback. Oh well.

@jackson-57
Copy link
Member

The ticket I was following was this one https://bugs.mojang.com/browse/MCPE-71033 , which has since been closed for 'Awaiting response' (a response by Mojang, maybe?). Maybe it's worth trying to get it reopened? The thing is, it's also a problem (or at least was, last I tested it) with the official Realms.

for what it's worth, I think that ticket was closed simply because no one confirmed whether or not the issue was still present in the latest version of the game. I agree with your concern that the reopened ticket likely won't result in much happening on Mojang's end, though.

@markmetcalfe
Copy link
Author

@Camotoy I've updated this PR with your suggested changes, and I've also renamed the config settings values from gamertag to bedrock-username, and xbox-id to xuid respectively. This was to avoid any confusion in thinking that this would only be compatible with Xbox. Would be great if you could take a look again thanks.

Copy link
Contributor

@ImDaBigBoss ImDaBigBoss left a comment

Choose a reason for hiding this comment

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

Thank you for doing this! I've been waiting for so long.

@Camotoy
Copy link
Member

Camotoy commented Jul 5, 2022

You don't need to keep force-pushing; it makes checking diffs a little annoying. ^^ We'll squash-merge the change when it's ready.

@markmetcalfe
Copy link
Author

You don't need to keep force-pushing; it makes checking diffs a little annoying. ^^ We'll squash-merge the change when it's ready.

Ok will do from now on

@markmetcalfe markmetcalfe force-pushed the splitscreen branch 2 times, most recently from 1c3cbca to 1f8b51e Compare July 5, 2022 08:15
@markmetcalfe markmetcalfe requested a review from Camotoy July 5, 2022 21:01
@markmetcalfe
Copy link
Author

@Camotoy Have addressed your comments - could you take a look again? cheers

@Camotoy
Copy link
Member

Camotoy commented Jul 7, 2022

We only need the Xbox UUID for Floodgate, right? We can just set it to -1 for other platforms and bypass the need for a config option then.

@Camotoy
Copy link
Member

Camotoy commented Jul 7, 2022

Also - how is split-screen handled normally, say in a singleplayer world? If I join as Camotoy2 and then leave and then join as Camotoy3 is my progress saved between those two now?

@markmetcalfe
Copy link
Author

markmetcalfe commented Jul 9, 2022

@Camotoy Is the current state of this PR acceptable to you? I'm quite keen to get this merged ASAP, as I am currently borrowing my friend's PS4 to develop & test this change (Basically my whole reason for doing this is so that my friends and I can play splitscreen together when over at another house). If this takes more time, I'm afraid someone else will have to take over development of this. Hopefully these answers make sense:

We only need the Xbox UUID for Floodgate, right? We can just set it to -1 for other platforms and bypass the need for a config option then.

I haven't investigated this, but I would assume this wouldn't be possible since you'd need some way of associating an auth token with a player, and I'm not sure how that would be done in a secure fashion. Although I have limited knowledge of how all the authentication stuff works in general. I've only ever used Geyser in conjunction with Floodgate.

In my opinion I think we could just add documentation in the Wiki saying that splitscreen can only be used if Floodgate is enabled. Then support for vanilla Geyser without Floodgate can be added in a future PR.

Also - how is split-screen handled normally, say in a singleplayer world? If I join as Camotoy2 and then leave and then join as Camotoy3 is my progress saved between those two now?

Player data is tied to your profile/account, so in your example progress would not be saved between them. However, with this XUID mapping I've done, you could theory do this:

  users:
    Camotoy2:
      bedrock-username: AccountOne
      xuid: 0000000000000001
    Camotoy3:
      bedrock-username: AccountOne
      xuid: 0000000000000001

Where you have multiple console profiles tied to the same bedrock account. So logging in with either profile would use the same user. Floodgate would enforce it so that both profiles couldn't be playing simultaneously because they would be using the same bedrock account however.

@OctavioxD115
Copy link

And how do I do that?, I really don't know what to do :(
It would be cool if they put a series of steps to achieve the split screen with geyser :)

@Camotoy
Copy link
Member

Camotoy commented Jul 11, 2022

Mark: I can test splitscreen myself, so don't worry too much about time crunch.

@markmetcalfe
Copy link
Author

Have rebased on top of master to support 1.19.2

…into splitscreen

� Conflicts:
�	core/src/main/java/org/geysermc/geyser/network/ConnectorServerEventHandler.java
�	core/src/main/java/org/geysermc/geyser/network/LoggingPacketHandler.java
�	core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java
�	core/src/main/java/org/geysermc/geyser/session/GeyserSession.java
�	core/src/main/java/org/geysermc/geyser/session/UpstreamSession.java
�	core/src/main/java/org/geysermc/geyser/util/LoginEncryptionUtils.java
�	core/src/main/resources/languages
@Camotoy
Copy link
Member

Camotoy commented Aug 21, 2022

I made a couple changes on my branch here: https://github.com/Camotoy/Geyser/tree/splitscreen
The main difference is that entering your XUID is only required if you're using the Floodgate auth-type.

@markmetcalfe
Copy link
Author

@Camotoy Great, I've merged your changes into this branch. I've also updated this branch with the latest master to support 1.19.21

@MaPa80711
Copy link

Hi, I tried the steps here descripted #750 (comment) but the second player stuck in terrain is building Screen.

Any ideas?

@Camotoy
Copy link
Member

Camotoy commented Sep 15, 2022

I may have messed something up. Can you attach a Geyser dump? Are there any logs?

@MaPa80711
Copy link

Hello have tried again today,

first I have included in the geyser plugin config, 3 players.
grafik

The first player can log in - OK
the second player now tries to log in - NOK
The screen splits - OK
second player gets stuck in the "terrain is being built" screen - NOK
IMG_2740

In the log of the spigot server comes the message
[Geyser-Spigot] Could not find packet for SubClientLoginPacket

@fakio87
Copy link

fakio87 commented Oct 30, 2022

Hi,

I am having the same issue as MaPa:

My config (changed real Data but to show configuration)

image

First player can join, second player is stuck at terrain is being built.

I am really interested whether my configuration is set up wrong or whether the (switch) console is the issue.
Only after login to Microsoft+Switch Online I can join my Server with the first player. After connection I press + and select the next profile.
However the second player never gets the option to sign in to Microsoft => I can only select the second Player Switch Profile.

Some feedback for troubleshooting would be highly appreciated. I tried for many hours with different configurations and have no more ideas.

@MaPa80711
Copy link

Great. Another one who has the same problem.
This problem isnt solved yet.

@MaPa80711
Copy link

Any Updates?
Is there anyone who is working on it?

@markmetcalfe
Copy link
Author

Unfortunately this fix is no longer working due to a recent update. I no longer have access to a console, so I'm not able to get this working again. I'll close this PR for now, but anyone else is very welcome to create a new branch/PR based upon this and fix it.

@Camotoy
Copy link
Member

Camotoy commented Nov 12, 2022

Our Bedrock protocol dependency should have better split-screen support anyway, which would require a refactor for this PR.

@MaPa80711
Copy link

Hello, am now a little confused.

Does this now mean that with a current stable version of Spigot, Geyser and Minecraft the split screen should work on the consoles (PS4/PS5)?

If I now create a pure server without additional plugins and mods splitscreen should work?

@Jens-Co
Copy link
Member

Jens-Co commented Nov 13, 2022

Hello, am now a little confused.

Does this now mean that with a current stable version of Spigot, Geyser and Minecraft the split screen should work on the consoles (PS4/PS5)?

If I now create a pure server without additional plugins and mods splitscreen should work?

It means that is does NOT work, We recently made changes that broke split screen. You will have to wait till someone implement a new system.

@MaPa80711
Copy link

Ok thanks for the info. Are there any ways to support this? I am not a programmer but welcome a solution being designed here in a timely manner.

@MaPa80711
Copy link

Hello, everyone,
I've now tried the topic Minecraft Splitscreen Support PS4/PS5 again.
Meaning updated my home server with Spigot, GeyserMC, Geyser Floodgate, LuckPerms and Multiverse.

Unfortunately, it still doesn't work that a second player logs on to the same console and a split screen is then generated.

As before, the second player gets stuck in the building step and nothing else happens.

Since my family and I love playing Minecraft on the console, we have been waiting for this bug to be fixed for a long time.

can anyone help us
Is there maybe a workaround?
What is the timeline for implementation?

Thanks everyone for your time and support here.

Kind regards
MaPa80711

@alexander7567
Copy link

Im sorry to say, but I wouldn't hold your breath. I'm in the same shape. My family loves playing Minecraft together too and the Xbox slipt screen is our only option, and we've been waiting for this fix for about 2 years now. I've been dying to show them the cool plugins I use to use years ago when Bukkit was active.

You'll just have to settle for vanilla for now. I've even offered a bounty for getting this fixed and was told that was a no.

@Redned235
Copy link
Member

Im sorry to say, but I wouldn't hold your breath. I'm in the same shape. My family loves playing Minecraft together too and the Xbox slipt screen is our only option, and we've been waiting for this fix for about 2 years now. I've been dying to show them the cool plugins I use to use years ago when Bukkit was active.

You'll just have to settle for vanilla for now. I've even offered a bounty for getting this fixed and was told that was a no.

Chances are this will be revived once we move to an updated version of the protocol library we are on. This is expected to happen in the comings months.

@MaPa80711
Copy link

Hi there. Why is this closed? Is the dependencie upgrade of the Protocol Library allready Done?

@onebeastchris
Copy link
Member

This PR is closed. The underlying issue that's asking for the implementation is open.

If you look at the comments/conversation here, you'll see why it's closed - it may get reopened, it may not be. The new protocol, is, to my knowledge, not fully here yet

@ostehovelen
Copy link

This is an updated version of mtsr@9f32f59 for 1.19 (thanks @mtsr for your work!)

Because the bug with console subclients not sending a XUID through still exists, I've had to implement a hack where the XUIDs (xbox IDs) need to be manually stored in the Geyser config settings. An example of what this might look like is:

# Settings for splitscreen players
splitscreen:
  enabled: true 
  # Mappings of console profiles to Bedrock accounts.
  # This is necessary due to a bug in console clients not sending enough auth data to the server.
  # To get the XUID for a player, check the server logs when they log in normally (not via splitscreen)
  users:
    Splitscreen Player One:
      bedrock-username: Xbox Gamertag One
      xuid: 0000000123456789
    Player2:
      bedrock-username: Xbox Gamertag Two
      xuid: 1234567890000000

I have tested this on Playstation 4, with 3 users able to play simultaneously via splitscreen. I have tested this on paper and waterfall, and I haven't noticed any issues.

This will fix #750

Ok, im a total NOOB. Is this working, and how can i implement it?? <3
asking for me and my 2 sons that love playing this, just made a server to save the money from realms...

@MaPa80711
Copy link

Hello I tried this workaround last year and it didn't work anymore.

Apparently this is due to a dependency that has not yet been processed further.

Unfortunately, it is not clear whether and when this topic will be continued.

Maybe a developer can give us more information here?

@Ok2dot0
Copy link

Ok2dot0 commented Jun 29, 2024

Is there any way to make this theoretically work? Maybe through a plugin? I could even try to implement it myself if I would know the underlying problem.

@Tim203
Copy link
Member

Tim203 commented Jun 29, 2024

The issue is the bug that has been mentioned here before: https://bugs.mojang.com/browse/MCPE-71033
It's still not fixed, until then it's unlikely that any form of splitscreen support will be added.

@GeyserMC GeyserMC locked and limited conversation to collaborators Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR: Feature When a PR implements a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Splitscreen support