mirror of
https://git.stillkill.net/MinecraftLeak/MinecraftConsoles-141217.git
synced 2026-10-23 13:32:19 +01:00
Initial commit
This commit is contained in:
commit
2dfcaaa842
5375 files changed
+978475
No files matched your search
@@ -0,0 +1,64 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "PSVitaLeaderboardManager.h"
|
||||
|
||||
#include "PSVita\PSVita_App.h"
|
||||
#include "PSVita\PSVitaExtras\ShutdownManager.h"
|
||||
|
||||
#include "Common\Consoles_App.h"
|
||||
#include "Common\Network\Sony\SQRNetworkManager.h"
|
||||
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <np.h>
|
||||
|
||||
LeaderboardManager *LeaderboardManager::m_instance = new PSVitaLeaderboardManager(); //Singleton instance of the LeaderboardManager
|
||||
|
||||
PSVitaLeaderboardManager::PSVitaLeaderboardManager() : SonyLeaderboardManager() {}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::initialiseScoreUtility()
|
||||
{
|
||||
return sceNpScoreInit( SCE_KERNEL_DEFAULT_PRIORITY_USER, SCE_KERNEL_THREAD_CPU_AFFINITY_MASK_DEFAULT, NULL);
|
||||
}
|
||||
|
||||
bool PSVitaLeaderboardManager::scoreUtilityAlreadyInitialised(HRESULT hr)
|
||||
{
|
||||
return hr == SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::createTitleContext(const SceNpId &npId)
|
||||
{
|
||||
return sceNpScoreCreateTitleCtx(&s_npCommunicationId, &s_npCommunicationPassphrase, &npId);
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::destroyTitleContext(int titleContext)
|
||||
{
|
||||
return sceNpScoreDestroyTitleCtx(titleContext);
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::createTransactionContext(int titleContext)
|
||||
{
|
||||
return sceNpScoreCreateRequest(titleContext);
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::abortTransactionContext(int transactionContext)
|
||||
{
|
||||
return sceNpScoreAbortRequest(transactionContext);
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::destroyTransactionContext(int transactionContext)
|
||||
{
|
||||
return sceNpScoreDeleteRequest(transactionContext);
|
||||
}
|
||||
|
||||
HRESULT PSVitaLeaderboardManager::getFriendsList(sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::FriendsList> &friendsList)
|
||||
{
|
||||
return sce::Toolkit::NP::Friends::Interface::getFriendslist(&friendsList, false);
|
||||
}
|
||||
|
||||
char *PSVitaLeaderboardManager::getComment(SceNpScoreComment *comment)
|
||||
{
|
||||
return comment->utf8Comment;
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Leaderboards\SonyLeaderboardManager.h"
|
||||
#include "Common\Leaderboards\LeaderboardManager.h"
|
||||
|
||||
#include "Conf.h"
|
||||
|
||||
#include <np.h>
|
||||
|
||||
class PSVitaLeaderboardManager : public SonyLeaderboardManager
|
||||
{
|
||||
public:
|
||||
PSVitaLeaderboardManager();
|
||||
|
||||
protected:
|
||||
|
||||
virtual HRESULT initialiseScoreUtility();
|
||||
|
||||
virtual bool scoreUtilityAlreadyInitialised(HRESULT hr);
|
||||
|
||||
virtual HRESULT createTitleContext(const SceNpId &npId);
|
||||
|
||||
virtual HRESULT destroyTitleContext(int titleContext);
|
||||
|
||||
virtual HRESULT createTransactionContext(int titleContext);
|
||||
|
||||
virtual HRESULT abortTransactionContext(int transactionContext);
|
||||
|
||||
virtual HRESULT destroyTransactionContext(int transactionContext);
|
||||
|
||||
virtual HRESULT getFriendsList(sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::FriendsList> &friendsList);
|
||||
|
||||
virtual char * getComment(SceNpScoreComment *comment);
|
||||
};
|
||||
Reference in new issue
Block a user