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:
parent
7680f316a7
commit
f8ae027428
@ -166,4 +166,17 @@ message scmds_Parameters {
|
||||
MpSessionIdDto sid = 1;
|
||||
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;
|
||||
};
|
||||
|
@ -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) {
|
||||
@ -178,7 +179,7 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
|
||||
playerDatas[source].req = req.requestId;
|
||||
playerDatas[source].id = req.requestId.requestor;
|
||||
playerDatas[source].slot = assignSlotId();
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
emitMsg(source, RpcMessage.encode({
|
||||
Header: {
|
||||
@ -194,25 +195,53 @@ protobuf.load(GetResourcePath(GetCurrentResourceName()) + "/rline.proto", functi
|
||||
if (hostIndex === -1) {
|
||||
hostIndex = playerDatas[source].slot | 0;
|
||||
}
|
||||
|
||||
emitSessionCmds(source, 0, 'EnterSession', {
|
||||
index: playerDatas[source].slot | 0,
|
||||
hindex: hostIndex,
|
||||
sessionFlags: 0,
|
||||
mode: 0,
|
||||
size: Object.entries(playerDatas).filter(a => a[1].id).length,
|
||||
//size: 2,
|
||||
//size: Object.entries(playerDatas).length,
|
||||
teamIndex: 0,
|
||||
transitionId: {
|
||||
value: {
|
||||
a: 0,//2,
|
||||
b: 0
|
||||
}
|
||||
|
||||
emitMsg(source, RpcMessage.encode({
|
||||
Header: {
|
||||
MethodName: 'TransitionReady_PlayerQueue'
|
||||
},
|
||||
sessionManagerType: 0,
|
||||
slotCount: 32
|
||||
});
|
||||
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,
|
||||
sessionFlags: 0,
|
||||
mode: 0,
|
||||
size: Object.entries(playerDatas).filter(a => a[1].id).length,
|
||||
//size: 2,
|
||||
//size: Object.entries(playerDatas).length,
|
||||
teamIndex: 0,
|
||||
transitionId: {
|
||||
value: {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user