谷歌游戏服务,取得房间清单 [英] Google gaming services, obtain list of rooms

查看:120
本文介绍了谷歌游戏服务,取得房间清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算引入谷歌为我的应用程序玩游戏服务。但是我不知道如果我可以提供以下功能。我需要能够列出客房提供这样玩家就可以加入他选择,而不是自动加入任何房间。

I am planning on introducing Google play game services to my app. However I am not sure if i can provide the following capability. I need to be able to list the rooms available so the player can join any room he chooses rather than auto join.

有没有办法做到这一点?谢谢

Is there a way to do that? Thank you

推荐答案

在当前实现我们的API,有没有开房,你可以自愿选择。您需要邀请进入一个房间。所以,什么你问的是,我们有一个方法是最接近的<一个href=\"https://developer.android.com/reference/com/google/android/gms/games/GamesClient.html#loadInvitations%28com.google.android.gms.games.multiplayer.OnInvitationsLoadedListener%29\"相对=nofollow> GamesClient.loadInvitations()方法,其中将列出所有当前活动的邀请室玩家了。

In the current implementation of our API, there are no "open rooms" that you can voluntarily enter. You need an invitation to enter a room. So the method we have that's closest to what you're asking is the GamesClient.loadInvitations() method, which will list all the currently active invitations to rooms that the player has.

如果你想实现的行为是我想加入一个房间,打得倒四维棋,而不会被一个朋友受到邀请,那么你想要的是可能的 automatching 的。 Automatching意味着你创建一个房间,并指定你在游戏中需要玩家的数量和可选的变种code(整数),表示游戏类型。然后,API将一组球员是谁想要玩同样的变异在那一刻搭配在一起,并把他们都在同一个房间。

If the behavior you're trying to implement is "I want to join a room that's playing upside-down four-dimensional chess", without being specifically invited by a friend, then what you want is probably automatching. Automatching means you create a room and specify the number of players you want in your game and, optionally, a variant code (an integer) that indicates the game type. Then, the API will match together a set of players who is wanting to play that same variant at that moment, and will put them all in the same room.

这篇关于谷歌游戏服务,取得房间清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆