Skip to content

When I'm using Steamworks, except for not calling functions like Callback<LobbyCreated_t>.Create(OnLobbyCreated); #683

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

Open
shineforwu opened this issue Mar 7, 2025 · 1 comment

Comments

@shineforwu
Copy link

I'm using Godot version 4.4 with the .NET version . I'm using .NET 8, and the version of Steamworks.NET is Version="2024.8.0".

After I initialized it with SteamAPI.Init(), I registered the callback function:

lobbyEnterCallback = Callback<LobbyEnter_t>.Create(OnLobbyEnter); 

Then,

SteamAPICall_t hSteamAPICall = SteamMatchmaking.CreateLobby(lobbyType, maxMembers); 
In the public override void _Process(double delta) /// [the frame function in Godot], 
{
 SteamAPI.RunCallbacks(); 
}

I implemented SteamAPI.RunCallbacks();
However, after I called CreateLobby, it didn't enter the callback function.

private void OnLobbyCreated(LobbyCreated_t callback)
    {
      
        if (callback.m_eResult == EResult.k_EResultOK)
        {
          
            LobbyID = new CSteamID(callback.m_ulSteamIDLobby);// Get the id


        }
        else
        {
          
            // Todo
        }
    }
@rlabrecque
Copy link
Owner

The SteamAPICall_t that CreateLobby is returning means that it's a CallResult (specific handler function) rather than a Callback which is a general sink for out of bound delegates.

So you'll probably need to swap LobbyEnter_t over to a CallResult and bind the SteamAPICall_t into it with Set()

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

2 participants