fix: consoles & dpad being binded to 2 settings
This commit is contained in:
1 parent
02da402490
commit
fed6871356
150 files changed
+19314
-431
No files matched your search
@@ -809,7 +809,6 @@ int SQRNetworkManager_Orbis::BasicEventThreadProc( void *lpParameter )
|
||||
int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
||||
{
|
||||
SQRNetworkManager_Orbis *manager = (SQRNetworkManager_Orbis *)lpParameter;
|
||||
sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::FriendsList> friendList;
|
||||
|
||||
int ret = 0;
|
||||
manager->m_aFriendSearchResults.clear();
|
||||
@@ -828,81 +827,7 @@ int SQRNetworkManager_Orbis::GetFriendsThreadProc( void* lpParameter )
|
||||
requestParam.userInfo.userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());
|
||||
|
||||
bool async = false;
|
||||
ret = sce::Toolkit::NP::Friends::Interface::getFriendslist(&friendList, &requestParam, async);
|
||||
if(ret != SCE_OK)
|
||||
{
|
||||
app.DebugPrintf("getFriendslist failed! 0x%08x\n", ret);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (friendList.hasResult())
|
||||
{
|
||||
sce::Toolkit::NP::FriendsList::const_iterator iter ;
|
||||
int i = 1 ;
|
||||
bool noFriends = true;
|
||||
for (iter = friendList.get()->begin(); iter != friendList.get()->end() ; ++iter,i++)
|
||||
{
|
||||
manager->m_friendCount++;
|
||||
noFriends = false;
|
||||
app.DebugPrintf("------ Friend: %d -----\n",i);
|
||||
app.DebugPrintf("Online Name: %s\n",iter->npid.handle.data);
|
||||
app.DebugPrintf("------------------------\n");
|
||||
|
||||
|
||||
sce::Toolkit::NP::PresenceRequest presenceRequest;
|
||||
sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::PresenceInfo> presenceInfo;
|
||||
memset(&presenceRequest,0,sizeof(presenceRequest));
|
||||
strncpy(presenceRequest.onlineId.data,iter->npid.handle.data, strlen(iter->npid.handle.data));
|
||||
presenceRequest.presenceType = SCE_TOOLKIT_NP_PRESENCE_TYPE_INCONTEXT_INFO;
|
||||
presenceRequest.userInfo.userId = ProfileManager.getUserID(ProfileManager.GetPrimaryPad());;
|
||||
|
||||
|
||||
ret = sce::Toolkit::NP::Presence::Interface::getPresence(&presenceRequest,&presenceInfo,false);
|
||||
if( ret < 0 )
|
||||
{
|
||||
app.DebugPrintf("getPresence() error. ret = 0x%x\n", ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("\nPresence Data Retrieved:\n");
|
||||
app.DebugPrintf("Platform Type: %s\n", presenceInfo.get()->platformType.c_str());
|
||||
app.DebugPrintf("Online Status: %s\n", (presenceInfo.get()->onlineStatus == SCE_NP_GAME_PRESENCE_STATUS_OFFLINE)?"OFFLINE":"ONLINE");
|
||||
app.DebugPrintf("Presence Type (Refer to SCE_TOOLKIT_NP_PRESENCE_TYPE_* flags): %d\n", presenceInfo.get()->presenceType);
|
||||
app.DebugPrintf("Title ID: %s\n", presenceInfo.get()->gameInfo.npTitleId.c_str());
|
||||
app.DebugPrintf("Title Name: %s\n", presenceInfo.get()->gameInfo.npTitleName.c_str());
|
||||
app.DebugPrintf("Title Status String: %s\n", presenceInfo.get()->gameInfo.gameStatus.c_str());
|
||||
|
||||
FriendSearchResult result;
|
||||
memcpy(&result.m_NpId, &iter->npid, sizeof(SceNpId));
|
||||
result.m_RoomFound = false;
|
||||
|
||||
// Only include the friend's game if its the same network id ( this also filters out generally Zeroed PresenceSyncInfo, which we do when we aren't in an active game session)
|
||||
// if( presenceDetails.size == sizeof(PresenceSyncInfo) )
|
||||
{
|
||||
PresenceSyncInfo *pso = (PresenceSyncInfo *)presenceInfo.get()->gameInfo.gameData;
|
||||
if( pso->netVersion == MINECRAFT_NET_VERSION )
|
||||
{
|
||||
if( !pso->inviteOnly )
|
||||
{
|
||||
result.m_RoomFound = true;
|
||||
result.m_RoomId = pso->m_RoomId;
|
||||
result.m_ServerId = pso->m_ServerId;
|
||||
|
||||
CPlatformNetworkManagerSony::MallocAndSetExtDataFromSQRPresenceInfo(&result.m_RoomExtDataReceived, pso);
|
||||
manager->m_aFriendSearchResults.push_back(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (friendList.hasError())
|
||||
{
|
||||
app.DebugPrintf( "Error occurred while retrieving FriendsList, ret = 0x%x\n", friendList.getError());
|
||||
app.DebugPrintf("Check sign-in status\n");
|
||||
|
||||
}
|
||||
app.DebugPrintf( "Friend list is disabled on this build\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user