[XAM] Fixed issue with error code being returned for local session
This commit is contained in:
committed by
Radosław Gliński
parent
4b6ac45650
commit
81656a9729
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "xenia/kernel/xam/apps/xgi_app.h"
|
#include "xenia/kernel/xam/apps/xgi_app.h"
|
||||||
|
#include "xenia/kernel/xsession.h"
|
||||||
|
|
||||||
#include "xenia/base/logging.h"
|
#include "xenia/base/logging.h"
|
||||||
|
|
||||||
@@ -182,21 +183,23 @@ X_HRESULT XgiApp::DispatchMessageSync(uint32_t message, uint32_t buffer_ptr,
|
|||||||
uint32_t session_info_ptr = xe::load_and_swap<uint32_t>(buffer + 0x14);
|
uint32_t session_info_ptr = xe::load_and_swap<uint32_t>(buffer + 0x14);
|
||||||
uint32_t nonce_ptr = xe::load_and_swap<uint32_t>(buffer + 0x18);
|
uint32_t nonce_ptr = xe::load_and_swap<uint32_t>(buffer + 0x18);
|
||||||
|
|
||||||
|
XELOGD(
|
||||||
|
"XGISessionCreateImpl({:08X}, {:08X}, {}, {}, {:08X}, {:08X}, "
|
||||||
|
"{:08X})",
|
||||||
|
session_ptr, flags, num_slots_public, num_slots_private, user_xuid,
|
||||||
|
session_info_ptr, nonce_ptr);
|
||||||
|
|
||||||
// 584107FB expects offline session creation using flags 0 to succeed
|
// 584107FB expects offline session creation using flags 0 to succeed
|
||||||
// while offline.
|
// while offline.
|
||||||
// 58410889 expects stats session creation failure while offline.
|
// 58410889 expects stats session creation failure while offline.
|
||||||
//
|
//
|
||||||
// Allow offline session creation, but do not allow Xbox Live featured
|
// Allow offline session creation, but do not allow Xbox Live featured
|
||||||
// session creation.
|
// session creation.
|
||||||
if (flags) {
|
|
||||||
|
if (IsXboxLiveSession(static_cast<SessionFlags>(flags))) {
|
||||||
return 0x80155209; // X_ONLINE_E_SESSION_NOT_LOGGED_ON
|
return 0x80155209; // X_ONLINE_E_SESSION_NOT_LOGGED_ON
|
||||||
}
|
}
|
||||||
|
|
||||||
XELOGD(
|
|
||||||
"XGISessionCreateImpl({:08X}, {:08X}, {}, {}, {:08X}, {:08X}, "
|
|
||||||
"{:08X})",
|
|
||||||
session_ptr, flags, num_slots_public, num_slots_private, user_xuid,
|
|
||||||
session_info_ptr, nonce_ptr);
|
|
||||||
return X_E_SUCCESS;
|
return X_E_SUCCESS;
|
||||||
}
|
}
|
||||||
case 0x000B0011: {
|
case 0x000B0011: {
|
||||||
|
|||||||
54
src/xenia/kernel/xsession.h
Normal file
54
src/xenia/kernel/xsession.h
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* Xenia : Xbox 360 Emulator Research Project *
|
||||||
|
******************************************************************************
|
||||||
|
* Copyright 2026 Xenia Canary. All rights reserved. *
|
||||||
|
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef XENIA_KERNEL_XSESSION_H_
|
||||||
|
#define XENIA_KERNEL_XSESSION_H_
|
||||||
|
|
||||||
|
namespace xe {
|
||||||
|
namespace kernel {
|
||||||
|
|
||||||
|
enum SessionFlags {
|
||||||
|
HOST = 0x01,
|
||||||
|
PRESENCE = 0x02,
|
||||||
|
STATS = 0x04,
|
||||||
|
MATCHMAKING = 0x08,
|
||||||
|
ARBITRATION = 0x10,
|
||||||
|
PEER_NETWORK = 0x20,
|
||||||
|
SOCIAL_MATCHMAKING_ALLOWED = 0x80,
|
||||||
|
INVITES_DISABLED = 0x0100,
|
||||||
|
JOIN_VIA_PRESENCE_DISABLED = 0x0200,
|
||||||
|
JOIN_IN_PROGRESS_DISABLED = 0x0400,
|
||||||
|
JOIN_VIA_PRESENCE_FRIENDS_ONLY = 0x0800,
|
||||||
|
UNKNOWN = 0x1000, // 4156091D and 5841128F sets this flag?
|
||||||
|
|
||||||
|
SINGLEPLAYER_WITH_STATS = PRESENCE | STATS | INVITES_DISABLED |
|
||||||
|
JOIN_VIA_PRESENCE_DISABLED |
|
||||||
|
JOIN_IN_PROGRESS_DISABLED,
|
||||||
|
|
||||||
|
LIVE_MULTIPLAYER_STANDARD = PRESENCE | STATS | MATCHMAKING | PEER_NETWORK,
|
||||||
|
LIVE_MULTIPLAYER_RANKED = LIVE_MULTIPLAYER_STANDARD | ARBITRATION,
|
||||||
|
SYSTEMLINK = PEER_NETWORK,
|
||||||
|
GROUP_LOBBY = PRESENCE | PEER_NETWORK,
|
||||||
|
GROUP_GAME = STATS | MATCHMAKING | PEER_NETWORK,
|
||||||
|
|
||||||
|
// HELPERS
|
||||||
|
SYSTEMLINK_FEATURES = HOST | SYSTEMLINK,
|
||||||
|
LIVE_FEATURES = PRESENCE | STATS | MATCHMAKING | ARBITRATION
|
||||||
|
};
|
||||||
|
|
||||||
|
inline bool IsOfflineSession(const SessionFlags flags) { return !flags; }
|
||||||
|
|
||||||
|
inline bool IsXboxLiveSession(const SessionFlags flags) {
|
||||||
|
return !IsOfflineSession(flags) && flags & SessionFlags::LIVE_FEATURES;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace kernel
|
||||||
|
} // namespace xe
|
||||||
|
|
||||||
|
#endif // XENIA_KERNEL_XSESSION_H_
|
||||||
Reference in New Issue
Block a user