【问题标题】:Google Play Game Services's invite dialog doesn't show any friendGoogle Play 游戏服务的邀请对话框未显示任何朋友
【发布时间】:2016-07-04 00:38:15
【问题描述】:

我正在尝试让 GPG C++ 的邀请系统在 iOS 游戏中正常工作。 我尝试调用 RealtimeMultiplayerManager::ShowPlayerSelectUI() 打开一个对话框来选择要邀请的朋友。但是,对话框没有显示任何朋友,只有“自动选择”选项。我在同一个圈子中有几个 Google 测试帐户,它们已经在 Google Play Console 中列为测试人员。游戏仍在开发中。 有谁知道怎么回事?

谢谢,

代码如下:

m_gameServices->RealTimeMultiplayer().ShowPlayerSelectUI(1, 1, true,
                                                                 [this](gpg::RealTimeMultiplayerManager::PlayerSelectUIResponse const &
                                                                        response){

                                                                     HQRemote::Log("inviting friends %d", response.status);

                                                                     if (gpg::IsError(response.status))
                                                                     {
                                                                         handleError((BaseStatus::StatusCode)response.status);
                                                                     }
                                                                     else{
                                                                         auto config = gpg::RealTimeRoomConfig::Builder()
                                                                                        .PopulateFromPlayerSelectUIResponse(response)
                                                                                        .Create();

                                                                         createRoom(config);
                                                                     }
                                                                 });

2016 年 3 月 21 日更新: 经过 3 天的开发,朋友终于出现在对话框的 UI 上。为什么会有这样的延迟?

【问题讨论】:

    标签: c++ ios google-play-games


    【解决方案1】:

    如果您配置错误,请尝试检查您的 RealTimeMultiplayerManager::ShowPlayerSelectUI 方法。这是一个示例 sn-p。

    void Engine::InviteFriend() {
      service_->RealTimeMultiplayer().ShowPlayerSelectUI(
          MIN_PLAYERS, MAX_PLAYERS, true,
          [this](gpg::RealTimeMultiplayerManager::PlayerSelectUIResponse const &
                     response) {
            LOGI("inviting friends %d", response.status);
                // Your code to handle the users's selection goes here.
          });
    }
    

    您还可以查看此Adding Real-time Multiplayer Support to Your Game 文档来检查您的配置。

    【讨论】:

    • 我尝试运行他们的 ButtonClicker 示例也一样,没有朋友显示。但是,快速匹配适用于 ButtonClicker 和我的游戏,游戏服务能够选择随机的人来相互连接。游戏服务似乎也有一些 SendReliableMessage 错误。它总是返回 ERR_NOT_AUTHORIZED,即使我没有授权,我也无法创建任何快速匹配。
    • 能否提供RealtimeMultiplayerManager::ShowPlayerSelectUI()方法中的日志和代码?
    • "邀请好友1",但是只有当我选择"自动选择"并开始游戏时才会触发回调。
    猜你喜欢
    • 1970-01-01
    • 2013-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-11-11
    • 1970-01-01
    • 2013-05-30
    • 1970-01-01
    相关资源
    最近更新 更多