Skip to content

Conversation

@andy013
Copy link
Contributor

@andy013 andy013 commented Dec 10, 2025

Issue: Facepunch/sbox-issues#7746

Changes

  • Wrapped the calls to OnDisconnected in a IsHost if block.

Notes

The XML comment says this should only be called for the host, but it could be called for the client if the host disconnected. It's a bit tricky to reproduce since you can't use the editor or a dedicated server. I had to use 2 steam accounts, disable host transfer and then disconnect the host to reproduce it.

@kurozael
Copy link
Contributor

Yeah we should probably have this guard, but in this particular case wouldn't the client just be booted to menu?

@andy013
Copy link
Contributor Author

andy013 commented Dec 10, 2025

Yes, but I think it can happen when the host transfers as well. It just happens for the people who stay as clients. I've not confirmed this though as I was only testing with 2 accounts. When I tried that the other client always became the host before OnDisconnected was called.

@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Dec 12, 2025
@sboxbot sboxbot added the accepted this pull request was accepted, hurrah! label Dec 13, 2025
@sboxbot
Copy link
Contributor

sboxbot commented Dec 13, 2025

This PR has been merged upstream.

@sboxbot sboxbot closed this Dec 13, 2025
@andy013 andy013 deleted the ondisconnected_fix branch December 19, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted this pull request was accepted, hurrah! triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants