LauraWebdev / GodotSteam_CSharpBindings

GodotSteam C# Bindings
MIT License
49 stars 6 forks source link

LobbyDataUpdate Signal #32

Closed VestedGrammar closed 5 months ago

VestedGrammar commented 6 months ago

When trying to connect the LobbyDataUpdate signal to a function, there appears to be an issue.

Analogous signals in Steam.Matchmaking.Signals are associated with a corresponding delegate which can be used as a type to store the delegate and allow the signal to be disconnected when the Node exits the tree.

For example:

   Steam.LobbyCreatedEventHandler _lobbyCreated;

  _lobbyCreated = (connect, lobbyId) => {
              OnLobbyCreated(connect, lobbyId);
          };

        Steam.LobbyCreated += _lobbyCreated;

There is no equivalent delegate for LobbyDataUpdate, which is instead initialized as an Action type. Trying to use an Action returns the error ThrowIfArgCoutnMismatch because LobbyDataUpdate is trying to pass 3 arguments.

Now it's incredibly likely I'm simply approaching this wrong, but is there a reason that a delegate type was created for every signal in Steam.Matchmaking.Signals, but NOT for LobbyDataUpdate?

VestedGrammar commented 6 months ago

I made these changes to my local version of the addon here and it fixed the issue.

SlejmUr commented 5 months ago

Create a PR and have a high chance to get applied :)

VestedGrammar commented 5 months ago

Created a pull request:

https://github.com/LauraWebdev/GodotSteam_CSharpBindings/pull/33