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

(Relay) Client is kicked from select realms after locating sever #426

Closed
JSbETms opened this issue Jul 8, 2023 · 8 comments
Closed

(Relay) Client is kicked from select realms after locating sever #426

JSbETms opened this issue Jul 8, 2023 · 8 comments
Labels

Comments

@JSbETms
Copy link

JSbETms commented Jul 8, 2023

When using relay and attempting to connect to realms (I am unable to test with servers), in some cases the client is kicked from said realm with Failed to send: -5, this is not because the realm is full or the account in question has been banned as the same account joins without issue when using the standard bedrock-protocol. I have noticed all the realms that have kicked the client have some form of behaviour pack, although am not certain if this is the cause. The client is always kicked after the "Locating Server" tab has finished during the connection process; packets sent appear to be sent and received as normal up until the point the client is disconnected.
Here is my console output:
image
The code I have used is sourced directly from API.md except the version has been changed the 1.20.0, with process.env.DEBUG = 'minecraft-protocol' and relay.conLog = console.debug being added in the appropriate places.

@extremeheat
Copy link
Member

As you can see before the exception, the server is closing the connection and no further information can be sent to the server. We should not try and send information after the connection is closed, but sometimes a race condition can happen where information is already in the send queue before the connection gets closed.

As for why the server is disconnecting you, this is only possible to know from the server side. There is no clear path to fixing this problem without the server sending a kick message explaining the disconnection, or looking at the server logs, particularly as this seems to be a server/client-specific issue.

@JSbETms
Copy link
Author

JSbETms commented Jul 28, 2023

I have noticed since update 1.20.12 that instead of giving a standard disconnection screen, it instead reads readNoHeader failed! packetId: 114, although I am not sure if this is because the client is kicked part way through this particular packet (Multiple times) or if this issue is related to the update_soft_enum packet.

(Edit):
image
(Image of the disconnect screen)

I have also noticed that the client is kicked during the loading appearances (Straight after "Locating Server") part of the loading process and the screen/text stating so is only visible for ~1s (Although I am not sure if this is of any relevance).

@JSbETms
Copy link
Author

JSbETms commented Aug 21, 2023

I believe this issue is indeed related to the update_soft_enum packet as this is only sent if a server has behaviour packs, and in the protocol.json and proto.yml the packet is shown to have no data included with the packet, contradicting other sources such as from wki.vg where it states otherwise.
(I think the cause of this issue is because the protocol.json file is missing formatting for update_soft_enum packets. Although, I am no professional.)

(Edit): update_soft_enum may be related to scoreboards more that behaviour packs and is not only sent if a server has behaviour packs.

@extremeheat
Copy link
Member

I believe this issue is indeed related to the update_soft_enum packet as this is only sent if a server has behaviour packs, and in the protocol.json and proto.yml the packet is shown to have no data included with the packet, contradicting other sources such as from wki.vg where it states otherwise. (I think the cause of this issue is because the protocol.json file is missing formatting for update_soft_enum packets. Although, I am no professional.)

wiki.vg is not a reliable source, but if you see in other implementations that the encoding is wrong, feel free to open a PR inside minecraft-data to fix it

@JSbETms
Copy link
Author

JSbETms commented Aug 22, 2023

Apologies for the unreliable source, I have opened a pull request here although I am not familiar with them so further apologies if I have incorrectly opened it or have done something else incorrectly.

@JSbETms
Copy link
Author

JSbETms commented Aug 25, 2023

Pull request #758 within minecraft-data has fixed this issue.

@JSbETms
Copy link
Author

JSbETms commented Nov 26, 2023

This issue is apparent again, being disconnected with "Server sent broken packet".

@JSbETms JSbETms reopened this Nov 26, 2023
@JSbETms
Copy link
Author

JSbETms commented Jan 17, 2024

Different issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants