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

IL2CPP error in ISteamMatchmakingServerListResponse constructor

Open alexhaffner opened this issue 2 years ago • 5 comments

Hey,

ISteamMatchmakingServerListResponse constructor (but most likely some others) is raising the following il2cpp error: 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 Steamworks.ISteamMatchmakingServerListResponse..ctor (Steamworks.ISteamMatchmakingServerListResponse+ServerResponded onServerResponded, Steamworks.ISteamMatchmakingServerListResponse+ServerFailedToRespond onServerFailedToRespond, Steamworks.ISteamMatchmakingServerListResponse+RefreshComplete onRefreshComplete)

I've seen a bunch of discussions around that topic and it seemed that il2cpp was functional at some point. Is that one API that was left behind for some reason? or am I doing something wrong?

Thanks!

alexhaffner avatar May 18 '23 21:05 alexhaffner

@alexhaffner Did you guys every find a solution for this? We are experiencing the same thing attempting to use a dedicated server with IL2CPP

westonleavitt avatar Apr 18 '25 19:04 westonleavitt

I made the methods static & MonoPInvokeCallback, and hacked a quick vTable map to still be able to call the callbacks. I don't exactly recall the exact steps I went through, and it was not a super clean fix. At least you know there is a way to make it work... but I had to alter the package.

alexhaffner avatar Apr 18 '25 20:04 alexhaffner

I made the methods static & MonoPInvokeCallback, and hacked a quick vTable map to still be able to call the callbacks. I don't exactly recall the exact steps I went through, and it was not a super clean fix. At least you know there is a way to make it work... but I had to alter the package.

@alexhaffner

Guessing you don't still have the implementation handy that I could reference?

I've got the Monopinvoke attribute implementation and the methods are static -- I'll look at the vtable fix mentioned and put in a pr if I can get the call to a functional state.

westonleavitt avatar Apr 19 '25 19:04 westonleavitt

I made the methods static & MonoPInvokeCallback, and hacked a quick vTable map to still be able to call the callbacks. I don't exactly recall the exact steps I went through, and it was not a super clean fix. At least you know there is a way to make it work... but I had to alter the package.

@alexhaffner

Guessing you don't still have the implementation handy that I could reference?

I've got the Monopinvoke attribute implementation and the methods are static -- I'll look at the vtable fix mentioned and put in a pr if I can get the call to a functional state.

Nop I don't have it anymore sorry. And that was really hacky, I fixed it really quick just for my use case. Do I wouldn't recommend using it anyways.

alexhaffner avatar Apr 19 '25 19:04 alexhaffner

I made the methods static & MonoPInvokeCallback, and hacked a quick vTable map to still be able to call the callbacks. I don't exactly recall the exact steps I went through, and it was not a super clean fix. At least you know there is a way to make it work... but I had to alter the package.

@alexhaffner

Guessing you don't still have the implementation handy that I could reference?

I've got the Monopinvoke attribute implementation and the methods are static -- I'll look at the vtable fix mentioned and put in a pr if I can get the call to a functional state.

Nop I don't have it anymore sorry. And that was really hacky, I fixed it really quick just for my use case. Do I wouldn't recommend using it anyways.

Sounds good. Thanks for the reply anyway.

westonleavitt avatar Apr 19 '25 20:04 westonleavitt