【问题标题】:Stuck trying to get Game Center Leaderboard to work卡住试图让 Game Center 排行榜工作
【发布时间】:2014-04-03 01:15:25
【问题描述】:

我正在尝试让 gamecenter 排行榜工作,但卡住了。我正在 Xcode 模拟器上进行测试,因为我无法在设备上登录我们的沙盒帐户。我可以使用init函数通过游戏登录沙盒帐户,但排行榜没有显示在gamecenter中。在游戏下方显示我们的游戏,但在下方显示“没有排行榜或成就”。我在 itunes connect 中设置了排行榜,并在似乎有效的代码中请求 setHighScore。以下是相关代码:

local function updateCallback(e)
    local data = json.encode( e.data )

    -- show encoded json string via native alert
    native.showAlert( "e.data", data, { "OK" } )
end

--[[
    Update the gamecenter learderboard for gamescore.
]]--
function [app name]GameNetwork.updateGamescore()
    --Sets the score if it is higher than the one on Apple's server
    gameNetwork.request( "setHighScore",
    {
        localPlayerScore = { category = "com.[domain].[game].gamescore", value = gamescore },
        listener = updateCallback
    })
end

按预期显示更新回调

{"value": 25,"category":"com.[domain].[game].gamescore"}

updateGamescore 函数被调用时。我错过了什么吗? gamenetwork api有什么好的教程吗?

Cross-post from corona forum

【问题讨论】:

  • 我在设备上测试 Google Play 游戏服务时遇到了同样的问题。 “setHighScore”请求似乎发送成功,但在 Gamecenter 或 Google Play 游戏中没有显示排行榜。我觉得我在某个地方错过了一步,但不确定是什么。

标签: ios lua coronasdk game-center google-play-games


【解决方案1】:

终于明白了。问题在于应用程序 ID。我们的临时配置文件有一个通配符,而我们的应用商店没有。我使用特定的应用程序 ID 创建了一个新的临时配置文件,并且排行榜立即出现。此外,我们的临时配置文件使用的证书与应用商店证书不同,因此这也可能是问题所在。

【讨论】:

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