Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matchmaking do not support RequestLobbyList in steamworksSDK? #325

Open
fzygit1 opened this issue Mar 24, 2024 · 3 comments
Open

Matchmaking do not support RequestLobbyList in steamworksSDK? #325

fzygit1 opened this issue Mar 24, 2024 · 3 comments

Comments

@fzygit1
Copy link

fzygit1 commented Mar 24, 2024

i want search lobbies list,but I found no information about RequestLobbyList in the Matchmaking.md,

https://partner.steamgames.com/doc/api/ISteamMatchmaking#RequestLobbyList

@hokein
Copy link
Member

hokein commented Mar 24, 2024

This API is not exposed in Greenworks yet.

@fzygit1 fzygit1 closed this as completed Mar 24, 2024
@fzygit1 fzygit1 reopened this Mar 24, 2024
@fzygit1
Copy link
Author

fzygit1 commented Mar 24, 2024

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?

@Hocti
Copy link

Hocti commented Oct 24, 2024

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants