Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Resolved How to map SteamIDs to the Connection ID's properly?

Discussion in 'Netcode for GameObjects' started by Takii, Apr 28, 2023.

  1. Takii

    Takii

    Joined:
    Sep 5, 2017
    Posts:
    7
    Using one of the community Transports like Facepunch or Steamnetworkingsockets from https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports

    What would be a good way to map NetworkManager connectionId's & steamID's? The Transports have their own internal mapping for that, but I cannot find a good way to map peoples Connection ID to their Steam ID, so i could use them later on in for example the NetworkManagers ClientDisconnected event, which only has the connection ID as parameter?

    I cannot find a proper way which does not make it easy to spoof someones SteamID.

    Why does the networkManager not allow the custom transports to assign a Plattform ID as well, or why they do not just use steams IDs as connection IDs?

    I don't really get that part, which already brought me to a point where i consider to give up before i really started to work on the actual game itself :(

    Only good resources i can find about Unity Multiplayers with NGO are for Unity Game Services i won't use at all.

    Any help would be appreciated!

    Greetings
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    7,263
    A server-side Dictionary<int, int> ... ;)
    Or long or GUID or whatever these ids are.

    You just need a mapping between the two on the server, and that mapping only persists throughout the current session. The mapping is created whenever a client joins, you send the steam id with the payload. You can then perform steam id validation checks if needed and approve or deny the connection request at this point.
     
    Takii likes this.
  3. Takii

    Takii

    Joined:
    Sep 5, 2017
    Posts:
    7
    Hey, i just found out why i was not able to retrieve the steamID in first place. It's the fact that the facepunch.steamworks version coming with the facepunchtransport is the release version from 2020 which is broken and just return 0 as steamID's, i just compiled the current master branch and it's now working and i can build on that ^^ Greetings
     
  4. feel-p0

    feel-p0

    Joined:
    May 6, 2018
    Posts:
    4
    Hey, sorry for necro but can you please share the build you have done? I am facing the same issue but building the master just created more issue for me...