Solved Check if player has added my server in his game server list

Discussion in 'Spigot Plugin Development' started by MrCreeper1216, Nov 13, 2020.

  1. Hello everyone, as the title say I want to check if a player has my server added in the server list to guarantee access only to those who have the server added.
    I was wondering about starting with serverlistpingevent and asynchpreloginevent...what do you think?

    I also wanted to make it for bungeecord.
     
  2. Don't think this is possible. Only way you could do it in a roundabout way is by putting a sort-of "password" in the MOTD and then asking the player for it on first join. (As people using direct connect obviously won't see the MOTD).
     
  3. That's also a cool idea, but there's a plugin which does it's EpicGuard
     
  4. Well if the client recently sent you a ping packet it probably means that he has your server in his list. Nothing crazy I guess
     
  5. This is possible, I've seen servers myself which only allow connections when you've got it added to the server list.

    ...as for how they did it, I have not a clue
     
  6. SteelPhoenix

    Moderator

    The only difference between joining through server list or direct connect is that the client automatically pings the server if it's in the server list. It is not guaranteed that a received ping packet is sent by a Minecraft client though.
     
  7. Save all addresses that call the ServerListPingEvent for about 2 minutes and see if the IP of PlayerJoinEvent is in the previously saved data ;)
     
  8. Thanks everyone I can close the thread now!