public void readLeaderboard(int leaderboardID, LeaderboardKey key) { this.LeaderboardsRead = (XNAConnect.LeaderboardResult)null; if (TheSims3.IsTrialMode) { return; } SignedInGamer gamer = XNAConnect.getGamer(); if (gamer == null) { return; } LeaderboardIdentity leaderboardIdentity = LeaderboardIdentity.Create(key, leaderboardID); this.LeaderboardsRead = new XNAConnect.LeaderboardResult(leaderboardIdentity); try { //LeaderboardReader.BeginRead(leaderboardIdentity, (Gamer)gamer, 20, new AsyncCallback(this.LeaderboardCallback), (object)gamer); } //catch (GameUpdateRequiredException ex) //{ // XNAConnect.PromptForUpdate(); //} catch (Exception ex) { XNAConnect.NotifyConnectionLost(); } }
public void writeToLeaderboard( int leaderboardID, int score, TimeSpan time, bool win, LeaderboardKey key) { SignedInGamer gamer = XNAConnect.getGamer(); if (gamer == null) { return; } if (TheSims3.IsTrialMode) { return; } try { //LeaderboardIdentity leaderboardId = LeaderboardIdentity.Create(key, leaderboardID); //LeaderboardEntry leaderboard = gamer.LeaderboardWriter.GetLeaderboard(leaderboardId); //leaderboard.Rating = !Scene.IsScoreLeaderboard(leaderboardID) ? (long) time.TotalMinutes : (long) score; //leaderboard.Columns.SetValue("Outcome", win ? LeaderboardOutcome.Win : LeaderboardOutcome.Loss); } //catch (GameUpdateRequiredException ex) //{ // XNAConnect.PromptForUpdate(); //} catch (Exception ex) { } }
public static AchievementCollection getAchievements() { SignedInGamer gamer = XNAConnect.getGamer(); if (gamer == null) { return((AchievementCollection)null); } AchievementCollection achievementCollection = (AchievementCollection)null; try { achievementCollection = gamer.GetAchievements(); } //catch (GameUpdateRequiredException ex) //{ // XNAConnect.PromptForUpdate(); //} catch (Exception ex) { } return(achievementCollection); }
public void awardAchievement(string achievementKey) { if (TheSims3.IsTrialMode) { return; } SignedInGamer gamer = XNAConnect.getGamer(); if (gamer == null) { return; } try { gamer.AwardAchievement(achievementKey); } //catch (GameUpdateRequiredException ex) //{ // XNAConnect.PromptForUpdate(); //} catch (Exception ex) { } }
public string getInputString(string title, int maxSize) { this.m_gettingInput = true; TextBox textBox = new TextBox(title, (string)null, maxSize, 0); Displayable current = this.m_display.getCurrent(); textBox.show(this.m_display); JavaLibGame.GraphicsDeviceManager.SupportedOrientations = DisplayOrientation.LandscapeLeft; JavaLibGame.GraphicsDeviceManager.ApplyChanges(); string defaultText = ""; if (XNAConnect.getGamer() != null) { defaultText = XNAConnect.getGamer().DisplayName; } //IAsyncResult result = Guide.BeginShowKeyboardInput(PlayerIndex.One, this.m_engine.getTextManager().getString(1823), this.m_engine.getTextManager().getString(1824), defaultText, (AsyncCallback) null, (object) null); //while (!result.IsCompleted) //JThread.sleep(500); string text = /* Guide.EndShowKeyboardInput(result) */ string.IsNullOrWhiteSpace(defaultText) ? "C**t" : defaultText; JavaLibGame.GraphicsDeviceManager.SupportedOrientations = DisplayOrientation.Portrait; JavaLibGame.GraphicsDeviceManager.ApplyChanges(); textBox.setString(text); if (!this.m_beingDestroyed) { this.m_display.setCurrent(current); } else { this.m_display.setCurrent((Displayable)null); } string str = textBox.getString(); this.m_gettingInput = false; return(str); }