Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Brite
  • 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
  1. Home
  2. Cloud Code
  3. How to access Lobby Data in a Lobby Filter script?

How to access Lobby Data in a Lobby Filter script?

Scheduled Pinned Locked Moved Cloud Code
cloudscriptlobbyidlobby
1 Posts 1 Posters 1.0k 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

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

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