Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions rpcs3/Emu/NP/np_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1470,12 +1470,26 @@ namespace np

u32 np_handler::get_num_friends()
{
return get_rpcn()->get_num_friends();
if (g_cfg.net.psn_status != np_psn_status::psn_rpcn)
{
return 0;
}
else
{
return get_rpcn()->get_num_friends();
}
}

u32 np_handler::get_num_blocks()
{
return get_rpcn()->get_num_blocks();
if (g_cfg.net.psn_status != np_psn_status::psn_rpcn)
{
return 0;
}
else
{
return get_rpcn()->get_num_blocks();
}
}

std::pair<error_code, std::optional<SceNpId>> np_handler::get_friend_by_index(u32 index)
Expand Down
15 changes: 15 additions & 0 deletions rpcs3/Emu/NP/np_requests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,21 @@ namespace np
cookie_vec.assign(cookie, cookie + cookie_size);
}

if (g_cfg.net.psn_status != np_psn_status::psn_rpcn)
{
// TODO(InvoxiPlayGames): generate ticket data that is valid, for games that need to dig into the data
std::vector<u8> ticketdata = {0x41, 0x42, 0x43, 0x44};
current_ticket = ticket(std::move(ticketdata));
auto ticket_size = static_cast<s32>(current_ticket.size());

sysutil_register_cb([manager_cb = this->manager_cb, ticket_size, manager_cb_arg = this->manager_cb_arg](ppu_thread& cb_ppu) -> s32
{
manager_cb(cb_ppu, SCE_NP_MANAGER_EVENT_GOT_TICKET, ticket_size, manager_cb_arg);
return 0;
});
return;
}

if (!get_rpcn()->req_ticket(req_id, service_id_str, cookie_vec))
{
rpcn_log.error("Disconnecting from RPCN!");
Expand Down