2012-01-11 45 views
1

我想檢測我的遊戲是否處於試玩模式,並讓用戶前往市場購買。使用XNA遊戲進入試用模式市場

我做了一件HERE

的代碼,他們提供的代碼samlpe不起作用雖然

if (Guide.IsTrialMode) 
{ 
    Guide.ShowMarketplace(signedInGamer.PlayerIndex); 
} 

它給The name SignedInGamer doesn't exist in the current context

我試圖用它玩一點點修改它是:

if (Guide.IsTrialMode) 
{ 
    //Guide.ShowMarketplace(signedInGamer.PlayerIndex); 
    Guide.ShowMarketplace(PlayerIndex.One);     
} 

它的工作š但現在在模擬器上它關係到市場,並給出:

enter image description here

我不知道這是因爲遊戲是在調試模式,尚未公佈的,或者說是因爲修改我的製作?!

回答

5

這是因爲它尚未在市場上發佈。您鏈接到頁面有這樣一個字條:

當方法Guide.ShowMarketplace被稱爲對 尚未發佈到Windows Phone商城的應用程序,它會顯示 結果錯誤。 如果此錯誤的錯誤代碼爲 805a0194,那麼調用成功並且在發佈應用程序的 時將正常運行。當您的應用程序發佈時,指南.howhowplace會自動檢測您的應用程序的 唯一ID並在Windows Phone 市場客戶端應用程序中啓動正確的詳細信息頁面。

+1

哦,是的,對不起,我的壞:) – SKandeel 2012-01-11 18:58:12