• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

How to access Lobby Data in a Lobby Filter script?

Scheduled Pinned Locked Moved Cloud Code
cloudscriptlobbyidlobby
1 Posts 1 Posters 292 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kaue Aftimus Rosa
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users