문제

im trying to develop a multiplayer game using google play game service. In my game i have some game logic that will run only one players set ,which i prefr to call host. i would like to determine the host by player who created the room.

but i see room creator id can be different in different players set on a single game,and each returns as creator in auto match game.

so what should be the ideal way to find a host ,apart from sorting the player list and use the first participant as host ?

도움이 되었습니까?

해결책

Google provided a video specifically on Google Play Games: Choosing a specific user which explains how to work around agreeing and assigning a specific user a special roll. In summary: sort the participantIds and have the first by sorted order randomly choose the host and broadcast that to the other players. This ensures that all users agree on the host and the host is randomly chosen each time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top