Online Subsystem Steam & Ban By IP

Hi :wave:

I’m making a game that uses the Online Subsystem Steam to host and connect to servers.

I’m trying to implement a ban by IP feature but when connecting to a server, the Game Mode’s PreLogin function’s Address variable returns the player’s Steam ID instead of their ID address.

I’m wondering whether it’s possible to get the connecting player’s IP address of it Steam hides it somehow?

Any help would be appreciated, thanks. :blush:

I am a new person and I am not someone experienced in this but i have an idea about how to do it.

NOTE : People use Multiple Terms for Database/Datastore/Datatable, i will only use Datastore Term

Solution 1 :

  • While Registering Player, Give Them ID or Add all their Connected ids in Datastore Steamid/EpicId/etc. [ since they are unique ]
  • When you ban Someone, have a Seperate Datastore to add the Banned Ids and Their Types like [ Example : 1234346345 - Steam ]
  • Check Player IDs while they are Connecting to Server or every second in-game
  • Kick or Warn Player with Ban and Reason to Client

Solution 2 :

  • Have Player have a Bool Value and Reason String Value inside Their Datastore, Turn it True and Put Reason
  • Make Game Check Player’s Ban Status on Connecting or every second in-game
  • Kick or Warn Player with Ban and Reason to Client

To Ban by IP, i am not experienced… I remember IPs can be changed with enough knowledge like HWID Bans

Sorry to reply without giving an actual answer, but may I ask how did you implement the Steam multiplayer in the first place? I’m really struggling with it right now.