Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FacepunchTransport.cs - connectedClients Client.steamId is always 0 - Facepunch.Steamworks Runtime needs to be updated! #217

Open
WaGi-Coding opened this issue Apr 28, 2023 · 3 comments

Comments

@WaGi-Coding
Copy link

So i am trying to modify the FacepunchTransport.cs in a way i can simply get peoples steamid per connectionID in a way they cannot spoof it that easily. But i came across a problem when i checked the connectedClients Dictionary.

When a new client connects to the socket, the steamId applied already is 0 only:

void ISocketManager.OnConnected(SocketConnection connection, ConnectionInfo info)
{
    if (!connectedClients.ContainsKey(connection.Id))
    {
        connectedClients.Add(connection.Id, new Client()
        {
            connection = connection,
            steamId = info.Identity.SteamId
        });

        InvokeOnTransportEvent(NetworkEvent.Connect, connection.Id, default, Time.realtimeSinceStartup);

        if (LogLevel <= LogLevel.Developer)
            Debug.Log($"[{nameof(FacepunchTransport)}] - Connected with Steam user {info.Identity.SteamId}.");
    }
    else if (LogLevel <= LogLevel.Normal)
        Debug.LogWarning($"[{nameof(FacepunchTransport)}] - Failed to connect client with ID {connection.Id}, client already connected.");
}

The problem is an issue with the released Facepunch.Steamworks, see Facepunch/Facepunch.Steamworks#455

So i compiled the current master branch from Facepunch.Steamworks and replaced the Runtime files and redist bin files with the new compiled ones & now the connectedClients Client actually contains the persons SteamID.

Also, i think the NetworkManager should allow custom transports to map NetworkManager connection IDs together with a Platform ID which could be SteamID, PlayfabID, etc.

I have no idea why Facepunch.Steamworks did not pushed a new release in 3 years.

Greetings

@oistikbal
Copy link

oistikbal commented Aug 2, 2023

This issuse still exists, can't connect to any host.
[FacepunchTransport] - Connecting with Steam user 0.

@davidverified
Copy link

davidverified commented Mar 5, 2024

THE FIX:

  1. Download the Zip file below
  2. Go to com.community.netcode.transport.facepunch\Runtime\Facepunch (where the package is installed in your Unity project)
  3. replace both files with the downloaded ones.
  4. YOURE GOOD TO GO!

what I did: I downloaded the facepunch.steamworks source code, fixed it and compiled it. you're welcome. Credits to Matze.

Fix SteamID = 0.zip

@Laumania
Copy link

Laumania commented Oct 2, 2024

@davidverified As this seems like a general issue, why isn't it pushed via an PR and released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants