GameLift Server SDK NET 4.5 failing in built Unity Player

Hello,

I downloaded the project for the Server SDK and built it on Visual Studio for Mac. I copied over all the DLL files to Assets/Plugins folder. In the editor, everything works well and it can connect to the Game Lift Local instance.

EDIT: The SDK does not work on Windows, Mac, or Linux built player. But below is still useful for debugging.

However, when I build for Linux Mono and create a docker image with Amazon Linux 2, several issues occur. Here is what happens when I run the binary. Which causes the SDK init to fail. If I remove all logging calls and try it, another errors happens: DescriptorValidationException: com.amazon.whitewater.auxproxy.pbuffer.BackfillMatchmakingRequest.players: Property Players not found in Com.Amazon.Whitewater.Auxproxy.Pbuffer.BackfillMatchmakingRequest.

I’m not sure if I’m missing a dependency or what but I cannot get it to work. There seems to be a fundamental issue with the DLL setup.

Thanks!

Unity Version: 2020.1.0b16

One interesting thing to note is that the GameLift Server SDK works in the Unity Editor. So, it seems to be an issue in the way the DLL’s are packaged into the Unity player executable. Or, it could be that a DLL is NOT being added. See https://stackoverflow.com/questions/58099681/unitypython-working-on-editor-but-not-on-build as an example of this happening.

The issue is that the SDK does not support Project Settings -> Player -> Other Settings -> Managed Stripping Level. Building with it set to ‘Disabled’ worked. However, I needed IL2CPP, which requires managed stripping, so I had to manually add a link.xml file (source: https://docs.unity3d.com/Manual/ManagedCodeStripping.html) to my project directory.

<linker>
    <assembly fullname="System.Reflection" preserve="all"/>
    <assembly fullname="System.Collections.Immutable" preserve="all"/>
    <assembly fullname="System.Memory" preserve="all"/>
    <assembly fullname="System.Buffers" preserve="all"/>
    <assembly fullname="System.Runtime.CompilerServices.Unsafe" preserve="all"/>
    <assembly fullname="log4net" preserve="all"/>
    <assembly fullname="GameLiftServerSDKNet45" preserve="all"/>
    <assembly fullname="Google.Protobuf" preserve="all"/>
    <assembly fullname="Newtonsoft.Json" preserve="all"/>
    <assembly fullname="websocket-sharp" preserve="all"/>
</linker>

This is by far not the best solution and probably adds more than it needs, but it works, and that’s what I’m going to use for now.