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

Enforce run-behind-pause-screen if ad-hoc multiplayer active #18647

Merged
merged 3 commits into from Dec 30, 2023

Conversation

hrydgard
Copy link
Owner

This forces the game to keep running behind the menu if adhoc is connected, avoiding desyncs-by-mistake.

@anr2me What do you think? Is this the right approach?

@hrydgard hrydgard added Networking / adhoc User Interface PPSSPP's own user interface / UX labels Dec 30, 2023
@hrydgard hrydgard added this to the v1.17.0 milestone Dec 30, 2023
UI/PauseScreen.cpp Outdated Show resolved Hide resolved
@@ -126,6 +126,9 @@ static int sceNetAdhocPdpCreate(const char* mac, int port, int bufferSize, u32 f
static int sceNetAdhocPdpSend(int id, const char* mac, u32 port, void* data, int len, int timeout, int flag);
static int sceNetAdhocPdpRecv(int id, void* addr, void* port, void* buf, void* dataLength, u32 timeout, int flag);

bool __NetAdhocConnected() {
return netAdhocInited && netAdhocctlInited && adhocctlState == ADHOCCTL_STATE_CONNECTED;
Copy link
Collaborator

@anr2me anr2me Dec 30, 2023

Choose a reason for hiding this comment

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

it should be (adhocctlState == ADHOCCTL_STATE_CONNECTED || adhocctlState == ADHOCCTL_STATE_GAMEMODE) as gamemode is also in connected state, similar to

// FIXME: When tested with JPCSP + official prx files it seems when adhocctl in a connected state (ie. joined to a group) attempting to create/connect/join/scan will return a success (without doing anything?)
if ((adhocctlState == ADHOCCTL_STATE_CONNECTED) || (adhocctlState == ADHOCCTL_STATE_GAMEMODE)) {
// TODO: Valhalla Knights 2 need handler notification, but need to test this on games that doesn't use Adhocctl Handler too (not sure if there are games like that tho)

Copy link
Owner Author

Choose a reason for hiding this comment

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

Fixed it up, please test :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

I only tested this on 2 games, Naruto Shippuden Ultimate Ninja Heroes 3 (normal adhoc), and Bomberman (gamemode), seems to be okay.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for testing! I think it should be generally fine, I guess we'll get bug reports if it isn't.

@hrydgard hrydgard force-pushed the enforce-runbehind-multiplayer branch from 69948bf to 23a253d Compare December 30, 2023 20:50
@hrydgard hrydgard merged commit cdc8bc6 into master Dec 30, 2023
18 checks passed
@hrydgard hrydgard deleted the enforce-runbehind-multiplayer branch December 30, 2023 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking / adhoc User Interface PPSSPP's own user interface / UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants