Exception Running the Sample GameLift Code from AWS

0

I am using the Sample Multiplayer sample code from AWS GameLift named MegaFrogRace. I followed the instructions from the following URL: https://aws.amazon.com/blogs/gametech/creating-servers-for-multiplayer-mobile-games-with-amazon-gamelift/

I am using unity editor and Mac OS to run the sample Game. I uploaded the Game Server scripts and configured everything in the backend. But when I try to play the game in Multiplayer using GameLift, I am getting the following exception:

NotImplementedException: The method or operation is not implemented. at System.Net.NetworkInformation.UnixIPGlobalProperties.GetActiveUdpListeners () [0x00000] in <d2089eb4d5454c27b77bed2594d4c554>:0 at RTSClient.FindAvailableUDPPort (System.Int32 firstPort, System.Int32 lastPort) [0x00019] in <af5831d8f72447eaa46242e583778b16>:0 at RTSClient+<ConnectToServer>d__23.MoveNext () [0x000c0] in <af5831d8f72447eaa46242e583778b16>:0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00027] in <db5455c3e45a43d8b185213394ee01c1>:0 UnityEngine.MonoBehaviour:StartCoroutineManaged2(IEnumerator) UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator) RTSClient:ActionConnectToServer(String, Int32, String) <>c__DisplayClass41_0`3:<QForMainThread>b__0() RTSClient:RunMainThreadQueueActions() RTSClient:Update()

(Filename: <d2089eb4d5454c27b77bed2594d4c554> Line: 0)

Kindly help me in figuring out the problem. Thanks

질문됨 4년 전283회 조회
3개 답변
0
수락된 답변

https://github.com/aws-samples/megafrograce-gamelift-realtime-servers-sample/pull/9

Replace the included FindAvailableUDPPort function with this one.

private static readonly IPEndPoint DefaultLoopbackEndpoint = new IPEndPoint(IPAddress.Loopback, port: 0);
private int FindAvailableUDPPort()
{
    using (var socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp))
    {
        socket.Bind(DefaultLoopbackEndpoint);
        int port = ((IPEndPoint)socket.LocalEndPoint).Port;
        return port;
    }
}

The function in the demo example was only created with Windows in mind. However this one will work for Windows, Mac, iOS, and Android. I'm unsure why they haven't tested this pull request yet?

답변함 4년 전
0

@REDACTEDUSER

Have reached out to a few folks to try and get the pull request handled.

답변함 4년 전
0

Thank you so much. I am able to play now.

답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠