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

NetPlay: Split SyncSaveData() into two parts. #11233

Conversation

AdmiralCurtiss
Copy link
Contributor

This allows the 'save collection' part to run even if no clients are connected. Fixes issue 13095, if we interpreted that one correctly anyway.

@AdmiralCurtiss
Copy link
Contributor Author

Can someone review this? Someone ran into this again on discord today.

Source/Core/Core/NetPlayServer.cpp Outdated Show resolved Hide resolved
m_saves_synced = false;

m_save_data_synced_players = 0;

u8 save_count = 0;
Copy link
Member

Choose a reason for hiding this comment

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

I realise this is existing code, but why is this an u8? Seems like int or size_t would be a more natural choice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm guessing it was like that because it's sent over the network, so it needs a fixed size, and it never exceeds 7 (2 GC slots, all Wii stuff just counts as 1, and 4 GBA slots). It's then used as a counter for how many 'saves' have successfully synced on the client side. An odd variable in general really, there's probably better ways to handle this, not sure how much I want to mess with this logic here though...

Source/Core/Core/NetPlayServer.cpp Outdated Show resolved Hide resolved
Source/Core/Core/NetPlayServer.cpp Outdated Show resolved Hide resolved
This allows the 'save collection' part to run even if no clients are connected. Fixes issue 13095.
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

lgtm

@AdmiralCurtiss AdmiralCurtiss merged commit e1f5eb3 into dolphin-emu:master Nov 6, 2022
11 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the netplay-split-save-sync-function branch November 6, 2022 04:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants