AcceptPlayerSession is always success for any playerSessionId

I’m testing using GameLift local and using the C# GameLift SDK and C# AWS SDK in Unity on Windows 10.

This is the part of the code I have a problem with that is running on the server during a client connection:

	GenericOutcome outcome = GameLiftServerAPI.AcceptPlayerSession(playerSessionId);
Debug.Log("Client has been authenticated by GameLift");
Debug.Log("Client ***FAILED*** authenticated by GameLift");

The GameLift local terminal window acts as expected, and gives correct output when the client’s playerSessionId is correct, and it outputs an error if I pass it a random string for the playerSessionId, but the server, specifically outcome.Success is always true as long as the server is connected to GameLift local, so even though the server should disconnect the client, it lets them through.

Here is the GameLift local console output when a client tries to connect with a random string for playerSessionId, but again, that output is expected, the problem is with outcome.Success always returning true:

Is this a bug or am I doing something wrong? Any help would be appreciated. Thanks!

Hi @CoolCorps,

This does look like a bug. Any errors thrown by the service (in this case GameLiftLocal) should not be a success.
I will file a bug and help the team prioritize a fix.

I can’t think of a good workaround at this time. Perhaps for now you could check for outcome.Success flag and also make sure the outcome.Error is null?

Hope this helps.


I uploaded my server build to GameLift and created a test fleet. I then remote accessed the server and checked the logs. Player authentication works correctly on the actual GameLift servers.

I was looking through my project and I found that I have accidentally been using the net35 DLLs for the GameLift server SDK even though I have my Scripting Runtime Version set to .NET 4.x Equivalent. I just updated the DLLs to the net45 version. I still have the same problem, and now I am also having a problem with the new log4net.

The game server (not GameLift local) shows this error 7 times in a row when I call GameLiftServerAPI.InitSDK(), but everything seems to still work fine besides still having the previous problem with outcome.Success.

log4net:ERROR Exception while reading ConfigurationSettings. Check your .config file is well formed XML.
System.PlatformNotSupportedException: Operation is not supported on this platform.<br><br>

Edit: I forgot to say that checking if outcome.Error is null did not work. It is always null.

Edit 2: I fixed the log4net problem by changing the Api Compatibility Level from .NET Standard 2.0 to .NET 4.x. The readme in the GameLift server SDK has no instructions for what DLLs to add or what compatibility level to set. So now, my only problem is the original problem, and I also have this new message from the game server while it Inits.

Fallback handler could not load library C:/Users/Username/Desktop/Network1v1Builds/Server/Network1v1_Data/Mono/libc
Fallback handler could not load library C:/Users/Username/Desktop/Network1v1Builds/Server/Network1v1_Data/Mono/libc.dll
Fallback handler could not load library C:/Users/Username/Desktop/Network1v1Builds/Server/Network1v1_Data/Mono/libc

And I get this warning when building the server:

System.Windows.Forms.dll assembly is referenced by user code, but is not supported on StandaloneWindows64 platform. Various failures might follow.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)<br>

But it still works.

1 Like