Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Lobby - Unable to Ban a player?

Discussion in 'Lobby' started by CodeMonkeyYT, Nov 16, 2022.

  1. CodeMonkeyYT


    Dec 22, 2014
    Hi there,
    Looking at the documentation it is possible for the host to kick a Player with RemovePlayerAsync(); however the kicked player can just join the Lobby again and again.

    Doesn't seem like there's a way to ban a Player so they cannot join the Lobby again, I think that should be added.
    Unity_Brandon and SamuelIH like this.
  2. CodeSmile


    Apr 10, 2014
    I don't know about Lobby, just NGO barebones. If I wanted to uniquely identify a client, I would have it generate and persist or load the existing GUID and send that to the server with the connection approval payload upon connecting.

    The server only needs to maintain a HashSet<GUID> _bannedPlayers and check if the connection payload's GUID is in the ban list. If it is: connection denied.

    Of course malicious players could find a way to modify the GUID, either by modifying it in memory or by modifying the payload packet(s).
  3. TheCaveOfWonders


    Mar 2, 2014
    please add this feature.
    @CodeSmile it's true we can achieve this in NGO, but we shouldn't have to, it's a basic missing feature from the lobbies service.

    Not sure how they would achieve this when the player authenticates anonymously though, for example when we use
    await AuthenticationService.Instance.SignInAnonymouslyAsync();

    using NGO as a workaround will also cause problems if you use the quick join feature,
    as it might try to make you join a lobby that you were banned from, and of course that will fail, on the NGO side.
    Last edited: Sep 19, 2023