Exemple #1
0
        // Token: 0x06000064 RID: 100 RVA: 0x0000BCB4 File Offset: 0x00009EB4
        protected void GetAchievementsCallback(IAsyncResult result)
        {
            SignedInGamer signedInGamer = result.AsyncState as SignedInGamer;

            if (signedInGamer == null)
            {
                GlobalAppDefinitions.gameOnlineActive = 0;
                return;
            }
            GlobalAppDefinitions.gameOnlineActive = 1;
            lock (this.achievementsLockObject)
            {
                this.maxGamerScore    = 0;
                this.earnedGamerScore = 0;
                this.achievements     = signedInGamer.EndGetAchievements(result);
                for (int i = 0; i < this.achievements.Count; i++)
                {
                    Achievement achievement = this.achievements[i];
                    this.achievementName[i]       = achievement.Name;
                    this.achievementDesc[i]       = achievement.Description;
                    this.achievementGamerScore[i] = achievement.GamerScore;
                    string key;
                    if ((key = achievement.Key) != null)
                    {
                        if (achievementKeyToId == null)
                        {
                            Dictionary <string, int> dictionary = new Dictionary <string, int>(12);
                            dictionary.Add("88 Miles Per Hour", 0);
                            dictionary.Add("Just One Hug is Enough", 1);
                            dictionary.Add("Paradise Found", 2);
                            dictionary.Add("Take the High Road", 3);
                            dictionary.Add("King of the Rings", 4);
                            dictionary.Add("Statue Saviour", 5);
                            dictionary.Add("Heavy Metal", 6);
                            dictionary.Add("All Stages Clear", 7);
                            dictionary.Add("Treasure Hunter", 8);
                            dictionary.Add("Dr Eggman Got Served", 9);
                            dictionary.Add("Just In Time", 10);
                            dictionary.Add("Saviour of the Planet", 11);
                            achievementKeyToId = dictionary;
                        }
                        int num;
                        if (achievementKeyToId.TryGetValue(key, out num))
                        {
                            switch (num)
                            {
                            case 0:
                                this.achievementID[i] = 0;
                                break;

                            case 1:
                                this.achievementID[i] = 1;
                                break;

                            case 2:
                                this.achievementID[i] = 2;
                                break;

                            case 3:
                                this.achievementID[i] = 3;
                                break;

                            case 4:
                                this.achievementID[i] = 4;
                                break;

                            case 5:
                                this.achievementID[i] = 5;
                                break;

                            case 6:
                                this.achievementID[i] = 6;
                                break;

                            case 7:
                                this.achievementID[i] = 7;
                                break;

                            case 8:
                                this.achievementID[i] = 8;
                                break;

                            case 9:
                                this.achievementID[i] = 9;
                                break;

                            case 10:
                                this.achievementID[i] = 10;
                                break;

                            case 11:
                                this.achievementID[i] = 11;
                                break;
                            }
                        }
                    }
                    this.maxGamerScore += achievement.GamerScore;
                    if (achievement.IsEarned)
                    {
                        this.earnedGamerScore    += achievement.GamerScore;
                        this.achievementEarned[i] = 1;
                    }
                    else
                    {
                        this.achievementEarned[i] = 0;
                    }
                }
            }
        }