Google play game service ,determining a host or server

天大地大妈咪最大 提交于 2019-12-08 05:34:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!