问题
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 ?
回答1:
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.
来源:https://stackoverflow.com/questions/20929958/google-play-game-service-determining-a-host-or-server