SDK Integration (Sync V2)
Please Note
Currently we only have Unity example apps. You can still implement your real-time game utilizing the Skillz iOS or Android SDKs. Work with the Skillz team to answer questions regarding your specific platform.
Match ID Note
Please note that you should use the MatchId from the CustomServerConnectionInfo instance. This will be the unique id for the sync match.
string matchID = matchInfo.CustomServerConnectionInfo.MatchId;
Skillz Sync V2 SDK integration
The Skillz SDK integration will be the same as your Async game modes. The difference comes with how you handle things once the match begins. Once the match begins you will connect to the game server and start sending and receiving game state updates based upon your needs. As with the Async game play you simply implement methods that handle game start and exiting the Skillz interface. The key difference comes where you need to detect the match type "Async" or "Sync" and handle the game start as required.
Starting a game (Match Start)
When a match begins the Skillz SDK will call the OnMatchWillBegin method (Unity implementation). In this method you check the match info object to see if you have a server IP and port, if so you have a real-time match and can connect to the server and begin your game logic. If not you simply have an async match and can continue accordingly.
void SkillzMatchDelegate.OnMatchWillBegin(Match matchInfo)
{
// Please note Unity provides a helper property to determine the match type
// if IsCustomSynchronousMatch is true we have a sync v2 match
if (matchInfo.IsCustomSynchronousMatch)
{
// get the needed info and handle your real-time game start
string matchID = matchInfo.CustomServerConnectionInfo.MatchId;
string hostName = matchInfo.CustomServerConnectionInfo.ServerIp;
string port = matchInfo.CustomServerConnectionInfo.ServerIp;
// ...
}
else
{
// handle your async game start
}
}
Ending a game
Currently when a game is over you will need to use the SDK to report the score from the client. Use the Report Final Score method for your chosen platform. Please keep in mind that this implementation will change in future versions and you will be required to report the score via the server.