【问题标题】:Google Real Time Multiplayer players names谷歌实时多人游戏玩家名字
【发布时间】:2014-08-09 14:15:40
【问题描述】:

在创建房间和自动匹配时一切正常,但问题是当我调用 p.getDisplayName() 时,在此代码中它不返回对手名称它返回一些垃圾字母..

      void updatePeerScoresDisplay() {
    ((TextView) findViewById(R.id.score0)).setText(formatScore(mScore) + " - Me");
    int[] arr = {
            R.id.score1, R.id.score2, R.id.score3
    };
    int i = 0;

    if (mRoomId != null) {
        for (Participant p : mParticipants) {
            String pid = p.getParticipantId();
            if (pid.equals(mMyId))
                continue;
            if (p.getStatus() != Participant.STATUS_JOINED)
                continue;


           int score = mParticipantScore.containsKey(pid) ? mParticipantScore.get(pid) : 0;
            ((TextView) findViewById(arr[i])).setText(formatScore(score) + " - "+
                    p.getDisplayName());
            ++i;
        }
    }

【问题讨论】:

    标签: android google-plus real-time multiplayer


    【解决方案1】:

    它返回类似于 Player234 的内容,它不会返回玩家的姓名,即使他/她在你的圈子中(正如我所经历的那样)。这就是随机对手比赛的重点。

    google play game realtime multiplayer how to get quickmatch player's name?

    【讨论】:

      猜你喜欢
      • 2014-06-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多