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

[adhoc] Fix The Warriors #13967

Merged
merged 2 commits into from
Jan 24, 2021
Merged

[adhoc] Fix The Warriors #13967

merged 2 commits into from
Jan 24, 2021

Conversation

anr2me
Copy link
Collaborator

@anr2me anr2me commented Jan 24, 2021

Apparently there are games (ie. The Warriors) who tried to do PtpSend immediately after PtpOpen, without trying to do PtpConnect first.

@hrydgard
Copy link
Owner

Do we have an issue about this, to tag for closing?

Looks okay, although it seems very odd to call send without connect.

@anr2me
Copy link
Collaborator Author

anr2me commented Jan 24, 2021

There are no issue opened related to networking on The Warriors.

Yeah it's an odd way to connect, i still need to test the behavior of PtpOpen to see whether it's possible to send without connecting first.
Currently this commit is the only way to make The Warriors to work properly, and shouldn't cause regression on other games.

@anr2me anr2me marked this pull request as ready for review January 24, 2021 10:06
@anr2me
Copy link
Collaborator Author

anr2me commented Jan 24, 2021

After testing it on a small homebrew, looks like the error code returned from PtpSend was wrong, it should be "disconnected" instead of "not connected", and looks like PtpSend can get a success after PtpOpen (the other side was able to PtpAccept after PtpListen)

@anr2me anr2me marked this pull request as draft January 24, 2021 10:44
@hrydgard hrydgard added this to the v1.11.0 milestone Jan 24, 2021
@anr2me anr2me marked this pull request as ready for review January 24, 2021 11:37
…rriors) seems to do PtpSend immediately after PtpOpen without trying to PtpConnect first.
@anr2me
Copy link
Collaborator Author

anr2me commented Jan 24, 2021

Okay i'm done.

So basically,
If remote player is not Listening yet, the socket created by PtpOpen won't be connected, thus PtpSend will fail with error "disconnected" and the game need to do PtpConnect, or close the socket and PtpOpen again.
If remote player is already Listening, the socket created by PtpOpen will be connected, thus PtpSend can be successful.

@anr2me anr2me merged commit 65af16b into hrydgard:master Jan 24, 2021
@hrydgard
Copy link
Owner

Oh, that's making more sense indeed.

hrydgard added a commit that referenced this pull request Jan 31, 2022
Fixes the new problem in #13967

Though of course doesn't fix the vertical lines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants