Open fzygit1 opened 8 months ago
This API is not exposed in Greenworks yet.
This API is not exposed in Greenworks yet.
Thank you very much for your answer ! So, if I want to invite friends and play P2P online games, is it not possible with greenworks?
const getLobbyCount = (maxFetch=1024) => {
if(!greenworks.getLobbyByIndex(0).isLobby())return 0;
let maxFail=1;
while(greenworks.getLobbyByIndex(maxFail).isLobby()){
maxFail*=2;
if(maxFail>maxFetch)break;
}
if(maxFail===1){
return 1;
}
let minOK=maxFail-maxFail/2;
testNum=maxFail/4;
do{
if(greenworks.getLobbyByIndex(maxFail-testNum).isLobby()){
minOK=maxFail-testNum;
}else{
maxFail=maxFail-testNum;
}
testNum/=2;
}while(testNum>=1);
return minOK+1;
}
I wrote this to get the current lobby count. (For now, I hope Greenworks updates too.) If there are 999 lobbies, it just needs 21 calls to getLobbyByIndex to find the total number.
After that, use greenworks.getLobbyByIndex(123).getRawSteamID()
in a loop to get all the lobby IDs (you can paginate it).
i want search lobbies list,but I found no information about RequestLobbyList in the Matchmaking.md,
https://partner.steamgames.com/doc/api/ISteamMatchmaking#RequestLobbyList