Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

ISteamMatchmakingServerListReponse & IL2CPP

Open JamesMcGhee opened this issue 8 months ago • 5 comments

We are seeing an error when compiling for IL2CPP if anything that uses ISteamMatchmakingServerListReponse is used, you get the following

NotSupportedException: IL2CPP does not support marshaling delegates that point to instance methods to native code. The method we're attempting to marshal is: Steamworks.ISteamMatchmakingServerListResponse::InternalOnServerResponded
  at System.Runtime.InteropServices.Marshal.StructureToPtr[T] (T structure, System.IntPtr ptr, System.Boolean fDeleteOld) [0x00000] in <00000000000000000000000000000000>:0 
  at Steamworks.ISteamMatchmakingServerListResponse..ctor (Steamworks.ISteamMatchmakingServerListResponse+ServerResponded onServerResponded, Steamworks.ISteamMatchmakingServerListResponse+ServerFailedToRespond onServerFailedToRespond, Steamworks.ISteamMatchmakingServerListResponse+RefreshComplete onRefreshComplete) [0x0009d] in E:\GitHub\Steamworks.NET_TimelinePatch\com.rlabrecque.steamworks.net\Runtime\ISteamMatchmakingResponses.cs:62

I tested and confirmed myself under mono all is well, in editor (and thus mono) all is well ... in a build, the above error. To be clear that is when you run the build and then request a server list, you will get this error when the response is registered.

JamesMcGhee avatar Apr 15 '25 20:04 JamesMcGhee

This seems to be related to #554 and #635. Apologies for the duplicate I didn't see the others in the list when I skimmed through. That said this is an outstanding issue that is blocking a couple groups I know if there is anything I can do to help let me know, I glanced through your code and the way this particular callback is handled is a bit different than the others but I didn't dive deep once I saw the issue was in the wrapper I came here.

By the way, I noted you have 136 open issues. I'm happy to try and help with Steamworks.NET support, we more or less do that anyway through our community. My first recommendation would be to clean up some of these cases; more than a few are no longer relevant and can be closed. Quite a few are duplicates and can be merged, whittling it down to the actual set of open cases would help identify the "known issues" ... which I can help you do that part no problem. With a list of known issues, it would be easier to address them as a community, hopefully saving you work overall in that you can mostly then just merge the community's changes in as appropriate.

JamesMcGhee avatar Apr 19 '25 19:04 JamesMcGhee

@kimlaya is that a workaround for the issue? if so why not branch and merge request?

JamesMcGhee avatar Apr 20 '25 01:04 JamesMcGhee

@JamesMcGhee

I actually think I have it fixed and functioning for the server call.

No clue how many or if there are others callbacks in the API that need fixed but this at least appears to be fixing in our latest build.

I'm just testing on my end then will submit the changes.

westonleavitt avatar Apr 20 '25 05:04 westonleavitt

@westonleavitt, very nice do you have a fork you can share? I can share it with our community get more testing done on it

JamesMcGhee avatar Apr 20 '25 10:04 JamesMcGhee

#743 should fix this!

rlabrecque avatar Sep 30 '25 23:09 rlabrecque