Skip to content

Commit

Permalink
Merge branch 'AdrianCassar:netplay_canary_experimental' into hinternet
Browse files Browse the repository at this point in the history
  • Loading branch information
wildmaster84 authored Sep 20, 2024
2 parents 2999ca9 + 2ba846f commit dec9438
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/xenia/kernel/xam/user_profile.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ class UserProfile {
return cvars::offline_mode ? X_USER_SIGNIN_STATE::SignedInLocally
: X_USER_SIGNIN_STATE::SignedInToLive;
}
uint32_t type() const {
return static_cast<uint32_t>(X_USER_SIGNIN_STATE::SignedInLocally) |
static_cast<uint32_t>(X_USER_SIGNIN_STATE::SignedInToLive);
}

void AddSetting(std::unique_ptr<UserSetting> setting);
UserSetting* GetSetting(uint32_t setting_id);
Expand Down
5 changes: 4 additions & 1 deletion src/xenia/kernel/xam/xam_net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,10 @@ dword_result_t NetDll_XNetXnAddrToInAddr_entry(dword_t caller,
return X_ERROR_SUCCESS;
}

// What if it's a local IP (ina) instead of online?
if (XLiveAPI::IsConnectedToLAN()) {
in_addr->s_addr = xn_addr->ina.s_addr;
}

if (XLiveAPI::IsOnline()) {
in_addr->s_addr = xn_addr->inaOnline.s_addr;
}
Expand Down
4 changes: 1 addition & 3 deletions src/xenia/kernel/xam/xam_user.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ X_HRESULT_result_t XamUserGetXUID_entry(dword_t user_index, dword_t type_mask,
if (kernel_state()->IsUserSignedIn(user_index)) {
const auto& user_profile = kernel_state()->user_profile(user_index);

const uint32_t singin_state =
static_cast<uint32_t>(user_profile->signin_state());
const uint32_t local =
static_cast<uint32_t>(X_USER_SIGNIN_STATE::SignedInLocally);
const uint32_t live =
static_cast<uint32_t>(X_USER_SIGNIN_STATE::SignedInToLive);

uint32_t type = singin_state & type_mask;
auto type = user_profile->type() & type_mask;

if (type & (live | 4)) {
// Online XUID
Expand Down

0 comments on commit dec9438

Please sign in to comment.