SceNpParty library (#162)

* libSceNpParty

* SetDefaultRequestOptParam & RegisterRoomMessageCallback

* Fix

---------

Co-authored-by: red-prig <vdpasha@mail.ru>
This commit is contained in:
Ordinary205 2024-01-06 21:11:49 +04:00 committed by GitHub
parent 2df1856444
commit 99d6fc00f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 183 additions and 0 deletions

View File

@ -40,6 +40,7 @@ uses
ps4_libSceNpManager, ps4_libSceNpManager,
ps4_libSceNpGameIntent, ps4_libSceNpGameIntent,
ps4_libSceNpAuth, ps4_libSceNpAuth,
ps4_libSceNpParty,
ps4_libSceSaveData, ps4_libSceSaveData,
ps4_libSceDialogs, ps4_libSceDialogs,
ps4_libSceUserService, ps4_libSceUserService,

View File

@ -44,6 +44,23 @@ type
size :size_t; size :size_t;
end; end;
SceNpMatching2RequestCallback=procedure(
ctxId:Word;
reqId:DWORD;
event:Word;
errorCode:Integer;
const data:Pointer;
arg:Pointer); SysV_ABI_CDecl;
pSceNpMatching2RequestOptParam=^SceNpMatching2RequestOptParam;
SceNpMatching2RequestOptParam=packed record
cbFunc:SceNpMatching2RequestCallback;
cbFuncArg:Pointer;
timeout:DWORD;
appReqId:Word;
padding:Word;
end;
SceNpMatching2ContextCallback=procedure( SceNpMatching2ContextCallback=procedure(
ctxId,event:Word; ctxId,event:Word;
eventCause:Byte; eventCause:Byte;
@ -72,6 +89,14 @@ type
errorCode:Integer; errorCode:Integer;
arg:Pointer); SysV_ABI_CDecl; arg:Pointer); SysV_ABI_CDecl;
SceNpMatching2RoomMessageCallback=procedure(
ctxId:Word;
roomId:QWORD;
srcMemberId:Word;
event:Word;
const data:Pointer;
arg:Pointer); SysV_ABI_CDecl;
function ps4_sceNpMatching2Initialize(param:pSceNpMatching2InitializeParameter):Integer; SysV_ABI_CDecl; function ps4_sceNpMatching2Initialize(param:pSceNpMatching2InitializeParameter):Integer; SysV_ABI_CDecl;
begin begin
Result:=0; Result:=0;
@ -100,6 +125,12 @@ begin
Result:=0; Result:=0;
end; end;
function ps4_sceNpMatching2RegisterRoomMessageCallback(const ctxId:SceNpMatching2ContextId;
cbFunc:SceNpMatching2RoomMessageCallback;cbFuncArg:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpMatching2ContextStart(ctxId:SceNpMatching2ContextId;timeout:QWORD):Integer; SysV_ABI_CDecl; function ps4_sceNpMatching2ContextStart(ctxId:SceNpMatching2ContextId;timeout:QWORD):Integer; SysV_ABI_CDecl;
begin begin
Result:=0; Result:=0;
@ -119,6 +150,12 @@ begin
Result:=0; Result:=0;
end; end;
function ps4_sceNpMatching2SetDefaultRequestOptParam(const ctxId:SceNpMatching2ContextId;
const optParam:pSceNpMatching2RequestOptParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpMatching2Terminate():Integer; SysV_ABI_CDecl; function ps4_sceNpMatching2Terminate():Integer; SysV_ABI_CDecl;
begin begin
Result:=0; Result:=0;
@ -136,10 +173,12 @@ begin
lib^.set_proc($7D041F3FCEC8EE1B,@ps4_sceNpMatching2RegisterContextCallback); lib^.set_proc($7D041F3FCEC8EE1B,@ps4_sceNpMatching2RegisterContextCallback);
lib^.set_proc($E0D8FBBB9079C820,@ps4_sceNpMatching2RegisterLobbyEventCallback); lib^.set_proc($E0D8FBBB9079C820,@ps4_sceNpMatching2RegisterLobbyEventCallback);
lib^.set_proc($A7ED849F199A00C3,@ps4_sceNpMatching2RegisterRoomEventCallback); lib^.set_proc($A7ED849F199A00C3,@ps4_sceNpMatching2RegisterRoomEventCallback);
lib^.set_proc($B81112CF3E02430B,@ps4_sceNpMatching2RegisterRoomMessageCallback);
lib^.set_proc($D1431E5911A764A0,@ps4_sceNpMatching2RegisterSignalingCallback); lib^.set_proc($D1431E5911A764A0,@ps4_sceNpMatching2RegisterSignalingCallback);
lib^.set_proc($EEF8CD43A675A29D,@ps4_sceNpMatching2ContextStart); lib^.set_proc($EEF8CD43A675A29D,@ps4_sceNpMatching2ContextStart);
lib^.set_proc($61F9A95BBD7DACCA,@ps4_sceNpMatching2CreateContext); lib^.set_proc($61F9A95BBD7DACCA,@ps4_sceNpMatching2CreateContext);
lib^.set_proc($6A3BF373C7B6BA9A,@ps4_sceNpMatching2CreateContextA); lib^.set_proc($6A3BF373C7B6BA9A,@ps4_sceNpMatching2CreateContextA);
lib^.set_proc($FBC7BBC172E68DDB,@ps4_sceNpMatching2SetDefaultRequestOptParam);
lib^.set_proc($32AA77949FAC8F2E,@ps4_sceNpMatching2Terminate); lib^.set_proc($32AA77949FAC8F2E,@ps4_sceNpMatching2Terminate);
end; end;

View File

@ -0,0 +1,143 @@
unit ps4_libSceNpParty;
{$mode ObjFPC}{$H+}
interface
uses
ps4_program,
ps4_libSceNpCommon;
const
SCE_NP_PARTY_MEMBER_NUM_MAX=8;
type
pSceNpPartyInitializeParam=^SceNpPartyInitializeParam;
SceNpPartyInitializeParam=packed record
sdkVersion:DWORD;
end;
pSceNpPartyState=^SceNpPartyState;
SceNpPartyState=Word;
pSceNpPartyRoomMemberId=^SceNpPartyRoomMemberId;
SceNpPartyRoomMemberId=Word;
pSceNpPartyMemberVoiceState=^SceNpPartyMemberVoiceState;
SceNpPartyMemberVoiceState=Byte;
pSceNpPeerAddressA=^SceNpPeerAddressA;
SceNpPeerAddressA=packed record
accountId:SceNpAccountId;
platform :SceNpPlatformType;
padding :Integer;
end;
pSceNpPartyMemberFlags=^SceNpPartyMemberFlags;
SceNpPartyMemberFlags=Byte;
pSceNpPartyMemberInfo=^SceNpPartyMemberInfo;
SceNpPartyMemberInfo=packed record
peerAddress:SceNpPeerAddressA;
onlineId :SceNpOnlineId;
memberId :SceNpPartyRoomMemberId;
memberFlags:SceNpPartyMemberFlags;
reserved :Byte;
end;
pSceNpPartyMemberVoiceInfo=^SceNpPartyMemberVoiceInfo;
SceNpPartyMemberVoiceInfo=packed record
memberId :SceNpPartyRoomMemberId;
memberVoiceState :SceNpPartyMemberVoiceState;
reserved :Byte;
destinationMemberId:SceNpPartyRoomMemberId;
end;
pSceNpPartyMemberList=^SceNpPartyMemberList;
SceNpPartyMemberList=packed record
members :array[0..SCE_NP_PARTY_MEMBER_NUM_MAX-1] of SceNpPartyMemberInfo;
memberIds :array[0..SCE_NP_PARTY_MEMBER_NUM_MAX-1] of SceNpPartyRoomMemberId;
memberNum :Byte;
privateParty:Boolean;
reserved :Word;
end;
SceNpPartyBinaryMessageEventHandler=procedure(
event:Word;
const data:Pointer;
userdata:Pointer); SysV_ABI_CDecl;
SceNpPartyRoomEventHandler=procedure(
eventType:Word;
const data:Pointer;
userdata:Pointer); SysV_ABI_CDecl;
SceNpPartyVoiceEventHandler=procedure(
const memberVoiceInfo:SceNpPartyMemberVoiceInfo;
userdata:Pointer); SysV_ABI_CDecl;
pSceNpPartyEventHandlers=^SceNpPartyEventHandlers;
SceNpPartyEventHandlers=packed record
sdkVersion :DWORD;
reserved :DWORD;
roomEvenHandler :SceNpPartyRoomEventHandler;
voiceEventHandler :SceNpPartyVoiceEventHandler;
binaryMessageEventHandler:SceNpPartyBinaryMessageEventHandler;
reserved2 :Pointer;
end;
implementation
function ps4_sceNpPartyInitialize(const param:pSceNpPartyInitializeParam):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyRegisterHandler(const handlers:pSceNpPartyEventHandlers;userdata:Pointer):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyGetState(const state:pSceNpPartyState):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyGetMembers(const memberList:pSceNpPartyMemberList):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyGetMemberInfo(const memberId:SceNpPartyRoomMemberId;
const memberInfo:pSceNpPartyMemberInfo):Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function ps4_sceNpPartyCheckCallback():Integer; SysV_ABI_CDecl;
begin
Result:=0;
end;
function Load_libSceNpParty(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
begin
Result:=TElf_node.Create;
Result.pFileName:=name;
lib:=Result._add_lib('libSceNpParty');
lib^.set_proc($9616024D098191DB,@ps4_sceNpPartyInitialize);
lib^.set_proc($900F3C81BBFBD5AA,@ps4_sceNpPartyRegisterHandler);
lib^.set_proc($684CCA749CC04D9D,@ps4_sceNpPartyGetState);
lib^.set_proc($4F650E29FD3464DD,@ps4_sceNpPartyGetMembers);
lib^.set_proc($1753FEFF0A71428C,@ps4_sceNpPartyGetMemberInfo);
lib^.set_proc($DDEE24DA6CCB9267,@ps4_sceNpPartyCheckCallback);
end;
initialization
ps4_app.RegistredPreLoad('libSceNpParty.prx',@Load_libSceNpParty);
end.