- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我有一些问题在文档中没有得到解答:https://developers.google.com/games/services/android/multiplayer
RoomConfig.createAutoMatchCriteria(1, 3, 0)
未按预期工作。它只会尝试匹配 2 人游戏,永远不会是 3 人游戏,也不会是 4 人游戏。我只有 3 台设备,但我可能花了 2 个小时来尝试匹配这些设备,而且它们只是成对完成的。我读了这篇文章:Auto Match Criteria in Google Multiplayer Sample BittonClicker Game for android有类似的问题。 GamesClient.getSelectPlayersIntent(1, 3)
也有同样的错误。
GamesClient.getRealTimeWaitingRoomIntent(room, 0)
未按预期工作。文档指出“如果连接的参与者数量大于或等于指定的最小开始游戏,则启用等候室 UI 中的开始播放选项。”但是在测试时我还没有看到“开始播放”选项。发生的情况是,在弹出“准备玩”的消息后,每当第一个人连接时,等候室就会自动退出。从 0 更改为 1 具有相同的效果,更改为 Integer.MAX_VALUE
也是如此。谁能提供一种方法来实现预期的功能?我在这里做错了吗?
我在 Android 上玩过一些多人游戏,用户加入,然后离开,然后由其他人取代他们的位置。无论我为自动匹配假设什么参数,我都无法在测试中看到这一点。如果一个玩家离开房间,另一个玩家会来填补他的位置吗?如果是这样,`Room.getParticipantIds().size() 会返回一个大于 4 的数字吗?
在其中一些游戏中,一旦游戏开始就没有其他人加入。我测试了这些游戏,没有一次发现我加入了一个房间并被告知它正在进行中。他们是否以某种方式告诉服务器游戏已经开始,而不是让他们与其他玩家匹配?其他玩家如何只加入尚未开始的游戏? (这些游戏使用的是 Google Play 游戏服务)
我还有其他问题,但我不想问不必要的问题。这些问题会很有帮助,如果得到回答,我的压力会大大减轻。
感谢您的宝贵时间。
最佳答案
1) 这完全符合 Google 的预期。不保证如果您使用 createAutoMatchCriteria(1, 3, 0) 将为您的游戏找到 3 个对手。在我的测试中,(同时请求 4 个设备)90% 或更多的时间它将变成 2 个开始的 2 个游戏。仅当我有一台设备邀请 friend 或手动选择自动选择时,开始 3 人或 4 人游戏的机会才会显着增加(否则,纯自动匹配会导致 2 和 2 行为)
2) 如果我对行为的理解正确,你会得到一个玩家离开等候室(通常是第一个启动的设备)然后另一个玩家加入,但第一个玩家离开等候室,另一个离开在里面?如果是这样,那么您需要确保使用以下内容(我在 onRoomConnected 中执行
try {
bWaitRoomDismissedFromCode = true;
finishActivity(RC_WAITING_ROOM);
} catch (Exception e) {
dLog("would have errored out in waiting room");
}
这将关闭仍在等候室中的所有玩家的等候室,并让他们回到您的 Activity 中。从下面看,如果你想要“开始玩”的行为,这只有在有接受邀请的受邀玩家进入房间时才会发生。 (如果 Google 打算以另一种方式为 AutoMatch 工作,他们还没有做到这一点)
public Intent getRealTimeWaitingRoomIntent (Room room, int minParticipantsToStart)
Returns an intent that will display a "waiting room" screen that shows the progress of participants joining a real-time multiplayer room. Note that this must be invoked with startActivityForResult(Intent, int), so that the identity of the calling package can be established.
If the necessary number of peers have connected and it's now OK to start the game, or if the user explicitly asked to start the game now, the activity result will be RESULT_OK. If the user bailed out of the waiting room screen without taking any action, the result will be RESULT_CANCELED. If the user explicitly chose to leave the room, the result will be RESULT_LEFT_ROOM.
Regardless of what the result code was, the waiting room activity will return a data intent containing a Room object in EXTRA_ROOM that represents the current state of the Room that you originally passed as a parameter here.
If desired, the waiting room can allow the user to start playing the game even before the room is fully connected. This is controlled by the minParticipantsToStart parameter: if at least that many participants (including the current player) are connected to the room, a "Start playing" menu item will become enabled in the waiting room UI. Setting minParticipantsToStart to 0 means that "Start playing" will always be available, and a value of MAX_VALUE will disable the item completely. Note: if you do allow the user to start early, you'll need to handle that situation by explicitly telling the other connected peers that the game is now starting; see the developer documentation for more details.
Finally, note that the waiting room itself will never explicitly take any action to change the state of the room or its participants. So if the activity result is RESULT_LEFT_ROOM, it's the caller's responsibility to actually leave the room. Or if the result is RESULT_CANCELED, it's the responsibility of the caller to double-check the current state of the Room and decide whether to start the game, keep waiting, or do something else. But note that while the waiting room is active, the state of the Room will change as participants accept or decline invitations, and the number of participants may even change as auto-match players get added.
3) Google Play 游戏服务(用于自动匹配)没有此行为。只有当一个房间的所有参与者都被服务器找到并选中时,房间才会真正连接起来(onRoomCreated 并不意味着已经设置了一个用于通信的房间,如果玩家正在等待其他人加入,则玩家可以加入...并且可以在服务拥有所有其他玩家后进行切换)onRoomConnected 是对所有已连接玩家的最后一次调用,表示房间已准备好传递消息。现在,如果你有邀请,行为会改变,是的,你可以看到被邀请者接受,但如果他们随后离开房间.. 没有办法让 AutoMatch 填充它,但你可以看到他们离开。 ..(多好啊?)
4) 如果游戏使用 GPGS,那么一旦房间被创建并进入 onRoomConnected 阶段,它就会被玩,并且不能与该房间进行更多的比赛。所以当你加入一个房间时,其他人也会同时加入。因此,当一名玩家离开时,其他人将无法加入。
public abstract void onRoomConnected (int statusCode, Room room)
Called when all the participants in a real-time room are fully connected. This gets called once all invitations are accepted and any necessary automatching has been completed. Possible status codes include:
STATUS_OK if data was successfully loaded and is up-to-date. STATUS_CLIENT_RECONNECT_REQUIRED if the client needs to reconnect to the service to access this data. STATUS_INTERNAL_ERROR if an unexpected error occurred in the service. Parameters room The fully connected room object. The room can be null if it could not be loaded successfully.
关于android - Google Play 实时多人游戏问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21688407/
所以我的应用程序的评论显示在我的游戏控制台中,但是由于某种原因,当我在 google Play 商店上访问我的应用程序链接并以普通用户的身份查看它时,我没有收到新评论的通知,我的显示了 13 条评论,
一旦我在 2.3 play 项目上运行 'sbt compile',我就不能再使用 'sbt compile' 来编译任何 Play 2.2.x 项目。这是我运行 sbt 命令时的错误。 [info]
我有点困惑,想得到一个解释。 我正在使用 Java Play 2 和 Akka Actor 。我使用 play run 启动系统。 不过,我刚刚看到一个视频,使用了命令: play akka star
当我玩游戏时,我遇到两个选择play.api.mvc和 play.mvc包裹 有什么不同? 最佳答案 从戏! 2 文档: The API available in the play.api packa
从 2.3 迁移到 2.4 后,我收到此错误。我应该使用的正确导入语句是什么? error: value routesImport is not a member of object play.Pla
所以我在 google play 上有一个应用程序已经将近 6 个月了,最近两个月我更新了我的应用程序屏幕截图,从那时起,每次我更新我的应用程序时,我都开始收到应用程序拒绝。 上次我提出上诉并被接受,
我有以下代码: Snapshots.OpenSnapshotResult result; result = Games.Snapshots.open(googleApiClient, "save",
在过去 72 小时内,我为 Google Play 开发者计划支付的 Google 电子钱包付款显示为“您的购买正在处理中”。我知道这可能需要长达 48 小时,但这是他们处理时间最坏情况之后的一整天。
我在 Play 商店发布了应用程序,我不知道为什么应用程序显示预注册,我想为我的用户提供直接下载选项。伸出援手将不胜感激。 最佳答案 instructions for pre-registration
我有一个 PHP 后端,它与 Google Play 服务集成以验证从 APP 进行的购买。购买信息返回收据和签名,我需要验证购买是否正确。 我收到: { ...rest of the data
我在 Google Play Developer Console 上创建了我的 Android 应用程序的草稿。我已经填写了所有需要的信息。必需的步骤之一是“内容评级”。我已填写表格以自动分配 Goo
我已经设置好了 com.typesafe.play play_2.13 2.7.4 在项目 pom.xml 中。但是,当我尝试遵循this tutorial时,语句 pla
我在 Play 商店上发布了一个应用程序,并收到了一些评论。在Google Play开发者控制台中,我在一些评论中看不到应用程序的版本。这是我在“应用程序”标题下找到的内容。 版本代码 — 版本名称
假设 A 是所有者。我希望我们团队的 B、C 和 D 用户能够上传我们应用程序的新版本。这可能吗?来自 this我不太清楚用户有什么样的权限。如果有人对这部分有任何经验,欢迎。 最佳答案 您需要 go
我正在尝试将应用重新提交到 Google Play,但我似乎可以找到一种技术上的方法来实现此目的。 我对“您的应用主要针对 COPPA 定义的 13 岁以下 child 吗?”的回答是肯定的,然后在不
我想分享一下我在分析 Google Play 控制台的新功能时遇到的情况,并尝试找到解决方案。 正如你们许多人可能已经知道的那样,Google 已在 Google Play 控制台上发布了更新并引入了
我有两个用 playframework 编写的应用程序。我想加入另一个。我有一个数据库,我想在它们之间共享我的登录类。应用程序对类、方法、变量使用不同的名称。 我怎样才能实现它?我应该创建 jar 版
对于我的硕士论文,我需要自动将来自 Google Play 的不同 Android 应用程序的信息写入一个文本文件。所以我使用 perl 脚本语言来实现这种自动化。我的 perl 脚本可以在 Goog
我想测试子项目是如何工作的,尤其是 routes在主项目 ( this was not visible before ) 中考虑了子项目的数量。 我在这里阅读了文档: https://github.c
我正在使用 Play 框架 2.1.2,我有一个 handlere 方法返回一个 Promise,如 Play 的 2.1.2 documentation 中所述 但是 Play 抛出编译错误说: C
我是一名优秀的程序员,十分优秀!