Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Lobby - Unable to Ban a player?

Discussion in 'Multiplayer' 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.
  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).