SceNpWebApi + SceNpSignaling + SceNpScore functions (#182)

* sceNpWebApiRegisterExtdPushEventCallbackA

* sceNpSignalingCreateContext

* libSceNpScore functions

* +

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
Ordinary205 2024-02-02 21:56:17 +04:00 committed by GitHub
parent f8d9ad0f45
commit 4a540f2a02
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 128 additions and 30 deletions

View File

@ -94,6 +94,19 @@ type
hits :PInteger;
end;
pSceNpScoreBoardId=^SceNpScoreBoardId;
SceNpScoreBoardId=DWORD;
pSceNpScorePlayerRankDataA=^SceNpScorePlayerRankDataA;
SceNpScorePlayerRankDataA=packed record
hasData :Integer;
pad0 :array[0..3] of Byte;
rankData:SceNpScoreRankDataA;
end;
pSceNpScoreRankNumber=^SceNpScoreRankNumber;
SceNpScoreRankNumber=DWORD;
function ps4_sceNpScoreGetFriendsRanking(
reqId:Integer;
boardId:DWORD;
@ -213,7 +226,7 @@ function ps4_sceNpScoreRecordScore(
score:Int64; //SceNpScoreValue
scoreComment:pSceNpScoreComment;
gameInfo:pSceNpScoreGameInfo;
tmpRank:PDWORD; //SceNpScoreRankNumber
tmpRank:pSceNpScoreRankNumber;
compareDate:PQWORD; //SceRtcTick
option:Pointer):Integer; SysV_ABI_CDecl;
begin
@ -230,7 +243,7 @@ function ps4_sceNpScoreRecordScoreAsync(
score:Int64; //SceNpScoreValue
scoreComment:pSceNpScoreComment;
gameInfo:pSceNpScoreGameInfo;
tmpRank:PDWORD; //SceNpScoreRankNumber
tmpRank:pSceNpScoreRankNumber;
compareDate:PQWORD; //SceRtcTick
option:Pointer):Integer; SysV_ABI_CDecl;
begin
@ -252,6 +265,34 @@ begin
Result:=0;
end;
function ps4_sceNpScoreGetRankingByNpIdAsync():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpScoreGetRankingByAccountId(reqId:Integer;
boardId:SceNpScoreBoardId;
const accountIdArray:SceNpAccountId;
accountIdArraySize:QWORD;
rankArray:pSceNpScorePlayerRankDataA;
rankArraySize:QWORD;
commentArray:pSceNpScoreComment;
commentArraySize:QWORD;
infoArray:pSceNpScoreGameInfo;
infoArraySize:QWORD;
arrayNum:QWORD;
lastSortDate:PQWORD; //SceRtcTick
totalRecord:pSceNpScoreRankNumber;
option:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpScoreDeleteNpTitleCtx(titleCtxId:Integer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceNpScoreRanking(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -270,6 +311,9 @@ begin
lib^.set_proc($CD3D1706D82D3922,@ps4_sceNpScoreRecordScore);
lib^.set_proc($00D26CB0FCF7998D,@ps4_sceNpScoreRecordScoreAsync);
lib^.set_proc($9B50DF351B2D9124,@ps4_sceNpScorePollAsync);
lib^.set_proc($45DDBB76A505655F,@ps4_sceNpScoreGetRankingByNpIdAsync);
lib^.set_proc($2BDB653834D0C777,@ps4_sceNpScoreGetRankingByAccountId);
lib^.set_proc($1B4A44F91342C1F9,@ps4_sceNpScoreDeleteNpTitleCtx);
end;
initialization

View File

@ -5,7 +5,20 @@ unit ps4_libSceNpSignaling;
interface
uses
ps4_program;
ps4_program,
ps4_libSceNpCommon;
const
SCE_NP_SIGNALING_CONTEXT_MAX=8;
type
SceNpSignalingHandler=procedure(
ctxId :DWORD;
subjectId:DWORD;
event :Integer;
errorCode:Integer;
arg :Pointer
); SysV_ABI_CDecl;
implementation
@ -17,6 +30,14 @@ begin
Result:=0;
end;
function ps4_sceNpSignalingCreateContext(npId:pSceNpId;
handler:SceNpSignalingHandler;
arg:Pointer;
ctxId:PDWORD):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceNpSignaling(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
@ -26,6 +47,7 @@ begin
lib:=Result._add_lib('libSceNpSignaling');
lib^.set_proc($DCA3AE0B84666595,@ps4_sceNpSignalingInitialize);
lib^.set_proc($E7262311D778B7C6,@ps4_sceNpSignalingCreateContext)
end;
initialization

View File

@ -182,6 +182,30 @@ type
extdDataKeyNum:size_t;
end;
pSceNpWebApiExtdPushEventExtdData=^SceNpWebApiExtdPushEventExtdData;
SceNpWebApiExtdPushEventExtdData=packed record
extdDataKey:SceNpWebApiExtdPushEventExtdDataKey;
pData :PChar;
dataLen :QWORD;
end;
SceNpWebApiExtdPushEventCallbackA=procedure(
userCtxId :Integer;
callbackId :Integer;
pNpServiceName:PChar;
npServiceLabel:SceNpServiceLabel;
pTo :pSceNpPeerAddressA;
pToOnlineId :pSceNpOnlineId;
pFrom :pSceNpPeerAddressA;
pFromOnlineId :SceNpOnlineId;
pDataType :pSceNpWebApiPushEventDataType;
pData :PChar;
dataLen :QWORD;
pExtdData :pSceNpWebApiExtdPushEventExtdData;
extdDataNum :QWORD;
pUserArg :Pointer
); SysV_ABI_CDecl;
function ps4_sceNpWebApiCreatePushEventFilter(libCtxId:Integer;
pDataType:pSceNpWebApiPushEventDataType;
dataTypeNum:size_t):Integer; SysV_ABI_CDecl;
@ -232,6 +256,13 @@ begin
Result:=3;
end;
function ps4_sceNpWebApiRegisterExtdPushEventCallbackA(userCtxId,filterId:Integer;
cbFunc:SceNpWebApiExtdPushEventCallbackA;
pUserArg:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=3;
end;
procedure ps4_sceNpWebApiCheckTimeout(); SysV_ABI_CDecl;
begin
//
@ -270,6 +301,7 @@ begin
lib^.set_proc($909409134B8A9B9C,@ps4_sceNpWebApiRegisterServicePushEventCallback);
lib^.set_proc($33605407E0CD1061,@ps4_sceNpWebApiCreateExtdPushEventFilter);
lib^.set_proc($BEB334D80E46CB53,@ps4_sceNpWebApiRegisterExtdPushEventCallback);
lib^.set_proc($8E15CA1902787A02,@ps4_sceNpWebApiRegisterExtdPushEventCallbackA);
lib^.set_proc($81534DCB17FFD528,@ps4_sceNpWebApiCheckTimeout);
lib^.set_proc($5D48DDB124D36775,@ps4_sceNpWebApiDeleteContext);
end;