[XAM] XamShowSigninUI: Send signin and UI close notification with delay from separate thread
This is to prevent situation when game waits for notification, but receives it beforehand
This commit is contained in:
parent
629707b935
commit
d246e3bc70
|
@ -548,6 +548,8 @@ dword_result_t XamShowSigninUI_entry(dword_t users_needed, dword_t unk_mask) {
|
|||
kernel_state()->UpdateUsedUserProfiles();
|
||||
// Mask values vary. Probably matching user types? Local/remote?
|
||||
// Games seem to sit and loop until we trigger this notification:
|
||||
|
||||
auto run = [users_needed]() -> void {
|
||||
uint32_t user_mask = 0;
|
||||
uint32_t active_users = 0;
|
||||
|
||||
|
@ -559,12 +561,17 @@ dword_result_t XamShowSigninUI_entry(dword_t users_needed, dword_t unk_mask) {
|
|||
}
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(150));
|
||||
// XN_SYS_SIGNINCHANGED (players)
|
||||
kernel_state()->BroadcastNotification(kXNotificationIDSystemSignInChanged,
|
||||
user_mask);
|
||||
|
||||
// XN_SYS_UI (off)
|
||||
kernel_state()->BroadcastNotification(kXNotificationIDSystemUI, 0);
|
||||
};
|
||||
|
||||
std::thread thread(run);
|
||||
thread.detach();
|
||||
|
||||
return X_ERROR_SUCCESS;
|
||||
}
|
||||
DECLARE_XAM_EXPORT1(XamShowSigninUI, kUserProfiles, kStub);
|
||||
|
|
Loading…
Reference in New Issue