mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
sceNp: add error_code and some param checks (#6416)
* sceNp: add error_code and basic implementations * sceNp: and fix some structs * sceNpSns: improvements * sceNpUtil: improvements * sceNpTus: improvements
This commit is contained in:
parent
d1603fbb0b
commit
cb00b71c4b
13 changed files with 5776 additions and 1076 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include "Emu/Memory/vm_ptr.h"
|
||||
|
||||
using CellSysutilUserId = u32;
|
||||
|
||||
enum CellSysutilError : u32
|
||||
{
|
||||
CELL_SYSUTIL_ERROR_TYPE = 0x8002b101,
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +1,52 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "cellRtc.h"
|
||||
|
||||
#include "Utilities/BEType.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
using in_addr_t = u32;
|
||||
using in_port_t = u16;
|
||||
using sa_family_t = u8;
|
||||
using socklen_t = u32;
|
||||
|
||||
struct in_addr
|
||||
{
|
||||
in_addr_t s_addr; // TODO: alignment?
|
||||
};
|
||||
|
||||
using sys_memory_container_t = u32;
|
||||
|
||||
using system_time_t = s64;
|
||||
using second_t = u32;
|
||||
using usecond_t = u64;
|
||||
|
||||
using SceNpBasicAttachmentDataId = u32;
|
||||
using SceNpBasicMessageId = u64;
|
||||
using SceNpBasicMessageRecvAction = u32;
|
||||
|
||||
using SceNpClanId = u32;
|
||||
using SceNpClansMessageId = u32;
|
||||
using SceNpClansMemberStatus = s32;
|
||||
|
||||
using SceNpCustomMenuIndexMask = u32;
|
||||
using SceNpCustomMenuSelectedType = u32;
|
||||
|
||||
using SceNpFriendlistCustomOptions = u64;
|
||||
|
||||
using SceNpPlatformType = s32;
|
||||
|
||||
using SceNpScoreBoardId = u32;
|
||||
using SceNpScoreClansBoardId = u32;
|
||||
using SceNpScorePcId = s32;
|
||||
using SceNpScoreRankNumber = u32;
|
||||
using SceNpScoreValue = s64;
|
||||
|
||||
using SceNpTime = s64;
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
enum SceNpError : u32
|
||||
{
|
||||
// NP Manager Utility
|
||||
SCE_NP_ERROR_NOT_INITIALIZED = 0x8002aa01,
|
||||
|
@ -83,6 +124,30 @@ enum
|
|||
SCE_NP_UTIL_ERROR_UNKNOWN_TYPE = 0x8002ab0d,
|
||||
SCE_NP_UTIL_ERROR_UNKNOWN = 0x8002ab0e,
|
||||
SCE_NP_UTIL_ERROR_NOT_MATCH = 0x8002ab0f,
|
||||
SCE_NP_UTIL_ERROR_UNKNOWN_PLATFORM_TYPE = 0x8002ab10,
|
||||
|
||||
// NP Friendlist Utility
|
||||
SCE_NP_FRIENDLIST_ERROR_ALREADY_INITIALIZED = 0x8002ab20,
|
||||
SCE_NP_FRIENDLIST_ERROR_NOT_INITIALIZED = 0x8002ab21,
|
||||
SCE_NP_FRIENDLIST_ERROR_OUT_OF_MEMORY = 0x8002ab22,
|
||||
SCE_NP_FRIENDLIST_ERROR_INVALID_MEMORY_CONTAINER = 0x8002ab23,
|
||||
SCE_NP_FRIENDLIST_ERROR_INSUFFICIENT = 0x8002ab24,
|
||||
SCE_NP_FRIENDLIST_ERROR_CANCEL = 0x8002ab25,
|
||||
SCE_NP_FRIENDLIST_ERROR_STATUS = 0x8002ab26,
|
||||
SCE_NP_FRIENDLIST_ERROR_BUSY = 0x8002ab27,
|
||||
SCE_NP_FRIENDLIST_ERROR_INVALID_ARGUMENT = 0x8002ab28,
|
||||
|
||||
// NP Profile Utility
|
||||
SCE_NP_PROFILE_ERROR_ALREADY_INITIALIZED = 0x8002ab40,
|
||||
SCE_NP_PROFILE_ERROR_NOT_INITIALIZED = 0x8002ab41,
|
||||
SCE_NP_PROFILE_ERROR_OUT_OF_MEMORY = 0x8002ab42,
|
||||
SCE_NP_PROFILE_ERROR_NOT_SUPPORTED = 0x8002ab43,
|
||||
SCE_NP_PROFILE_ERROR_INSUFFICIENT = 0x8002ab44,
|
||||
SCE_NP_PROFILE_ERROR_CANCEL = 0x8002ab45,
|
||||
SCE_NP_PROFILE_ERROR_STATUS = 0x8002ab46,
|
||||
SCE_NP_PROFILE_ERROR_BUSY = 0x8002ab47,
|
||||
SCE_NP_PROFILE_ERROR_INVALID_ARGUMENT = 0x8002ab48,
|
||||
SCE_NP_PROFILE_ERROR_ABORT = 0x8002ab49,
|
||||
|
||||
// NP Community Utility
|
||||
SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED = 0x8002a101,
|
||||
|
@ -117,6 +182,64 @@ enum
|
|||
SCE_NP_COMMUNITY_ERROR_INVALID_PARTITION = 0x8002a1af,
|
||||
SCE_NP_COMMUNITY_ERROR_TOO_MANY_SLOTID = 0x8002a1b1,
|
||||
|
||||
// NP Community Server
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_BAD_REQUEST = 0x8002a401,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_TICKET = 0x8002a402,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_SIGNATURE = 0x8002a403,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_EXPIRED_TICKET = 0x8002a404,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_NPID = 0x8002a405,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_FORBIDDEN = 0x8002a406,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INTERNAL_SERVER_ERROR = 0x8002a407,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_VERSION_NOT_SUPPORTED = 0x8002a408,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_SERVICE_UNAVAILABLE = 0x8002a409,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_PLAYER_BANNED = 0x8002a40a,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_CENSORED = 0x8002a40b,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_RECORD_FORBIDDEN = 0x8002a40c,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_USER_PROFILE_NOT_FOUND = 0x8002a40d,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_UPLOADER_DATA_NOT_FOUND = 0x8002a40e,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_QUOTA_MASTER_NOT_FOUND = 0x8002a40f,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_TITLE_NOT_FOUND = 0x8002a410,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_BLACKLISTED_USER_ID = 0x8002a411,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_GAME_RANKING_NOT_FOUND = 0x8002a412,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_STORE_NOT_FOUND = 0x8002a414,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE = 0x8002a415,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_LATEST_UPDATE_NOT_FOUND = 0x8002a416,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_BOARD_MASTER_NOT_FOUND = 0x8002a417,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_GAME_DATA_MASTER_NOT_FOUND = 0x8002a418,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ANTICHEAT_DATA = 0x8002a419,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_TOO_LARGE_DATA = 0x8002a41a,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_NO_SUCH_USER_NPID = 0x8002a41b,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ENVIRONMENT = 0x8002a41d,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ONLINE_NAME_CHARACTER = 0x8002a41f,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ONLINE_NAME_LENGTH = 0x8002a420,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ABOUT_ME_CHARACTER = 0x8002a421,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_ABOUT_ME_LENGTH = 0x8002a422,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_SCORE = 0x8002a423,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_OVER_THE_RANKING_LIMIT = 0x8002a424,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_FAIL_TO_CREATE_SIGNATURE = 0x8002a426,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_MASTER_INFO_NOT_FOUND = 0x8002a427,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_OVER_THE_GAME_DATA_LIMIT = 0x8002a428,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_SELF_DATA_NOT_FOUND = 0x8002a42a,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_USER_NOT_ASSIGNED = 0x8002a42b,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_GAME_DATA_ALREADY_EXISTS = 0x8002a42c,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_TOO_MANY_RESULTS = 0x8002a42d,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_NOT_RECORDABLE_VERSION = 0x8002a42e,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_USER_STORAGE_TITLE_MASTER_NOT_FOUND = 0x8002a448,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_INVALID_VIRTUAL_USER = 0x8002a449,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_USER_STORAGE_DATA_NOT_FOUND = 0x8002a44a,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_CONDITIONS_NOT_SATISFIED = 0x8002a473,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_MATCHING_BEFORE_SERVICE = 0x8002a4a0,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_MATCHING_END_OF_SERVICE = 0x8002a4a1,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_MATCHING_MAINTENANCE = 0x8002a4a2,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_BEFORE_SERVICE = 0x8002a4a3,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_END_OF_SERVICE = 0x8002a4a4,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_RANKING_MAINTENANCE = 0x8002a4a5,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_NO_SUCH_TITLE = 0x8002a4a6,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_TITLE_USER_STORAGE_BEFORE_SERVICE = 0x8002a4aa,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_TITLE_USER_STORAGE_END_OF_SERVICE = 0x8002a4ab,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_TITLE_USER_STORAGE_MAINTENANCE = 0x8002a4ac,
|
||||
SCE_NP_COMMUNITY_SERVER_ERROR_UNSPECIFIED = 0x8002a4ff,
|
||||
|
||||
// DRM
|
||||
SCE_NP_DRM_ERROR_LICENSE_NOT_FOUND = 0x80029521,
|
||||
SCE_NP_DRM_ERROR_OUT_OF_MEMORY = 0x80029501,
|
||||
|
@ -138,9 +261,239 @@ enum
|
|||
SCE_NP_DRM_ERROR_FORMAT = 0x80029530,
|
||||
SCE_NP_DRM_ERROR_FILENAME = 0x80029533,
|
||||
SCE_NP_DRM_ERROR_K_LICENSEE = 0x80029534,
|
||||
|
||||
// Auth
|
||||
SCE_NP_AUTH_EINVAL = 0x8002a002,
|
||||
SCE_NP_AUTH_ENOMEM = 0x8002a004,
|
||||
SCE_NP_AUTH_ESRCH = 0x8002a005,
|
||||
SCE_NP_AUTH_EBUSY = 0x8002a00a,
|
||||
SCE_NP_AUTH_EABORT = 0x8002a00c,
|
||||
SCE_NP_AUTH_EEXIST = 0x8002a014,
|
||||
SCE_NP_AUTH_EINVALID_ARGUMENT = 0x8002a015,
|
||||
|
||||
// Auth extended
|
||||
SCE_NP_AUTH_ERROR_SERVICE_END = 0x8002a200,
|
||||
SCE_NP_AUTH_ERROR_SERVICE_DOWN = 0x8002a201,
|
||||
SCE_NP_AUTH_ERROR_SERVICE_BUSY = 0x8002a202,
|
||||
SCE_NP_AUTH_ERROR_SERVER_MAINTENANCE = 0x8002a203,
|
||||
SCE_NP_AUTH_ERROR_INVALID_DATA_LENGTH = 0x8002a210,
|
||||
SCE_NP_AUTH_ERROR_INVALID_USER_AGENT = 0x8002a211,
|
||||
SCE_NP_AUTH_ERROR_INVALID_VERSION = 0x8002a212,
|
||||
SCE_NP_AUTH_ERROR_INVALID_SERVICE_ID = 0x8002a220,
|
||||
SCE_NP_AUTH_ERROR_INVALID_CREDENTIAL = 0x8002a221,
|
||||
SCE_NP_AUTH_ERROR_INVALID_ENTITLEMENT_ID = 0x8002a222,
|
||||
SCE_NP_AUTH_ERROR_INVALID_CONSUMED_COUNT = 0x8002a223,
|
||||
SCE_NP_AUTH_ERROR_INVALID_CONSOLE_ID = 0x8002a224,
|
||||
SCE_NP_AUTH_ERROR_CONSOLE_ID_SUSPENDED = 0x8002a227,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_CLOSED = 0x8002a230,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_SUSPENDED = 0x8002a231,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_EULA = 0x8002a232,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT1 = 0x8002a240,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT2 = 0x8002a241,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT3 = 0x8002a242,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT4 = 0x8002a243,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT5 = 0x8002a244,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT6 = 0x8002a245,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT7 = 0x8002a246,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT8 = 0x8002a247,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT9 = 0x8002a248,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT10 = 0x8002a249,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT11 = 0x8002a24a,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT12 = 0x8002a24b,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT13 = 0x8002a24c,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT14 = 0x8002a24d,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT15 = 0x8002a24e,
|
||||
SCE_NP_AUTH_ERROR_ACCOUNT_RENEW_ACCOUNT16 = 0x8002a24f,
|
||||
SCE_NP_AUTH_ERROR_UNKNOWN = 0x8002a280,
|
||||
|
||||
// Core Utility
|
||||
SCE_NP_CORE_UTIL_ERROR_INVALID_ARGUMENT = 0x8002a501,
|
||||
SCE_NP_CORE_UTIL_ERROR_OUT_OF_MEMORY = 0x8002a502,
|
||||
SCE_NP_CORE_UTIL_ERROR_INSUFFICIENT = 0x8002a503,
|
||||
SCE_NP_CORE_UTIL_ERROR_PARSER_FAILED = 0x8002a504,
|
||||
SCE_NP_CORE_UTIL_ERROR_INVALID_PROTOCOL_ID = 0x8002a505,
|
||||
SCE_NP_CORE_UTIL_ERROR_INVALID_EXTENSION = 0x8002a506,
|
||||
SCE_NP_CORE_UTIL_ERROR_INVALID_TEXT = 0x8002a507,
|
||||
SCE_NP_CORE_UTIL_ERROR_UNKNOWN_TYPE = 0x8002a508,
|
||||
SCE_NP_CORE_UTIL_ERROR_UNKNOWN = 0x8002a509,
|
||||
|
||||
// Core Parser
|
||||
SCE_NP_CORE_PARSER_ERROR_NOT_INITIALIZED = 0x8002a511,
|
||||
SCE_NP_CORE_PARSER_ERROR_ALREADY_INITIALIZED = 0x8002a512,
|
||||
SCE_NP_CORE_PARSER_ERROR_OUT_OF_MEMORY = 0x8002a513,
|
||||
SCE_NP_CORE_PARSER_ERROR_INSUFFICIENT = 0x8002a514,
|
||||
SCE_NP_CORE_PARSER_ERROR_INVALID_FORMAT = 0x8002a515,
|
||||
SCE_NP_CORE_PARSER_ERROR_INVALID_ARGUMENT = 0x8002a516,
|
||||
SCE_NP_CORE_PARSER_ERROR_INVALID_HANDLE = 0x8002a517,
|
||||
SCE_NP_CORE_PARSER_ERROR_INVALID_ICON = 0x8002a518,
|
||||
SCE_NP_CORE_PARSER_ERROR_UNKNOWN = 0x8002a519,
|
||||
|
||||
// Core Errors
|
||||
SCE_NP_CORE_ERROR_ALREADY_INITIALIZED = 0x8002a521,
|
||||
SCE_NP_CORE_ERROR_NOT_INITIALIZED = 0x8002a522,
|
||||
SCE_NP_CORE_ERROR_INVALID_ARGUMENT = 0x8002a523,
|
||||
SCE_NP_CORE_ERROR_OUT_OF_MEMORY = 0x8002a524,
|
||||
SCE_NP_CORE_ERROR_ID_NOT_AVAILABLE = 0x8002a525,
|
||||
SCE_NP_CORE_ERROR_USER_OFFLINE = 0x8002a526,
|
||||
SCE_NP_CORE_ERROR_SESSION_RUNNING = 0x8002a527,
|
||||
SCE_NP_CORE_ERROR_SESSION_NOT_ESTABLISHED = 0x8002a528,
|
||||
SCE_NP_CORE_ERROR_SESSION_INVALID_STATE = 0x8002a529,
|
||||
SCE_NP_CORE_ERROR_SESSION_ID_TOO_LONG = 0x8002a52a,
|
||||
SCE_NP_CORE_ERROR_SESSION_INVALID_NAMESPACE = 0x8002a52b,
|
||||
SCE_NP_CORE_ERROR_CONNECTION_TIMEOUT = 0x8002a52c,
|
||||
SCE_NP_CORE_ERROR_GETSOCKOPT = 0x8002a52d,
|
||||
SCE_NP_CORE_ERROR_SSL_NOT_INITIALIZED = 0x8002a52e,
|
||||
SCE_NP_CORE_ERROR_SSL_ALREADY_INITIALIZED = 0x8002a52f,
|
||||
SCE_NP_CORE_ERROR_SSL_NO_CERT = 0x8002a530,
|
||||
SCE_NP_CORE_ERROR_SSL_NO_TRUSTWORTHY_CA = 0x8002a531,
|
||||
SCE_NP_CORE_ERROR_SSL_INVALID_CERT = 0x8002a532,
|
||||
SCE_NP_CORE_ERROR_SSL_CERT_VERIFY = 0x8002a533,
|
||||
SCE_NP_CORE_ERROR_SSL_CN_CHECK = 0x8002a534,
|
||||
SCE_NP_CORE_ERROR_SSL_HANDSHAKE_FAILED = 0x8002a535,
|
||||
SCE_NP_CORE_ERROR_SSL_SEND = 0x8002a536,
|
||||
SCE_NP_CORE_ERROR_SSL_RECV = 0x8002a537,
|
||||
SCE_NP_CORE_ERROR_SSL_CREATE_CTX = 0x8002a538,
|
||||
SCE_NP_CORE_ERROR_PARSE_PEM = 0x8002a539,
|
||||
SCE_NP_CORE_ERROR_INVALID_INITIATE_STREAM = 0x8002a53a,
|
||||
SCE_NP_CORE_ERROR_SASL_NOT_SUPPORTED = 0x8002a53b,
|
||||
SCE_NP_CORE_ERROR_NAMESPACE_ALREADY_EXISTS = 0x8002a53c,
|
||||
SCE_NP_CORE_ERROR_FROM_ALREADY_EXISTS = 0x8002a53d,
|
||||
SCE_NP_CORE_ERROR_MODULE_NOT_REGISTERED = 0x8002a53e,
|
||||
SCE_NP_CORE_ERROR_MODULE_FROM_NOT_FOUND = 0x8002a53f,
|
||||
SCE_NP_CORE_ERROR_UNKNOWN_NAMESPACE = 0x8002a540,
|
||||
SCE_NP_CORE_ERROR_INVALID_VERSION = 0x8002a541,
|
||||
SCE_NP_CORE_ERROR_LOGIN_TIMEOUT = 0x8002a542,
|
||||
SCE_NP_CORE_ERROR_TOO_MANY_SESSIONS = 0x8002a543,
|
||||
SCE_NP_CORE_ERROR_SENDLIST_NOT_FOUND = 0x8002a544,
|
||||
SCE_NP_CORE_ERROR_NO_ID = 0x8002a545,
|
||||
SCE_NP_CORE_ERROR_LOAD_CERTS = 0x8002a546,
|
||||
SCE_NP_CORE_ERROR_NET_SELECT = 0x8002a547,
|
||||
SCE_NP_CORE_ERROR_DISCONNECTED = 0x8002a548,
|
||||
SCE_NP_CORE_ERROR_TICKET_TOO_SMALL = 0x8002a549,
|
||||
SCE_NP_CORE_ERROR_INVALID_TICKET = 0x8002a54a,
|
||||
SCE_NP_CORE_ERROR_INVALID_ONLINEID = 0x8002a54b,
|
||||
SCE_NP_CORE_ERROR_GETHOSTBYNAME = 0x8002a54c,
|
||||
SCE_NP_CORE_ERROR_UNDEFINED_STREAM_ERROR = 0x8002a54d,
|
||||
SCE_NP_CORE_ERROR_INTERNAL = 0x8002a5ff,
|
||||
|
||||
// Core DNS
|
||||
SCE_NP_CORE_ERROR_DNS_HOST_NOT_FOUND = 0x8002af01,
|
||||
SCE_NP_CORE_ERROR_DNS_TRY_AGAIN = 0x8002af02,
|
||||
SCE_NP_CORE_ERROR_DNS_NO_RECOVERY = 0x8002af03,
|
||||
SCE_NP_CORE_ERROR_DNS_NO_DATA = 0x8002af04,
|
||||
SCE_NP_CORE_ERROR_DNS_NO_ADDRESS = 0x8002afff,
|
||||
|
||||
// Core Server
|
||||
SCE_NP_CORE_SERVER_ERROR_CONFLICT = 0x8002a303,
|
||||
SCE_NP_CORE_SERVER_ERROR_NOT_AUTHORIZED = 0x8002a30d,
|
||||
SCE_NP_CORE_SERVER_ERROR_REMOTE_CONNECTION_FAILED = 0x8002a30f,
|
||||
SCE_NP_CORE_SERVER_ERROR_RESOURCE_CONSTRAINT = 0x8002a310,
|
||||
SCE_NP_CORE_SERVER_ERROR_SYSTEM_SHUTDOWN = 0x8002a313,
|
||||
SCE_NP_CORE_SERVER_ERROR_UNSUPPORTED_CLIENT_VERSION = 0x8002a319,
|
||||
|
||||
// Signaling
|
||||
SCE_NP_SIGNALING_ERROR_NOT_INITIALIZED = 0x8002a801,
|
||||
SCE_NP_SIGNALING_ERROR_ALREADY_INITIALIZED = 0x8002a802,
|
||||
SCE_NP_SIGNALING_ERROR_OUT_OF_MEMORY = 0x8002a803,
|
||||
SCE_NP_SIGNALING_ERROR_CTXID_NOT_AVAILABLE = 0x8002a804,
|
||||
SCE_NP_SIGNALING_ERROR_CTX_NOT_FOUND = 0x8002a805,
|
||||
SCE_NP_SIGNALING_ERROR_REQID_NOT_AVAILABLE = 0x8002a806,
|
||||
SCE_NP_SIGNALING_ERROR_REQ_NOT_FOUND = 0x8002a807,
|
||||
SCE_NP_SIGNALING_ERROR_PARSER_CREATE_FAILED = 0x8002a808,
|
||||
SCE_NP_SIGNALING_ERROR_PARSER_FAILED = 0x8002a809,
|
||||
SCE_NP_SIGNALING_ERROR_INVALID_NAMESPACE = 0x8002a80a,
|
||||
SCE_NP_SIGNALING_ERROR_NETINFO_NOT_AVAILABLE = 0x8002a80b,
|
||||
SCE_NP_SIGNALING_ERROR_PEER_NOT_RESPONDING = 0x8002a80c,
|
||||
SCE_NP_SIGNALING_ERROR_CONNID_NOT_AVAILABLE = 0x8002a80d,
|
||||
SCE_NP_SIGNALING_ERROR_CONN_NOT_FOUND = 0x8002a80e,
|
||||
SCE_NP_SIGNALING_ERROR_PEER_UNREACHABLE = 0x8002a80f,
|
||||
SCE_NP_SIGNALING_ERROR_TERMINATED_BY_PEER = 0x8002a810,
|
||||
SCE_NP_SIGNALING_ERROR_TIMEOUT = 0x8002a811,
|
||||
SCE_NP_SIGNALING_ERROR_CTX_MAX = 0x8002a812,
|
||||
SCE_NP_SIGNALING_ERROR_RESULT_NOT_FOUND = 0x8002a813,
|
||||
SCE_NP_SIGNALING_ERROR_CONN_IN_PROGRESS = 0x8002a814,
|
||||
SCE_NP_SIGNALING_ERROR_INVALID_ARGUMENT = 0x8002a815,
|
||||
SCE_NP_SIGNALING_ERROR_OWN_NP_ID = 0x8002a816,
|
||||
SCE_NP_SIGNALING_ERROR_TOO_MANY_CONN = 0x8002a817,
|
||||
SCE_NP_SIGNALING_ERROR_TERMINATED_BY_MYSELF = 0x8002a818,
|
||||
|
||||
// Custom Menu
|
||||
SCE_NP_CUSTOM_MENU_ERROR_ALREADY_INITIALIZED = 0x80023b01,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_NOT_INITIALIZED = 0x80023b02,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_OUT_OF_MEMORY = 0x80023b03,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_NOT_SUPPORTED = 0x80023b04,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_INSUFFICIENT = 0x80023b05,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_CANCEL = 0x80023b06,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_STATUS = 0x80023b07,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_BUSY = 0x80023b08,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_INVALID_ARGUMENT = 0x80023b09,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_ABORT = 0x80023b0a,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_NOT_REGISTERED = 0x80023b0b,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_EXCEEDS_MAX = 0x80023b0c,
|
||||
SCE_NP_CUSTOM_MENU_ERROR_INVALID_CHARACTER = 0x80023b0d,
|
||||
};
|
||||
|
||||
using SceNpBasicEventHandler = s32(s32 event, s32 retCode, u32 reqId, vm::ptr<void> arg);
|
||||
// Basic presence options
|
||||
enum
|
||||
{
|
||||
SCE_NP_BASIC_PRESENCE_OPTIONS_SET_DATA = 0x00000001,
|
||||
SCE_NP_BASIC_PRESENCE_OPTIONS_SET_STATUS = 0x00000002,
|
||||
SCE_NP_BASIC_PRESENCE_OPTIONS_ALL_OPTIONS = 0x00000003, // sum of all other options
|
||||
};
|
||||
|
||||
// Basic presence states
|
||||
enum
|
||||
{
|
||||
SCE_NP_BASIC_PRESENCE_STATE_OFFLINE = 0,
|
||||
SCE_NP_BASIC_PRESENCE_STATE_OUT_OF_CONTEXT = 1,
|
||||
SCE_NP_BASIC_PRESENCE_STATE_IN_CONTEXT = 2
|
||||
};
|
||||
|
||||
// Basic player options
|
||||
enum
|
||||
{
|
||||
SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_BY_NP_COMM_ID = 0,
|
||||
SCE_NP_BASIC_PLAYERS_HISTORY_OPTIONS_ALL = 1
|
||||
};
|
||||
|
||||
// Custom menu selection types
|
||||
enum : SceNpCustomMenuSelectedType
|
||||
{
|
||||
SCE_NP_CUSTOM_MENU_SELECTED_TYPE_ME = 1,
|
||||
SCE_NP_CUSTOM_MENU_SELECTED_TYPE_FRIEND = 2,
|
||||
SCE_NP_CUSTOM_MENU_SELECTED_TYPE_PLAYER = 3,
|
||||
};
|
||||
|
||||
// Custom menu action masks
|
||||
enum SceNpCustomMenuActionMask : u32
|
||||
{
|
||||
SCE_NP_CUSTOM_MENU_ACTION_MASK_ME = 0x00000001,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_MASK_FRIEND = 0x00000002,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_MASK_PLAYER = 0x00000004,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_MASK_ALL = 0x00000007 // sum of all other masks
|
||||
};
|
||||
|
||||
// Custom menu index mask
|
||||
enum
|
||||
{
|
||||
SCE_NP_CUSTOM_MENU_INDEX_BITS = (sizeof(SceNpCustomMenuIndexMask) * 8),
|
||||
SCE_NP_CUSTOM_MENU_INDEX_BITS_ALL = ((SceNpCustomMenuIndexMask) - 1),
|
||||
SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT = 5,
|
||||
SCE_NP_CUSTOM_MENU_INDEX_BITS_MASK = (SCE_NP_CUSTOM_MENU_INDEX_BITS - 1),
|
||||
SCE_NP_CUSTOM_MENU_INDEX_BITS_MAX = 127,
|
||||
SCE_NP_CUSTOM_MENU_INDEX_SETSIZE = 128,
|
||||
};
|
||||
|
||||
#define SCE_NP_CUSTOM_MENU_INDEX_SET(n, p) ((p)->index_bits[(n) >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT] |= (1 << ((n) & SCE_NP_CUSTOM_MENU_INDEX_BITS_MASK)))
|
||||
#define SCE_NP_CUSTOM_MENU_INDEX_CLR(n, p) ((p)->index_bits[(n) >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT] &= ~(1 << ((n) & SCE_NP_CUSTOM_MENU_INDEX_BITS_MASK)))
|
||||
#define SCE_NP_CUSTOM_MENU_INDEX_ISSET(n, p) ((p)->index_bits[(n) >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT] & (1 << ((n) & SCE_NP_CUSTOM_MENU_INDEX_BITS_MASK)))
|
||||
#define SCE_NP_CUSTOM_MENU_INDEX_ZERO(p) ( for (u32 i = 0; i < (SCE_NP_CUSTOM_MENU_INDEX_SETSIZE >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT); i++) p->index_bits[i] = 0; )
|
||||
#define SCE_NP_CUSTOM_MENU_INDEX_SET_ALL(p) ( for (u32 i = 0; i < (SCE_NP_CUSTOM_MENU_INDEX_SETSIZE >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT); i++) p->index_bits[i] = SCE_NP_CUSTOM_MENU_INDEX_BITS_ALL; )
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_DRM_OPEN_FLAG = 2
|
||||
};
|
||||
|
||||
// NP Manager Utility statuses
|
||||
enum
|
||||
|
@ -185,9 +538,10 @@ enum
|
|||
};
|
||||
|
||||
// IDs for attachment data objects
|
||||
enum
|
||||
enum : SceNpBasicAttachmentDataId
|
||||
{
|
||||
SCE_NP_BASIC_INVALID_ATTACHMENT_DATA_ID = 0,
|
||||
SCE_NP_BASIC_INVALID_MESSAGE_ID = 0,
|
||||
SCE_NP_BASIC_SELECTED_INVITATION_DATA = 1,
|
||||
SCE_NP_BASIC_SELECTED_MESSAGE_DATA = 2,
|
||||
};
|
||||
|
@ -202,7 +556,7 @@ enum
|
|||
};
|
||||
|
||||
// Main types of messages
|
||||
enum
|
||||
enum SceNpBasicMessageMainType : u16
|
||||
{
|
||||
SCE_NP_BASIC_MESSAGE_MAIN_TYPE_DATA_ATTACHMENT = 0,
|
||||
SCE_NP_BASIC_MESSAGE_MAIN_TYPE_GENERAL = 1,
|
||||
|
@ -213,7 +567,7 @@ enum
|
|||
};
|
||||
|
||||
// Sub types of messages
|
||||
enum
|
||||
enum SceNpBasicMessageSubType : u16
|
||||
{
|
||||
SCE_NP_BASIC_MESSAGE_DATA_ATTACHMENT_SUBTYPE_ACTION_USE = 0,
|
||||
SCE_NP_BASIC_MESSAGE_GENERAL_SUBTYPE_NONE = 0,
|
||||
|
@ -225,15 +579,21 @@ enum
|
|||
};
|
||||
|
||||
// Applicable features of messages
|
||||
enum
|
||||
#define SCE_NP_BASIC_MESSAGE_FEATURES_EXP_MIN(min) ((((u32)min << 16) | (0 << 15)) & 0xFFFF8000)
|
||||
enum SceNpBasicMessageFeatures : u32
|
||||
{
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_MULTI_RECEIPIENTS = 0x00000001,
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_BOOTABLE = 0x00000002,
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_ASSUME_SEND = 0x00000004,
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_ALL_FEATURES =
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_MULTI_RECEIPIENTS |
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_BOOTABLE |
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_ASSUME_SEND |
|
||||
SCE_NP_BASIC_MESSAGE_FEATURES_EXP_MIN(0xffff)
|
||||
};
|
||||
|
||||
// Types of messages
|
||||
enum
|
||||
enum SceNpBasicMessageInfoType : u32
|
||||
{
|
||||
SCE_NP_BASIC_MESSAGE_INFO_TYPE_MESSAGE_ATTACHMENT = 0,
|
||||
SCE_NP_BASIC_MESSAGE_INFO_TYPE_MATCHING_INVITATION = 1,
|
||||
|
@ -307,6 +667,15 @@ enum
|
|||
SCE_NP_SIGNALING_NETINFO_NPPORT_STATUS_OPEN = 1,
|
||||
};
|
||||
|
||||
// NP Receive message options
|
||||
enum SceNpBasicMessageRecvOptions : u32
|
||||
{
|
||||
SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_PRESERVE = 0x00000001,
|
||||
SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_INCLUDE_BOOTABLE = 0x00000002,
|
||||
SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_ASSUME_LATEST = 0x00000004,
|
||||
SCE_NP_BASIC_RECV_MESSAGE_OPTIONS_ALL_OPTIONS = 0x00000007 // sum of all other options
|
||||
};
|
||||
|
||||
// Constants for common NP functions and structures
|
||||
enum
|
||||
{
|
||||
|
@ -325,6 +694,13 @@ enum
|
|||
SCE_NP_COMMUNICATION_PASSPHRASE_SIZE = SCE_NET_NP_COMMUNICATION_PASSPHRASE_SIZE,
|
||||
};
|
||||
|
||||
enum SceNpAvatarSizeType
|
||||
{
|
||||
SCE_NP_AVATAR_SIZE_LARGE,
|
||||
SCE_NP_AVATAR_SIZE_MIDDLE,
|
||||
SCE_NP_AVATAR_SIZE_SMALL
|
||||
};
|
||||
|
||||
// Constants for basic NP functions and structures
|
||||
enum
|
||||
{
|
||||
|
@ -357,10 +733,10 @@ enum
|
|||
// Constants for custom menu functions and structures
|
||||
enum
|
||||
{
|
||||
SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX = 21,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_ITEMS_MAX = 7,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX = 21,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_ITEMS_MAX = 7,
|
||||
SCE_NP_CUSTOM_MENU_ACTION_ITEMS_TOTAL_MAX = 16,
|
||||
SCE_NP_CUSTOM_MENU_EXCEPTION_ITEMS_MAX = 256,
|
||||
SCE_NP_CUSTOM_MENU_EXCEPTION_ITEMS_MAX = 256,
|
||||
};
|
||||
|
||||
// Constants for manager functions and structures
|
||||
|
@ -375,14 +751,30 @@ enum
|
|||
// Constants for ranking (score) functions and structures
|
||||
enum
|
||||
{
|
||||
SCE_NP_SCORE_COMMENT_MAXLEN = 63,
|
||||
SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN = 255,
|
||||
SCE_NP_SCORE_SANITIZE_COMMENT_MAXLEN = 255,
|
||||
SCE_NP_SCORE_GAMEINFO_SIZE = 64,
|
||||
SCE_NP_SCORE_MAX_CTX_NUM = 32,
|
||||
SCE_NP_SCORE_MAX_RANGE_NUM_PER_TRANS = 100,
|
||||
SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS = 101,
|
||||
SCE_NP_SCORE_MAX_CLAN_NUM_PER_TRANS = 101,
|
||||
SCE_NP_SCORE_MAX_CTX_NUM = 32,
|
||||
SCE_NP_SCORE_COMMENT_MAXLEN = 63,
|
||||
SCE_NP_SCORE_GAMEDATA_ID_LEN = 63,
|
||||
SCE_NP_SCORE_GAMEINFO_SIZE = 64,
|
||||
SCE_NP_SCORE_PASSPHRASE_SIZE = 128,
|
||||
SCE_NP_SCORE_CENSOR_COMMENT_MAXLEN = 255,
|
||||
SCE_NP_SCORE_SANITIZE_COMMENT_MAXLEN = 255,
|
||||
SCE_NP_SCORE_MAX_RANGE_NUM_PER_TRANS = 100,
|
||||
SCE_NP_SCORE_MAX_NPID_NUM_PER_TRANS = 101,
|
||||
SCE_NP_SCORE_MAX_CLAN_NUM_PER_TRANS = 101,
|
||||
SCE_NP_SCORE_MAX_SELECTED_FRIENDS_NUM = 100,
|
||||
SCE_NP_SCORE_VARIABLE_SIZE_GAMEINFO_MAXSIZE = 189,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_SCORE_NORMAL_UPDATE = 0,
|
||||
SCE_NP_SCORE_FORCE_UPDATE = 1
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_SCORE_DESCENDING_ORDER = 0,
|
||||
SCE_NP_SCORE_ASCENDING_ORDER = 1
|
||||
};
|
||||
|
||||
// Constants for signaling functions and structures
|
||||
|
@ -391,6 +783,38 @@ enum
|
|||
SCE_NP_SIGNALING_CTX_MAX = 8,
|
||||
};
|
||||
|
||||
enum : SceNpPlatformType
|
||||
{
|
||||
SCE_NP_PLATFORM_TYPE_NONE = 0,
|
||||
SCE_NP_PLATFORM_TYPE_PS3 = 1,
|
||||
SCE_NP_PLATFORM_TYPE_VITA = 2
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_MATCHING_GUI_EVENT_CREATE_ROOM = 0x0001,
|
||||
SCE_NP_MATCHING_GUI_EVENT_JOIN_ROOM = 0x0002,
|
||||
SCE_NP_MATCHING_GUI_EVENT_RESERVED2 = 0x0003,
|
||||
SCE_NP_MATCHING_GUI_EVENT_SEARCH_JOIN = 0x0004,
|
||||
SCE_NP_MATCHING_GUI_EVENT_QUICK_MATCH = 0x0005,
|
||||
SCE_NP_MATCHING_GUI_EVENT_SEND_INVITATION = 0x0006,
|
||||
SCE_NP_MATCHING_GUI_EVENT_ACCEPT_INVITATION = 0x0007,
|
||||
SCE_NP_MATCHING_GUI_EVENT_COMMON_LOAD = 0x0008,
|
||||
SCE_NP_MATCHING_GUI_EVENT_COMMON_UNLOAD = 0x0009,
|
||||
SCE_NP_MATCHING_GUI_EVENT_RESERVED3 = 0x000a,
|
||||
SCE_NP_MATCHING_GUI_EVENT_GET_ROOM_LIST_LIMIT = 0x000b
|
||||
};
|
||||
|
||||
struct SceNpDrmKey
|
||||
{
|
||||
u8 keydata[16];
|
||||
};
|
||||
|
||||
struct SceNpDrmOpenArg
|
||||
{
|
||||
be_t<u64> flag;
|
||||
};
|
||||
|
||||
// NP communication ID structure
|
||||
struct SceNpCommunicationId
|
||||
{
|
||||
|
@ -508,7 +932,7 @@ struct SceNpBasicExtendedAttachmentData
|
|||
SceNpBasicAttachmentData data;
|
||||
be_t<u32> userAction;
|
||||
b8 markedAsUsed;
|
||||
//be_t<u8> reserved[3];
|
||||
u8 reserved[3];
|
||||
};
|
||||
|
||||
// Message structure
|
||||
|
@ -676,10 +1100,11 @@ union SceNpSignalingConnectionInfo
|
|||
be_t<u32> rtt;
|
||||
be_t<u32> bandwidth;
|
||||
SceNpId npId;
|
||||
struct address {
|
||||
struct
|
||||
{
|
||||
be_t<u32> addr; // in_addr
|
||||
be_t<u16> port; // in_port_t
|
||||
};
|
||||
} address;
|
||||
be_t<u32> packet_loss;
|
||||
};
|
||||
|
||||
|
@ -695,5 +1120,181 @@ struct SceNpSignalingNetInfo
|
|||
be_t<u16> npport;
|
||||
};
|
||||
|
||||
// NP signaling callback function
|
||||
typedef void(*SceNpSignalingHandler)(u32 ctx_id, u32 subject_id, s32 event, s32 error_code, u32 arg_addr);
|
||||
struct SceNpCustomMenuAction
|
||||
{
|
||||
be_t<u32> options;
|
||||
char name[SCE_NP_CUSTOM_MENU_ACTION_CHARACTER_MAX];
|
||||
be_t<SceNpCustomMenuActionMask> mask;
|
||||
};
|
||||
|
||||
struct SceNpCustomMenu
|
||||
{
|
||||
be_t<u64> options;
|
||||
vm::bptr<SceNpCustomMenuAction> actions;
|
||||
be_t<u32> numActions;
|
||||
};
|
||||
|
||||
struct SceNpCustomMenuIndexArray
|
||||
{
|
||||
be_t<SceNpCustomMenuIndexMask> index_bits[SCE_NP_CUSTOM_MENU_INDEX_SETSIZE >> SCE_NP_CUSTOM_MENU_INDEX_BITS_SHIFT];
|
||||
};
|
||||
|
||||
struct SceNpCustomMenuActionExceptions
|
||||
{
|
||||
be_t<u32> options;
|
||||
SceNpId npid;
|
||||
SceNpCustomMenuIndexArray actions;
|
||||
u8 reserved[4];
|
||||
};
|
||||
|
||||
struct SceNpCommerceProductCategory
|
||||
{
|
||||
be_t<u32> version;
|
||||
vm::bcptr<void> data;
|
||||
be_t<u64> dataSize;
|
||||
be_t<u32> dval;
|
||||
u8 reserved[16];
|
||||
};
|
||||
|
||||
struct SceNpCommerceProductSkuInfo
|
||||
{
|
||||
vm::bptr<SceNpCommerceProductCategory> pc;
|
||||
vm::bcptr<void> data;
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
struct SceNpCommerceCategoryInfo
|
||||
{
|
||||
vm::bptr<SceNpCommerceProductCategory> pc;
|
||||
vm::bcptr<void> data;
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
struct SceNpCommerceCurrencyInfo
|
||||
{
|
||||
vm::bptr<SceNpCommerceProductCategory> pc;
|
||||
vm::bcptr<void> data;
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
struct SceNpCommercePrice
|
||||
{
|
||||
be_t<u32> integer;
|
||||
be_t<u32> fractional;
|
||||
};
|
||||
|
||||
struct SceNpTicketVersion
|
||||
{
|
||||
be_t<u16> major;
|
||||
be_t<u16> minor;
|
||||
};
|
||||
|
||||
union SceNpTicketParam
|
||||
{
|
||||
be_t<s32> i32;
|
||||
be_t<s64> i64;
|
||||
be_t<u32> u32;
|
||||
be_t<u64> u64;
|
||||
SceNpDate date;
|
||||
u8 data[SCE_NP_TICKET_PARAM_DATA_LEN];
|
||||
};
|
||||
|
||||
struct SceNpEntitlement
|
||||
{
|
||||
SceNpEntitlementId id;
|
||||
be_t<SceNpTime> created_date;
|
||||
be_t<SceNpTime> expire_date;
|
||||
be_t<u32> type;
|
||||
be_t<s32> remaining_count;
|
||||
be_t<u32> consumed_count;
|
||||
u8 padding[4];
|
||||
};
|
||||
|
||||
struct SceNpLobbyId
|
||||
{
|
||||
u8 opt[28];
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
struct SceNpRoomId
|
||||
{
|
||||
u8 opt[28];
|
||||
u8 reserved[8];
|
||||
};
|
||||
|
||||
struct SceNpMatchingAttr
|
||||
{
|
||||
vm::bptr<SceNpMatchingAttr> next;
|
||||
be_t<s32> type;
|
||||
be_t<u32> id;
|
||||
union
|
||||
{
|
||||
be_t<u32> num;
|
||||
struct
|
||||
{
|
||||
vm::bptr<void> ptr;
|
||||
be_t<u64> size;
|
||||
} data;
|
||||
} value;
|
||||
};
|
||||
|
||||
struct SceNpMatchingSearchCondition
|
||||
{
|
||||
vm::bptr<SceNpMatchingSearchCondition> next;
|
||||
be_t<s32> target_attr_type;
|
||||
be_t<u32> target_attr_id;
|
||||
be_t<s32> comp_op;
|
||||
be_t<s32> comp_type;
|
||||
SceNpMatchingAttr compared;
|
||||
};
|
||||
|
||||
struct SceNpMatchingReqRange
|
||||
{
|
||||
be_t<u32> start;
|
||||
be_t<u32> max;
|
||||
};
|
||||
|
||||
struct SceNpScoreVariableSizeGameInfo
|
||||
{
|
||||
be_t<u64> infoSize;
|
||||
u8 data[SCE_NP_SCORE_VARIABLE_SIZE_GAMEINFO_MAXSIZE];
|
||||
u8 pad[3];
|
||||
};
|
||||
|
||||
struct SceNpScoreRecordOptParam
|
||||
{
|
||||
be_t<u64> size;
|
||||
vm::bptr<SceNpScoreVariableSizeGameInfo> vsInfo;
|
||||
vm::bptr<CellRtcTick> reserved;
|
||||
};
|
||||
|
||||
// NP callback functions
|
||||
using SceNpCustomMenuEventHandler = s32(s32 retCode, u32 index, vm::cptr<SceNpId> npid, SceNpCustomMenuSelectedType type, vm::ptr<void> arg);
|
||||
using SceNpBasicEventHandler = s32(s32 event, s32 retCode, u32 reqId, vm::ptr<void> arg);
|
||||
using SceNpCommerceHandler = void(u32 ctx_id, u32 subject_id, s32 event, s32 error_code, vm::ptr<void> arg);
|
||||
using SceNpSignalingHandler = void(u32 ctx_id, u32 subject_id, s32 event, s32 error_code, u32 arg_addr);
|
||||
using SceNpFriendlistResultHandler = s32(s32 retCode, vm::ptr<void> arg);
|
||||
using SceNpMatchingHandler = void(u32 ctx_id, u32 req_id, s32 event, s32 error_code, vm::ptr<void> arg);
|
||||
using SceNpMatchingGUIHandler = void(u32 ctx_id, s32 event, s32 error_code, vm::ptr<void> arg);
|
||||
using SceNpProfileResultHandler = s32(s32 result, vm::ptr<void> arg);
|
||||
|
||||
using SceNpManagerSubSigninCallback = void(s32 result, vm::ptr<SceNpId> npId, vm::ptr<void> cb_arg);
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
struct sce_np_lookup_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
struct sce_np_score_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
extern s32 g_psn_connection_status;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -4,8 +4,10 @@
|
|||
|
||||
#include "Emu/Memory/vm_ptr.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
// Error codes
|
||||
enum
|
||||
enum SceNpMatching2Error : u32
|
||||
{
|
||||
// NP Matching 2 Utility
|
||||
SCE_NP_MATCHING2_ERROR_OUT_OF_MEMORY = 0x80022301,
|
||||
|
@ -463,6 +465,11 @@ enum
|
|||
SCE_NP_MATCHING2_CONTEXT_EVENT_Stop = 0x6f03,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_MIN_POOLSIZE = 128 * 1024
|
||||
};
|
||||
|
||||
typedef u16 SceNpMatching2ServerId;
|
||||
typedef u32 SceNpMatching2WorldId;
|
||||
typedef u16 SceNpMatching2WorldNumber;
|
||||
|
@ -491,6 +498,7 @@ typedef u64 SceNpMatching2RoomPasswordSlotMask;
|
|||
typedef u64 SceNpMatching2RoomJoinedSlotMask;
|
||||
typedef u16 SceNpMatching2Event;
|
||||
typedef u32 SceNpMatching2EventKey;
|
||||
typedef u32 SceNpMatching2SignalingRequestId;
|
||||
typedef SceNpCommunicationPassphrase SceNpMatching2TitlePassphrase;
|
||||
|
||||
// Request callback function
|
||||
|
@ -1507,3 +1515,94 @@ struct SceNpMatching2CbQueueInfo
|
|||
be_t<u32> maxSessionMsgCbQueueLen;
|
||||
u8 reserved[12];
|
||||
};
|
||||
|
||||
union SceNpMatching2SignalingNetInfo // TODO check values
|
||||
{
|
||||
be_t<u64> size;
|
||||
be_t<u32> localAddr;
|
||||
be_t<u32> mappedAddr;
|
||||
be_t<u32> natStatus;
|
||||
};
|
||||
|
||||
// NP OAuth Errors
|
||||
enum SceNpOauthError : u32
|
||||
{
|
||||
SCE_NP_OAUTH_ERROR_UNKNOWN = 0x80025f01,
|
||||
SCE_NP_OAUTH_ERROR_ALREADY_INITIALIZED = 0x80025f02,
|
||||
SCE_NP_OAUTH_ERROR_NOT_INITIALIZED = 0x80025f03,
|
||||
SCE_NP_OAUTH_ERROR_INVALID_ARGUMENT = 0x80025f04,
|
||||
SCE_NP_OAUTH_ERROR_OUT_OF_MEMORY = 0x80025f05,
|
||||
SCE_NP_OAUTH_ERROR_OUT_OF_BUFFER = 0x80025f06,
|
||||
SCE_NP_OAUTH_ERROR_BAD_RESPONSE = 0x80025f07,
|
||||
SCE_NP_OAUTH_ERROR_ABORTED = 0x80025f08,
|
||||
SCE_NP_OAUTH_ERROR_SIGNED_OUT = 0x80025f09,
|
||||
SCE_NP_OAUTH_ERROR_REQUEST_NOT_FOUND = 0x80025f0a,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_CN_CHECK = 0x80025f0b,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_UNKNOWN_CA = 0x80025f0c,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_NOT_AFTER_CHECK = 0x80025f0d,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_NOT_BEFORE_CHECK = 0x80025f0e,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_INVALID_CERT = 0x80025f0f,
|
||||
SCE_NP_OAUTH_ERROR_SSL_ERR_INTERNAL = 0x80025f10,
|
||||
SCE_NP_OAUTH_ERROR_REQUEST_MAX = 0x80025f11,
|
||||
|
||||
SCE_NP_OAUTH_SERVER_ERROR_BANNED_CONSOLE = 0x80025d14,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_INVALID_LOGIN = 0x82e00014,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_INACTIVE_ACCOUNT = 0x82e0001b,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_SUSPENDED_ACCOUNT = 0x82e0001c,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_SUSPENDED_DEVICE = 0x82e0001d,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_PASSWORD_EXPIRED = 0x82e00064,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_TOSUA_MUST_BE_RE_ACCEPTED = 0x82e00067,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_TOSUA_MUST_BE_RE_ACCEPTED_FOR_SUBACCOUNT = 0x82e01042,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_BANNED_ACCOUNT = 0x82e01050,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_SERVICE_END = 0x82e1019a,
|
||||
SCE_NP_OAUTH_SERVER_ERROR_SERVICE_UNAVAILABLE = 0x82e101f7,
|
||||
};
|
||||
|
||||
typedef s32 SceNpAuthOAuthRequestId;
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_AUTHORIZATION_CODE_MAX_LEN = 128,
|
||||
SCE_NP_CLIENT_ID_MAX_LEN = 128,
|
||||
};
|
||||
|
||||
struct SceNpClientId
|
||||
{
|
||||
char id[SCE_NP_CLIENT_ID_MAX_LEN + 1];
|
||||
u8 padding[7];
|
||||
};
|
||||
|
||||
struct SceNpAuthorizationCode
|
||||
{
|
||||
char code[SCE_NP_AUTHORIZATION_CODE_MAX_LEN + 1];
|
||||
u8 padding[7];
|
||||
};
|
||||
|
||||
struct SceNpAuthGetAuthorizationCodeParameter
|
||||
{
|
||||
be_t<u64> size;
|
||||
vm::bcptr<SceNpClientId> pClientId;
|
||||
vm::bcptr<char> pScope;
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_2_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
struct sce_np_2_matching_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
struct sce_np_2_matching_2_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
||||
struct sce_np_oauth_2_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
|
|
@ -1,35 +1,135 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include "sceNp.h"
|
||||
#include "sceNpClans.h"
|
||||
|
||||
LOG_CHANNEL(sceNpClans);
|
||||
|
||||
s32 sceNpClansInit(vm::ptr<SceNpCommunicationId> commId, vm::ptr<SceNpCommunicationPassphrase> passphrase, vm::ptr<void> pool, vm::ptr<u32> poolSize, u32 flags)
|
||||
template<>
|
||||
void fmt_class_string<SceNpClansError>::format(std::string& out, u64 arg)
|
||||
{
|
||||
format_enum(out, arg, [](auto error)
|
||||
{
|
||||
switch (error)
|
||||
{
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_ALREADY_INITIALIZED);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_NOT_INITIALIZED);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_NOT_SUPPORTED);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_OUT_OF_MEMORY);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_INVALID_ARGUMENT);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_EXCEEDS_MAX);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_BAD_RESPONSE);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_BAD_DATA);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_BAD_REQUEST);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_INVALID_SIGNATURE);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_INSUFFICIENT);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_INTERNAL_BUFFER);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_SERVER_MAINTENANCE);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_SERVER_END_OF_SERVICE);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_SERVER_BEFORE_START_OF_SERVICE);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_ABORTED);
|
||||
STR_CASE(SCE_NP_CLANS_ERROR_SERVICE_UNAVAILABLE);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_BAD_REQUEST);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_TICKET);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_SIGNATURE);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_TICKET_EXPIRED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_NPID);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_FORBIDDEN);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INTERNAL_SERVER_ERROR);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_BANNED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_BLACKLISTED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_ENVIRONMENT);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_SERVICE);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_MEMBER);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_BEFORE_HOURS);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLOSED_SERVICE);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_PERMISSION_DENIED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_LEADER_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_MEMBER_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_JOINED_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_MEMBER_STATUS_INVALID);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_DUPLICATED_CLAN_NAME);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_LEADER_CANNOT_LEAVE);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_ROLE_PRIORITY);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_ANNOUNCEMENT_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_CONFIG_MASTER_NOT_FOUND);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_DUPLICATED_CLAN_TAG);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_EXCEEDS_CREATE_CLAN_FREQUENCY);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CLAN_PASSPHRASE_INCORRECT);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_CANNOT_RECORD_BLACKLIST_ENTRY);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_CLAN_ANNOUNCEMENT);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_VULGAR_WORDS_POSTED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_BLACKLIST_LIMIT_REACHED);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_NO_SUCH_BLACKLIST_ENTRY);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_INVALID_NP_MESSAGE_FORMAT);
|
||||
STR_CASE(SCE_NP_CLANS_SERVER_ERROR_FAILED_TO_SEND_NP_MESSAGE);
|
||||
}
|
||||
|
||||
return unknown;
|
||||
});
|
||||
}
|
||||
|
||||
error_code sceNpClansInit(vm::cptr<SceNpCommunicationId> commId, vm::cptr<SceNpCommunicationPassphrase> passphrase, vm::ptr<void> pool, vm::ptr<u64> poolSize, u32 flags)
|
||||
{
|
||||
sceNpClans.warning("sceNpClansInit(commId=*0x%x, passphrase=*0x%x, pool=*0x%x, poolSize=*0x%x, flags=0x%x)", commId, passphrase, pool, poolSize, flags);
|
||||
|
||||
const auto clans_manager = g_fxo->get<sce_np_clans_manager>();
|
||||
|
||||
if (clans_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!commId || !passphrase)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (flags != 0)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
clans_manager->is_initialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansTerm()
|
||||
error_code sceNpClansTerm()
|
||||
{
|
||||
sceNpClans.warning("sceNpClansTerm()");
|
||||
|
||||
const auto clans_manager = g_fxo->get<sce_np_clans_manager>();
|
||||
|
||||
if (!clans_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
clans_manager->is_initialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansCreateRequest(vm::ptr<SceNpClansRequestHandle> handle, u64 flags)
|
||||
error_code sceNpClansCreateRequest(vm::ptr<SceNpClansRequestHandle> handle, u64 flags)
|
||||
{
|
||||
sceNpClans.todo("sceNpClansCreateRequest(handle=*0x%x, flags=0x%llx)", handle, flags);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!handle)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (flags != 0)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_SUPPORTED;
|
||||
|
@ -38,219 +138,705 @@ s32 sceNpClansCreateRequest(vm::ptr<SceNpClansRequestHandle> handle, u64 flags)
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansDestroyRequest(vm::ptr<SceNpClansRequestHandle> handle)
|
||||
error_code sceNpClansDestroyRequest(vm::ptr<SceNpClansRequestHandle> handle)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansDestroyRequest(handle=*0x%x)", handle);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansAbortRequest(vm::ptr<SceNpClansRequestHandle> handle)
|
||||
error_code sceNpClansAbortRequest(vm::ptr<SceNpClansRequestHandle> handle)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansAbortRequest(handle=*0x%x)", handle);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansCreateClan(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<char> name, vm::cptr<char> tag, vm::ptr<u32> clanId)
|
||||
error_code sceNpClansCreateClan(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<char> name, vm::cptr<char> tag, vm::ptr<SceNpClanId> clanId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansCreateClan(handle=*0x%x, name=%s, tag=%s, clanId=*0x%x)", handle, name, tag, clanId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!name || !tag || !clanId)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (strlen(name.get_ptr()) > SCE_NP_CLANS_CLAN_NAME_MAX_LENGTH || strlen(tag.get_ptr()) > SCE_NP_CLANS_CLAN_TAG_MAX_LENGTH)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansDisbandClan(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId)
|
||||
error_code sceNpClansDisbandClan(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansDisbandClan(handle=*0x%x, clanId=*0x%x)", handle, clanId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetClanList(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansEntry> clanList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
error_code sceNpClansGetClanList(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansEntry> clanList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetClanList(handle=*0x%x, paging=*0x%x, clanList=*0x%x, pageResult=*0x%x)", handle, paging, clanList, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !clanList)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetClanListByNpId()
|
||||
error_code sceNpClansGetClanListByNpId(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<SceNpClansPagingRequest> paging, vm::cptr<SceNpId> npid, vm::ptr<SceNpClansEntry> clanList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetClanListByNpId(handle=*0x%x, paging=*0x%x, npid=*0x%x, clanList=*0x%x, pageResult=*0x%x)", handle, paging, npid, clanList, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid || !pageResult || (paging && !clanList)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSearchByProfile()
|
||||
error_code sceNpClansSearchByProfile(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<SceNpClansPagingRequest> paging, vm::cptr<SceNpClansSearchableProfile> search, vm::ptr<SceNpClansClanBasicInfo> results, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSearchByProfile(handle=*0x%x, paging=*0x%x, search=*0x%x, results=*0x%x, pageResult=*0x%x)", handle, paging, search, results, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!search || !pageResult || (paging && !results)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSearchByName()
|
||||
error_code sceNpClansSearchByName(vm::ptr<SceNpClansRequestHandle> handle, vm::cptr<SceNpClansPagingRequest> paging, vm::cptr<SceNpClansSearchableName> search, vm::ptr<SceNpClansClanBasicInfo> results, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSearchByName(handle=*0x%x, paging=*0x%x, search=*0x%x, results=*0x%x, pageResult=*0x%x)", handle, paging, search, results, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!search || !pageResult || (paging && !results)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetClanInfo()
|
||||
error_code sceNpClansGetClanInfo(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::ptr<SceNpClansClanInfo> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetClanInfo(handle=*0x%x, clanId=%d, info=*0x%x)", handle, clanId, info);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
{
|
||||
// TODO: add more checks for info
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansUpdateClanInfo()
|
||||
error_code sceNpClansUpdateClanInfo(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansUpdatableClanInfo> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansUpdateClanInfo(handle=*0x%x, clanId=%d, info=*0x%x)", handle, clanId, info);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
{
|
||||
// TODO: add more checks for info
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
//if (info->something > X)
|
||||
//{
|
||||
// return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
//}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetMemberList()
|
||||
error_code sceNpClansGetMemberList(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansPagingRequest> paging, SceNpClansMemberStatus status, vm::ptr<SceNpClansMemberEntry> memList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetMemberList(handle=*0x%x, clanId=%d, paging=*0x%x, status=%d, memList=*0x%x, pageResult=*0x%x)", handle, clanId, paging, status, memList, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !memList)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetMemberInfo()
|
||||
error_code sceNpClansGetMemberInfo(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid, vm::ptr<SceNpClansMemberEntry> memInfo)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetMemberInfo(handle=*0x%x, clanId=%d, npid=*0x%x, memInfo=*0x%x)", handle, clanId, npid, memInfo);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid || !memInfo)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansUpdateMemberInfo()
|
||||
error_code sceNpClansUpdateMemberInfo(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansUpdatableMemberInfo> info)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansUpdateMemberInfo(handle=*0x%x, clanId=%d, memInfo=*0x%x)", handle, clanId, info);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!info)
|
||||
{
|
||||
// TODO: add more checks for info
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
//if (info->something > X)
|
||||
//{
|
||||
// return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
//}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansChangeMemberRole()
|
||||
error_code sceNpClansChangeMemberRole(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid, u32 role)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansChangeMemberRole(handle=*0x%x, clanId=%d, npid=*0x%x, role=%d)", handle, clanId, npid, role);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid || role > SCE_NP_CLANS_ROLE_LEADER) // TODO: check if role can be 0
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetAutoAcceptStatus()
|
||||
error_code sceNpClansGetAutoAcceptStatus(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::ptr<b8> enable)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetAutoAcceptStatus(handle=*0x%x, clanId=%d, enable=*0x%x)", handle, clanId, enable);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!enable)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansUpdateAutoAcceptStatus()
|
||||
error_code sceNpClansUpdateAutoAcceptStatus(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, b8 enable)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansUpdateAutoAcceptStatus(handle=*0x%x, clanId=%d, enable=%d)", handle, clanId, enable);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansJoinClan()
|
||||
error_code sceNpClansJoinClan(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansJoinClan(handle=*0x%x, clanId=%d)", handle, clanId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansLeaveClan()
|
||||
error_code sceNpClansLeaveClan(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansLeaveClan(handle=*0x%x, clanId=%d)", handle, clanId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansKickMember(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, vm::ptr<u32> npid, vm::ptr<SceNpClansMessage> message)
|
||||
error_code sceNpClansKickMember(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid, vm::cptr<SceNpClansMessage> message)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansKickMember(handle=*0x%x, clanId=%d, npid=*0x%x, message=*0x%x)", handle, clanId, npid, message);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
if (strlen(message->body) > SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSendInvitation(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, vm::ptr<u32> npid, vm::ptr<SceNpClansMessage> message)
|
||||
error_code sceNpClansSendInvitation(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid, vm::cptr<SceNpClansMessage> message)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSendInvitation(handle=*0x%x, clanId=%d, npid=*0x%x, message=*0x%x)", handle, clanId, npid, message);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
if (strlen(message->body) > SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansCancelInvitation()
|
||||
error_code sceNpClansCancelInvitation(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansCancelInvitation(handle=*0x%x, clanId=%d, npid=*0x%x)", handle, clanId, npid);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSendInvitationResponse(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, vm::ptr<SceNpClansMessage> message, b8 accept)
|
||||
error_code sceNpClansSendInvitationResponse(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansMessage> message, b8 accept)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSendInvitationResponse(handle=*0x%x, clanId=%d, message=*0x%x, accept=%d)", handle, clanId, message, accept);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
if (strlen(message->body) > SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSendMembershipRequest(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, vm::ptr<SceNpClansMessage> message)
|
||||
error_code sceNpClansSendMembershipRequest(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, vm::cptr<SceNpClansMessage> message)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSendMembershipRequest(handle=*0x%x, clanId=%d, message=*0x%x)", handle, clanId, message);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
if (strlen(message->body) > SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansCancelMembershipRequest()
|
||||
error_code sceNpClansCancelMembershipRequest(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansCancelMembershipRequest(handle=*0x%x, clanId=%d)", handle, clanId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansSendMembershipResponse()
|
||||
error_code sceNpClansSendMembershipResponse(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid, vm::cptr<SceNpClansMessage> message, b8 allow)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansSendMembershipResponse(handle=*0x%x, clanId=%d, npid=*0x%x, message=*0x%x, allow=%d)", handle, clanId, npid, message, allow);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (message)
|
||||
{
|
||||
if (strlen(message->body) > SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansGetBlacklist()
|
||||
error_code sceNpClansGetBlacklist(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansBlacklistEntry> bl, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansGetBlacklist(handle=*0x%x, clanId=%d, paging=*0x%x, bl=*0x%x, pageResult=*0x%x)", handle, clanId, paging, bl, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !bl)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansAddBlacklistEntry()
|
||||
error_code sceNpClansAddBlacklistEntry(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansAddBlacklistEntry(handle=*0x%x, clanId=%d, npid=*0x%x)", handle, clanId, npid);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRemoveBlacklistEntry()
|
||||
error_code sceNpClansRemoveBlacklistEntry(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpId> npid)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRemoveBlacklistEntry(handle=*0x%x, clanId=%d, npid=*0x%x)", handle, clanId, npid);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!npid)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRetrieveAnnouncements()
|
||||
error_code sceNpClansRetrieveAnnouncements(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansMessageEntry> mlist, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRetrieveAnnouncements(handle=*0x%x, clanId=%d, paging=*0x%x, mlist=*0x%x, pageResult=*0x%x)", handle, clanId, paging, mlist, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !mlist)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansPostAnnouncement()
|
||||
error_code sceNpClansPostAnnouncement(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansMessage> message, vm::cptr<SceNpClansMessageData> data, u32 duration, vm::ptr<SceNpClansMessageId> mId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansPostAnnouncement(handle=*0x%x, clanId=%d, message=*0x%x, data=*0x%x, duration=%d, mId=*0x%x)", handle, clanId, message, data, duration, mId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!message || !mId || duration == 0)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (!data) // TODO verify
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (strlen(message->body) > SCE_NP_CLANS_ANNOUNCEMENT_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRemoveAnnouncement()
|
||||
error_code sceNpClansRemoveAnnouncement(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, SceNpClansMessageId mId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansPostAnnouncement(handle=*0x%x, clanId=%d, mId=%d)", handle, clanId, mId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansPostChallenge(vm::ptr<SceNpClansRequestHandle> handle, u32 clanId, u32 targetClan, vm::ptr<SceNpClansMessage> message, vm::ptr<SceNpClansMessageData> data, u32 duration, vm::ptr<u32> mId)
|
||||
error_code sceNpClansPostChallenge(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, SceNpClanId targetClan, vm::cptr<SceNpClansMessage> message, vm::cptr<SceNpClansMessageData> data, u32 duration, vm::ptr<SceNpClansMessageId> mId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansPostChallenge(handle=*0x%x, clanId=%d, targetClan=%d, message=*0x%x, data=*0x%x, duration=%d, mId=*0x%x)", handle, clanId, targetClan, message, data, duration, mId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!message || !mId || duration == 0)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (!data) // TODO verify
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (strlen(message->body) > SCE_NP_CLANS_ANNOUNCEMENT_MESSAGE_BODY_MAX_LENGTH || strlen(message->subject) > SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH) // TODO: correct max?
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRetrievePostedChallenges()
|
||||
error_code sceNpClansRetrievePostedChallenges(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, SceNpClanId targetClan, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansMessageEntry> mList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRetrievePostedChallenges(handle=*0x%x, clanId=%d, targetClan=%d, paging=*0x%x, mList=*0x%x, pageResult=*0x%x)", handle, clanId, targetClan, paging, mList, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !mList)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRemovePostedChallenge()
|
||||
error_code sceNpClansRemovePostedChallenge(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, SceNpClanId targetClan, SceNpClansMessageId mId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRemovePostedChallenge(handle=*0x%x, clanId=%d, targetClan=%d, mId=%d)", handle, clanId, targetClan, mId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRetrieveChallenges()
|
||||
error_code sceNpClansRetrieveChallenges(vm::ptr<SceNpClansRequestHandle> handle, SceNpClanId clanId, vm::cptr<SceNpClansPagingRequest> paging, vm::ptr<SceNpClansMessageEntry> mList, vm::ptr<SceNpClansPagingResult> pageResult)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRetrieveChallenges(handle=*0x%x, clanId=%d, paging=*0x%x, mList=*0x%x, pageResult=*0x%x)", handle, clanId, paging, mList, pageResult);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!pageResult || (paging && !mList)) // TODO: confirm
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
if (paging)
|
||||
{
|
||||
if (paging->startPos > SCE_NP_CLANS_PAGING_REQUEST_START_POSITION_MAX || paging->max > SCE_NP_CLANS_PAGING_REQUEST_PAGE_MAX)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_EXCEEDS_MAX;
|
||||
}
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpClansRemoveChallenge()
|
||||
error_code sceNpClansRemoveChallenge(SceNpClansRequestHandle handle, SceNpClanId clanId, SceNpClansMessageId mId)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpClans);
|
||||
sceNpClans.todo("sceNpClansRemoveChallenge(handle=*0x%x, clanId=%d, mId=%d)", handle, clanId, mId);
|
||||
|
||||
if (!g_fxo->get<sce_np_clans_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_CLANS_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "sceNp.h"
|
||||
|
||||
#include "Utilities/BEType.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
// Return codes
|
||||
enum
|
||||
enum SceNpClansError : u32
|
||||
{
|
||||
SCE_NP_CLANS_ERROR_ALREADY_INITIALIZED = 0x80022701,
|
||||
SCE_NP_CLANS_ERROR_NOT_INITIALIZED = 0x80022702,
|
||||
|
@ -225,8 +227,8 @@ struct SceNpClansMemberEntry
|
|||
// Clan message structure
|
||||
struct SceNpClansMessage
|
||||
{
|
||||
s8 subject[SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH + 1];
|
||||
s8 body[SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH + 1];
|
||||
char subject[SCE_NP_CLANS_MESSAGE_SUBJECT_MAX_LENGTH + 1];
|
||||
char body[SCE_NP_CLANS_MESSAGE_BODY_MAX_LENGTH + 1];
|
||||
be_t<u32> options;
|
||||
};
|
||||
|
||||
|
@ -254,3 +256,10 @@ struct SceNpClansBlacklistEntry
|
|||
SceNpId entry;
|
||||
SceNpId registeredBy;
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_clans_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
|
||||
#include "sceNpSns.h"
|
||||
#include "sceNp.h"
|
||||
|
||||
LOG_CHANNEL(sceNpSns);
|
||||
|
||||
|
@ -41,6 +42,13 @@ error_code sceNpSnsFbInit(vm::cptr<SceNpSnsFbInitParams> params)
|
|||
{
|
||||
sceNpSns.todo("sceNpSnsFbInit(params=*0x%x)", params);
|
||||
|
||||
const auto manager = g_fxo->get<sce_np_sns_manager>();
|
||||
|
||||
if (manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!params)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
|
@ -48,6 +56,8 @@ error_code sceNpSnsFbInit(vm::cptr<SceNpSnsFbInitParams> params)
|
|||
|
||||
// TODO: Use the initialization parameters somewhere
|
||||
|
||||
manager->is_initialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -55,6 +65,15 @@ error_code sceNpSnsFbTerm()
|
|||
{
|
||||
sceNpSns.warning("sceNpSnsFbTerm()");
|
||||
|
||||
const auto manager = g_fxo->get<sce_np_sns_manager>();
|
||||
|
||||
if (!manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
manager->is_initialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
@ -62,11 +81,21 @@ error_code sceNpSnsFbCreateHandle(vm::ptr<u32> handle)
|
|||
{
|
||||
sceNpSns.warning("sceNpSnsFbCreateHandle(handle=*0x%x)", handle);
|
||||
|
||||
if (!handle)
|
||||
if (!g_fxo->get<sce_np_sns_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (!handle)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
//if (count > SCE_NP_SNS_FB_HANDLE_SLOT_MAX)
|
||||
//{
|
||||
// return SCE_NP_SNS_FB_ERROR_EXCEEDS_MAX;
|
||||
//}
|
||||
|
||||
*handle = idm::make<sns_fb_handle_t>();
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -76,6 +105,11 @@ error_code sceNpSnsFbDestroyHandle(u32 handle)
|
|||
{
|
||||
sceNpSns.warning("sceNpSnsFbDestroyHandle(handle=%d)", handle);
|
||||
|
||||
if (!g_fxo->get<sce_np_sns_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (handle == SCE_NP_SNS_FB_INVALID_HANDLE || handle > SCE_NP_SNS_FB_HANDLE_SLOT_MAX)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
|
@ -97,6 +131,11 @@ error_code sceNpSnsFbAbortHandle(u32 handle)
|
|||
{
|
||||
sceNpSns.todo("sceNpSnsFbAbortHandle(handle=%d)", handle);
|
||||
|
||||
if (!g_fxo->get<sce_np_sns_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (handle == SCE_NP_SNS_FB_INVALID_HANDLE || handle > SCE_NP_SNS_FB_HANDLE_SLOT_MAX)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
|
@ -118,6 +157,11 @@ error_code sceNpSnsFbGetAccessToken(u32 handle, vm::cptr<SceNpSnsFbAccessTokenPa
|
|||
{
|
||||
sceNpSns.todo("sceNpSnsFbGetAccessToken(handle=%d, param=*0x%x, result=*0x%x)", handle, param, result);
|
||||
|
||||
if (!g_fxo->get<sce_np_sns_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (handle == SCE_NP_SNS_FB_INVALID_HANDLE || handle > SCE_NP_SNS_FB_HANDLE_SLOT_MAX || !param || !result || !param->fb_app_id)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
|
@ -130,6 +174,11 @@ error_code sceNpSnsFbGetAccessToken(u32 handle, vm::cptr<SceNpSnsFbAccessTokenPa
|
|||
return SCE_NP_SNS_FB_ERROR_UNKNOWN_HANDLE;
|
||||
}
|
||||
|
||||
if (g_psn_connection_status == SCE_NP_MANAGER_STATUS_OFFLINE)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_NOT_SIGN_IN;
|
||||
}
|
||||
|
||||
// TODO
|
||||
|
||||
return CELL_OK;
|
||||
|
@ -159,9 +208,32 @@ s32 sceNpSnsFbLoadThrottle()
|
|||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpSnsFbGetLongAccessToken()
|
||||
error_code sceNpSnsFbGetLongAccessToken(u32 handle, vm::cptr<SceNpSnsFbAccessTokenParam> param, vm::ptr<SceNpSnsFbLongAccessTokenResult> result)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpSns);
|
||||
sceNpSns.todo("sceNpSnsFbGetLongAccessToken(handle=%d, param=*0x%x, result=*0x%x)", handle, param, result);
|
||||
|
||||
if (!g_fxo->get<sce_np_sns_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
if (handle == SCE_NP_SNS_FB_INVALID_HANDLE || handle > SCE_NP_SNS_FB_HANDLE_SLOT_MAX || !param || !result || !param->fb_app_id)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
const auto sfh = idm::get<sns_fb_handle_t>(handle);
|
||||
|
||||
if (!sfh)
|
||||
{
|
||||
return SCE_NP_SNS_FB_ERROR_UNKNOWN_HANDLE;
|
||||
}
|
||||
|
||||
if (g_psn_connection_status == SCE_NP_MANAGER_STATUS_OFFLINE)
|
||||
{
|
||||
return SCE_NP_SNS_ERROR_NOT_SIGN_IN;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Memory/vm_ptr.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
// Return codes
|
||||
enum sceNpSnsError : u32
|
||||
{
|
||||
|
@ -25,13 +27,20 @@ enum sceNpSnsError : u32
|
|||
SCE_NP_SNS_FB_ERROR_ACCESS_NOT_ALLOWED = 0x8002451c,
|
||||
};
|
||||
|
||||
// Access token param options
|
||||
enum
|
||||
{
|
||||
SCE_NP_SNS_FB_ACCESS_TOKEN_PARAM_OPTIONS_SILENT = 0x00000001
|
||||
};
|
||||
|
||||
// Constants for SNS functions
|
||||
enum
|
||||
{
|
||||
SCE_NP_SNS_FB_INVALID_HANDLE = 0,
|
||||
SCE_NP_SNS_FB_HANDLE_SLOT_MAX = 4,
|
||||
SCE_NP_SNS_FB_PERMISSIONS_LENGTH_MAX = 255,
|
||||
SCE_NP_SNS_FB_ACCESS_TOKEN_LENGTH_MAX = 255
|
||||
SCE_NP_SNS_FB_INVALID_HANDLE = 0,
|
||||
SCE_NP_SNS_FB_HANDLE_SLOT_MAX = 4,
|
||||
SCE_NP_SNS_FB_PERMISSIONS_LENGTH_MAX = 255,
|
||||
SCE_NP_SNS_FB_ACCESS_TOKEN_LENGTH_MAX = 255,
|
||||
SCE_NP_SNS_FB_LONG_ACCESS_TOKEN_LENGTH_MAX = 4096
|
||||
};
|
||||
|
||||
struct sns_fb_handle_t
|
||||
|
@ -61,3 +70,16 @@ struct SceNpSnsFbAccessTokenResult
|
|||
be_t<u64> expiration;
|
||||
char access_token[SCE_NP_SNS_FB_ACCESS_TOKEN_LENGTH_MAX + 1];
|
||||
};
|
||||
|
||||
struct SceNpSnsFbLongAccessTokenResult
|
||||
{
|
||||
be_t<u64> expiration;
|
||||
char access_token[SCE_NP_SNS_FB_LONG_ACCESS_TOKEN_LENGTH_MAX + 1];
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_sns_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
|
|
@ -1,22 +1,41 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include "sceNp.h"
|
||||
#include "sceNpTus.h"
|
||||
|
||||
LOG_CHANNEL(sceNpTus);
|
||||
|
||||
s32 sceNpTusInit()
|
||||
error_code sceNpTusInit(s32 prio)
|
||||
{
|
||||
sceNpTus.warning("sceNpTusInit()");
|
||||
sceNpTus.warning("sceNpTusInit(prio=%d)", prio);
|
||||
|
||||
const auto tus_manager = g_fxo->get<sce_np_tus_manager>();
|
||||
|
||||
if (tus_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_COMMUNITY_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
tus_manager->is_initialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpTusTerm()
|
||||
error_code sceNpTusTerm()
|
||||
{
|
||||
sceNpTus.warning("sceNpTusTerm()");
|
||||
|
||||
const auto tus_manager = g_fxo->get<sce_np_tus_manager>();
|
||||
|
||||
if (!tus_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_COMMUNITY_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
tus_manager->is_initialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include "Utilities/BEType.h"
|
||||
|
||||
#include "cellRtc.h"
|
||||
#include "sceNp.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
// Constants for TUS functions and structures
|
||||
enum
|
||||
{
|
||||
|
@ -49,3 +51,10 @@ struct SceNpTusDataStatus
|
|||
u8 pad[4];
|
||||
SceNpTusDataInfo info;
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_tus_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
|
|
@ -1,32 +1,65 @@
|
|||
#include "stdafx.h"
|
||||
#include "stdafx.h"
|
||||
#include "Emu/Cell/PPUModule.h"
|
||||
#include "Emu/IdManager.h"
|
||||
|
||||
#include "sceNp.h"
|
||||
#include "sceNpUtil.h"
|
||||
|
||||
LOG_CHANNEL(sceNpUtil);
|
||||
|
||||
s32 sceNpUtilBandwidthTestInitStart(u32 prio, size_t stack)
|
||||
error_code sceNpUtilBandwidthTestInitStart(u32 prio, u64 stack)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpUtil);
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestInitStart(prio=%d, stack=%d)", prio, stack);
|
||||
|
||||
const auto util_manager = g_fxo->get<sce_np_util_manager>();
|
||||
|
||||
if (util_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_ERROR_ALREADY_INITIALIZED;
|
||||
}
|
||||
|
||||
util_manager->is_initialized = true;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpUtilBandwidthTestGetStatus()
|
||||
error_code sceNpUtilBandwidthTestGetStatus()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpUtil);
|
||||
return SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_FINISHED;
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestGetStatus()");
|
||||
|
||||
if (!g_fxo->get<sce_np_util_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return not_an_error(SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_FINISHED);
|
||||
}
|
||||
|
||||
s32 sceNpUtilBandwidthTestShutdown()
|
||||
error_code sceNpUtilBandwidthTestShutdown(vm::ptr<SceNpUtilBandwidthTestResult> result)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpUtil);
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestShutdown(result=*0x%x)", result);
|
||||
|
||||
const auto util_manager = g_fxo->get<sce_np_util_manager>();
|
||||
|
||||
if (!util_manager->is_initialized)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
util_manager->is_initialized = false;
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
s32 sceNpUtilBandwidthTestAbort()
|
||||
error_code sceNpUtilBandwidthTestAbort()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(sceNpUtil);
|
||||
sceNpUtil.todo("sceNpUtilBandwidthTestAbort()");
|
||||
|
||||
if (!g_fxo->get<sce_np_util_manager>()->is_initialized)
|
||||
{
|
||||
return SCE_NP_ERROR_NOT_INITIALIZED;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,24 @@
|
|||
#pragma once
|
||||
#pragma once
|
||||
|
||||
#include <atomic>
|
||||
|
||||
enum
|
||||
{
|
||||
SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_NONE = 0,
|
||||
SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_RUNNING = 1,
|
||||
SCE_NP_UTIL_BANDWIDTH_TEST_STATUS_FINISHED = 2
|
||||
};
|
||||
|
||||
struct SceNpUtilBandwidthTestResult
|
||||
{
|
||||
be_t<f64> upload_bps;
|
||||
be_t<f64> download_bps;
|
||||
be_t<s32> result;
|
||||
};
|
||||
|
||||
// fxm objects
|
||||
|
||||
struct sce_np_util_manager
|
||||
{
|
||||
std::atomic<bool> is_initialized = false;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue