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

Callback number not found for struct Steamworks.SteamInventoryResult_t #616

Open
NathanInbar opened this issue Jun 19, 2024 · 1 comment

Comments

@NathanInbar
Copy link

Steps for Reproduction:

  1. New 3D project with Unity Version 2022.3.25f1
  2. Import Steamworks NET 20.2.0 with git url
  3. Create the following script:
    MyScript.cs
using UnityEngine;
using Steamworks;

public class MyScript : MonoBehaviour
{
    protected Callback<SteamInventoryResult_t> m_SteamInventoryResult;
    
    private void OnEnable()
    {
        if (SteamManager.Initialized)
        {
            m_SteamInventoryResult = Callback<SteamInventoryResult_t>.Create(OnSteamInventoryResult); // this line throws exception
        }
        else
            throw new System.Exception("Steam Manager not initialized!");
    }

    private void Start()
    {
        SteamInventory.GetAllItems(out SteamInventoryResult_t handle);
    }

    private void OnSteamInventoryResult(SteamInventoryResult_t p_callback)
    {
        print("method pass");
        SteamInventory.DestroyResult(p_callback);
    }
}
  1. Change appid in project directory/steam_appid.txt
  2. Create new scene
  3. Add game object with SteamManager and MyScript
  4. Play the scene
  5. Exception:
Exception: Callback number not found for struct Steamworks.SteamInventoryResult_t
Steamworks.CallbackIdentities.GetCallbackIdentity (System.Type callbackStruct) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackIdentity.cs:22)
Steamworks.CallbackDispatcher.Register (Steamworks.Callback cb) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:78)
Steamworks.Callback`1[T].Register (Steamworks.Callback`1+DispatchDelegate[T] func) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:272)
Steamworks.Callback`1[T]..ctor (Steamworks.Callback`1+DispatchDelegate[T] func, System.Boolean bGameServer) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:240)
Steamworks.Callback`1[T].Create (Steamworks.Callback`1+DispatchDelegate[T] func) (at ./Library/PackageCache/com.rlabrecque.steamworks.net@a3fe8091f7/Runtime/CallbackDispatcher.cs:226)
MyScript.OnEnable () (at Assets/Scripts/MyScript.cs:12)
@BenLubar
Copy link

The struct you are looking for is SteamInventoryResultReady_t.

SteamInventoryResult_t is an opaque integer type.

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