cocoa - Determine the best host in multiplayer game on iOS -
i using next code determine best host deed server in multiplayer ios game 2 users. code executed when players has connected @ same time on devices.
[mymatch choosebesthostplayerwithcompletionhandler: ^(nsstring *playerid) { nslog(@"the best host is: %@", playerid); }];
the value of playerid
null, according documentation means couldn't determine best host. testing application on iphone ios 6.1 simulator version 6.1. computer running simulator , iphone on same wireless network. i've tested calling code above in continuous manner interval on both devices , found out if 1 of devices disconnect, determine host.
do need 2 non-simulator devices test this? or else cause this?
for reason doesn't work simulator (or haven't been able create work).
i valid result of time when using 2 devices. said - it's not consistent, need backup alternative choosing host.
also
if intend search best server using method, devices in match must running on versions of game kit back upwards method, , every device in match must phone call method @ same time.
this out of multiplayer guide - phone call method on both devices @ same time?
ios cocoa game-center multiplayer
No comments:
Post a Comment