Search Unity

Resolved Lobby players list doesn't update!

Discussion in 'Lobby' started by Mj-Kkaya, Feb 17, 2023.

  1. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    Why "Players" list doesn't update when a new player join the lobby that I created?

    Should I use LocalLobby as in "com.unity.services.samples.game-lobby" project?

    I used Photon and SmartFoxServer network solutions but I haven't seen such a use.

    Do you have a plan to change this use?

    Have a good day.
    Thanks.
     
  2. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    I work on "Lobby" and "Lobby Data"
    Current lobby object's data changes when run "LobbyService.Instance.UpdateLobbyAsync" method.

    But as I said in my first post.: Players list doesn't change.
    Is there any road map to change this behavior?

    Edit:
    Folks, This Lobby behavior is very strange.
    When Host player change the "Public Lobby Data"; host's current lobby instance's "lobby data" is changing.
    But other player's current lobby instance's "lobby data" doesn't change!
    Note: I don't use "LocalLobby" structure and just want to understand Lobby behaviour.
     
    Last edited: Feb 19, 2023
  3. bartj-unity

    bartj-unity

    Unity Technologies

    Joined:
    Sep 9, 2021
    Posts:
    26
    Hi Mj-Kkaya,

    The current expectation is that all of the players in your lobby will periodically poll the Lobby server to get the newest version of the lobby. If you call "UpdateLobbyAsync", the player calling that will see the updated lobby, and likewise if you join a lobby as a player, the player will see themselves in the lobby. However, all other players will not know about any changes unless they are periodically calling "GetLobbyAsync" to refresh their local state. Unless you manually update your local copy of a lobby, it will not reflect the changes made by other players.

    It is worth mentioning that real-time Lobby events are coming soon, meaning players will be able to get notified about other players' changes without having to call "GetLobbyAsync".
     
  4. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    Thanks for reply bartj-unity.
    Will we not need to use the "LocalLobby" object instance after this update?
     
  5. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    Hi bartj-unity.
    I'm working on Lobby 1.1.0-pre.4 version.
    So, I'm using "LobbyChanged" event for change local lobby instance like this.
    Is this usage correct?



    m_LobbyEventCallbacks = new LobbyEventCallbacks();
    m_LobbyEventCallbacks.LobbyChanged += OnLobbyChanged;

    private void OnLobbyChanged(ILobbyChanges lobbyChanges)
    {
    if(!lobbyChanges.LobbyDeleted)
    lobbyChanges.ApplyToLobby(m_CurrentLobby);
    }
     
    Last edited: Apr 15, 2023
  6. bartj-unity

    bartj-unity

    Unity Technologies

    Joined:
    Sep 9, 2021
    Posts:
    26
    Yup, that looks correct. Our Lobby events documentation may be useful for you.
     
    Mj-Kkaya likes this.
  7. bartj-unity

    bartj-unity

    Unity Technologies

    Joined:
    Sep 9, 2021
    Posts:
    26
    Hi alexpro23,

    Which version of the Lobby package are you using? And could you elaborate on who's making the changes to the lobby in this scenario?
     
  8. alexpro23

    alexpro23

    Joined:
    Feb 23, 2021
    Posts:
    1
    Hi bartj, thanks for replying. I fixed my issue by updating to the newest (pre-5) version of lobby after I found this other post: https://forum.unity.com/threads/lobby-players-not-updating-correctly.1426818/

    Apparently it was an issue on lobby's side with something cache-related.
     
  9. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    @bartj-unity If a lobby player kills the app or disconnects the internet other players do not get the OnPlayerLeftLobby event even after a timeout period. Please fix this. issue. Tested on android.
    Using Lobby SDK version 1.1.0 Pre-5
     
    Last edited: Jul 17, 2023
  10. Mj-Kkaya

    Mj-Kkaya

    Joined:
    Oct 10, 2017
    Posts:
    179
    Hi @sathya,
    Do you have multiple "Environment"?
    And could you check "Disconnect Removal Time" at Lobby Config page?
     
  11. sathya

    sathya

    Joined:
    Jul 30, 2012
    Posts:
    297
    I have two Environments "Dev" and "Production", I have kept 30secs in both environments.
     
  12. MesterMoon

    MesterMoon

    Joined:
    Oct 22, 2016
    Posts:
    2
    I have the same problem, if player disconnects without leaving the lobby properly, lobby thinks the player never leaves. Disconnect removal time does not seem to work as I expect it to... surely the solution cant be to manually remove or kick a client that disconnects? Then finding the correct player to remove from the lobby would require to add clientID in the lobby options.
     
    Last edited: Mar 12, 2024
    Manikins and Elvire like this.