How to access Lobby Data in a Lobby Filter script?



  • Hi Everyone,

    I have created a lobby on the brain cloud design panel for my game with a super simple custom config json:

    {
      "canJoin": false
    }
    

    I am trying to access the value of canJoin data in my filter script. How does one go about doing that? Here is the script that I have so far:

    "use strict";
    
    function main() {
        
        var lobbyId = "??????";//Need help finding the lobbyId for this filter.
        var lobbyProxy = bridge.getLobbyServiceProxy();
        
        var postResult = lobbyProxy.getLobbyData(lobbyId);
        bridge.logDebugJson("Lobby Data Post Result", postResult);
        if (postResult.status == 200) {
            return postResult.data.lobbyTypeDef.roomConfig.canJoin;
        }
        return false;
    }
    
    main();
    

    In my client app I am calling LobbyService.FindLobby to join any lobby. Does the filter script run for every available lobby? If so how would I go about getting the lobby id in the filter script?

    Many thanks for your help!