Sign In Register

How can we help you today?

Start a new topic
Answered

gamesparks disconnect when call findmatchrequest

i'm added test code in GameSparksTestUI


  

if (GUILayout.Button ("FindMatchRequest", GUILayout.Width (itemWidth), GUILayout.Height (itemHeight))) {
	new FindMatchRequest()
        .SetMatchShortCode("MAIN_MCH")
        .SetSkill(10).Send((response) => {
				Utility.HandleLog("FindMatchRequest:" + response.JSONString);
         });
}

 

when i'm press FindMatchRequest Button GameSparks will be disconnect and auto reconnect


what's wrong with my code? 


Best Answer

Hi Satit,


This should be what you need to get going.


new FindMatchRequest()

    .SetAction(action)

    .SetMatchGroup(matchGroup)

    .SetMatchShortCode(matchShortCode)

    .SetSkill(skill)

    .Send((response) => {

        String accessToken = response.GetAccessToken(); 

        String host = response.GetHost(); 

        String matchId = response.GetMatchId(); 

        GSEnumerable<_Player> opponents = response.GetOpponents(); 

        int? peerId = response.GetPeerId(); 

        String playerId = response.GetPlayerId(); 

        int? port = response.GetPort(); 

        GSData scriptData = response.GetScriptData(); 

    });


Thanks,

Liam

1 Comment

Answer

Hi Satit,


This should be what you need to get going.


new FindMatchRequest()

    .SetAction(action)

    .SetMatchGroup(matchGroup)

    .SetMatchShortCode(matchShortCode)

    .SetSkill(skill)

    .Send((response) => {

        String accessToken = response.GetAccessToken(); 

        String host = response.GetHost(); 

        String matchId = response.GetMatchId(); 

        GSEnumerable<_Player> opponents = response.GetOpponents(); 

        int? peerId = response.GetPeerId(); 

        String playerId = response.GetPlayerId(); 

        int? port = response.GetPort(); 

        GSData scriptData = response.GetScriptData(); 

    });


Thanks,

Liam

Login to post a comment