Pieeer1 / SteamMultiplayerPeer

Initial Steam Multiplayer Peer
MIT License
22 stars 2 forks source link

Unable to estabilish connection with Facepunch.Steamworks 2.3.3 #12

Open Yazir opened 2 months ago

Yazir commented 2 months ago

While the example seems to work as it should, with its included libraries, updating Facepunch.Steamworks to a newer version (2.3.3 from nuget) produces a connection error. Steps to reproduce

  1. Download, unpack this repo
  2. remove from .csproj
    <None Include="Facepunch/Facepunch.Steamworks.Posix.dll" />
    <None Include="Facepunch/Facepunch.Steamworks.Win64.dll" />

    delete ./Facepunch folder

add <PackageReference Include="facepunch.steamworks" Version="2.3.3" />

  1. dotnet restore in root directory
  2. replace steam_api.dll and steam_api64.dll with versions from facepunch steamworks release (Unity/redistributable_bin/*)

run project, run exported project on separate steam account host lobby, connect to lobby on second account, lobby joining works, but it breaks on trying to estabilish socket connection

error:

ERROR: System.Collections.Generic.KeyNotFoundException: The given key '76561198043000362' was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Steam.SteamMultiplayerPeer.ProcessPing(SetupPeerPayload receive, UInt64 sender) in C:\personal\godot\projectsv4\SteamMultiplayerPeer-master\Steam\SteamMultiplayerPeer.cs:line 257
   at Steam.SteamMultiplayerPeer._Poll() in C:\personal\godot\projectsv4\SteamMultiplayerPeer-master\Steam\SteamMultiplayerPeer.cs:line 249
   at Godot.MultiplayerPeerExtension.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret)
   at Steam.SteamMultiplayerPeer.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in C:\personal\godot\projectsv4\SteamMultiplayerPeer-master\.godot\mono\temp\obj\ExportDebug\win-x64\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\Steam.SteamMultiplayerPeer_ScriptMethods.generated.cs:line 270
   at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret)

SteamMultiplayerPeer.cs:373 -> AddConnection receives steamId equal to 0


Other than stability and feature completeness, it is useful to have facepunch as a nuget package, since exporting for different platforms is more streamlined.

Pieeer1 commented 2 months ago

Yeah I am using a pretty hyper specific version of both steamworks and the facepunch setup. At some point my idea is to upgrade the steam works api to the newest version, and rewrite the facepunch library pretty heavily. Unfortunately the nuget package version is missing some undocumented functionality or is out of sync with newer steamworks version IIRC.

Yazir commented 2 months ago

I assume this is the source of the libraries? If so it is worth pointing out in the readme.

  1. https://gist.github.com/Pieeer1/559c1de3a8c7110249a0f45b630e8b43
Pieeer1 commented 2 months ago

That is the source of the steam binaries but the facepunch setup was pulled from a branch that was a significant amount ahead of their nuget release. Getting the actual source and documenting it is a good idea though, I'll see if I can track where I got it from.