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

    CodeMonkeyYT

    Joined:
    Dec 22, 2014
    Posts:
    121
    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

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    2,436
    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).