【发布时间】:2017-09-14 02:30:52
【问题描述】:
尝试从 Xbox Live 检索排行榜时,统计事件类型 get_leaderboard_complete 返回错误代码 404。我在创意者计划的 UWP 游戏中使用 Xbox Live。
我能够为用户设置和检索统计信息。这部分工作没有问题:
xbox_live_result<stat_value> serverStat = m_statsManager->get_stat(m_user, L"score");
auto result = serverStat.payload();
if (result.as_integer() < score) {
setStatForUser(m_user, L"score", score);
}
我的代码取自Xbox Live Samples 中的排行榜示例。因此,为了检索我的排行榜,我调用了getLeaderboard(m_user, L"score");,每一帧我都调用了statsManager->do_work();。
// Process events from the stats manager
// This should be called each frame update
auto statsEvents = m_statsManager->do_work();
std::wstring text;
for (const auto& evt : statsEvents)
{
switch (evt.event_type())
{
case stat_event_type::local_user_added:
text = L"local_user_added";
break;
case stat_event_type::local_user_removed:
text = L"local_user_removed";
break;
case stat_event_type::stat_update_complete:
text = L"stat_update_complete";
break;
case stat_event_type::get_leaderboard_complete:
text = L"get_leaderboard_complete";
auto getLeaderboardCompleteArgs = std::dynamic_pointer_cast<leaderboard_result_event_args>(evt.event_args());
processLeaderboards(evt.local_user(), getLeaderboardCompleteArgs->result());
break;
}
stringstream_t source;
source << _T("StatsManager event: ");
source << text;
source << _T(".");
log("%S", source.str().c_str());
}
因为我能够毫无问题地设置和检索统计数据,我想知道这可能是 Xbox Live 后端的问题吗?不过,我对xbox live 2017数据平台不是很熟悉,可能调用有误。
【问题讨论】: