Skeleton BMP Gamehelper.getTurnBasedMatch()不存在

时间:2014-01-18 16:13:18

标签: android google-play-services google-play-games

您好我正在尝试使用基于回合制的多人游戏,因此我将SkeletonTBMP示例导入ecplise并引用了BaseGameUtils和google-play-services-lib库。问题是

mHelper.getTurnBasedMatch()

错误地说getTurnBasedMatch()没有为GameHelper定义。为什么会发生这种情况?

1 个答案:

答案 0 :(得分:0)

确保您使用的是正确版本的GameHelper。

机器人样本主\ BasicSamples \库\ BaseGameUtils \ SRC \主\的java \ COM \谷歌\示例\游戏\ basegameutils \ GameHelper.java

/**
 * Returns the tbmp match received through an invitation notification. This
 * should be called from your GameHelperListener's
 * @link{GameHelperListener#onSignInSucceeded} method, to check if there's a
 * match available.
 * @return The match, or null if none was received.
 */
public TurnBasedMatch getTurnBasedMatch() {
    if (!checkState(TYPE_DEVELOPER_ERROR, "getTurnBasedMatch",
            "TurnBasedMatch is only available when connected "
                    + "(after getting the onSignInSucceeded callback).",
            STATE_CONNECTED)) {
        return null;
    }
    return mTurnBasedMatch;
}

确保其中包含该方法。我想我必须在本地更新该文件。

我现在遇到的问题是我有这个工作,我在这里概述了。

Turn Based Multiplayer Skeleton Demo App

如果您收到代码编译,请告诉我您是否遇到同样的问题。我还没有得到任何人的答复,如何解决它。

谢谢!