1
0
mirror of https://github.com/citizenfx/cfx-server-data.git synced 2025-02-09 06:33:29 +08:00

tweak(sessionmanager/rdr3): correctly request a session transition

This is untested with other players - hopefully it doesn't lead to a rejection. Needs latest change in client code, too.
This commit is contained in:
blattersturm 2021-03-06 10:00:42 +01:00
parent 7680f316a7
commit f8ae027428
2 changed files with 63 additions and 21 deletions

View File

@ -167,3 +167,16 @@ message scmds_Parameters {
int32 ncmds = 2;
repeated SessionCommand cmds = 3;
};
message UriType {
string url = 1;
};
message TransitionReady_PlayerQueue_Parameters {
UriType serverUri = 1;
uint32 serverSandbox = 2;
MpTransitionIdDto id = 3;
uint32 sessionType = 4;
MpSessionRequestIdDto requestId = 5;
MpSessionIdDto transferId = 6;
};

View File

@ -31,6 +31,7 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
const QueueForSession_Seamless_Parameters = root.lookupType("rline.QueueForSession_Seamless_Parameters");
const QueueForSessionResult = root.lookupType("rline.QueueForSessionResult");
const QueueEntered_Parameters = root.lookupType("rline.QueueEntered_Parameters");
const TransitionReady_PlayerQueue_Parameters = root.lookupType("rline.TransitionReady_PlayerQueue_Parameters");
const scmds_Parameters = root.lookupType("rline.scmds_Parameters");
function toArrayBuffer(buf) {
@ -195,6 +196,33 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
hostIndex = playerDatas[source].slot | 0;
}
emitMsg(source, RpcMessage.encode({
Header: {
MethodName: 'TransitionReady_PlayerQueue'
},
Content: TransitionReady_PlayerQueue_Parameters.encode({
serverUri: {
url: ''
},
requestId: req.requestId,
id: {
value: {
a: 2,
b: 0
}
},
serverSandbox: 0xD656C677,
sessionType: 3,
transferId: {
value: {
a: 2,
b: 2
}
},
}).finish()
}).finish());
setTimeout(() => {
emitSessionCmds(source, 0, 'EnterSession', {
index: playerDatas[source].slot | 0,
hindex: hostIndex,
@ -206,13 +234,14 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
teamIndex: 0,
transitionId: {
value: {
a: 0,//2,
a: 2,
b: 0
}
},
sessionManagerType: 0,
slotCount: 32
});
}, 50);
setTimeout(() => {
// tell player about everyone, and everyone about player
@ -238,7 +267,7 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
emitAddPlayer(id, aboutMe);
}
}, 150);
}, 50);
}, 250);
return makeResponse(QueueForSessionResult, {
code: 1