public void RpcGrantAchievement(string achievementName) { foreach (LocalUser user in LocalUserManager.readOnlyLocalUsersList) { AchievementManager.GetUserAchievementManager(user).GrantAchievement(AchievementManager.GetAchievementDef(achievementName)); } }
// Token: 0x060003B6 RID: 950 RVA: 0x0000E55C File Offset: 0x0000C75C public void OnInstall(LocalUser localUser) { this.localUser = localUser; this.userProfile = localUser.userProfile; foreach (string text in AchievementManager.readOnlyAchievementIdentifiers) { AchievementDef achievementDef = AchievementManager.GetAchievementDef(text); if (this.userProfile.HasAchievement(text)) { if (!this.userProfile.HasUnlockable(achievementDef.unlockableRewardIdentifier)) { Debug.LogFormat("UserProfile {0} has achievement {1} but not its unlockable {2}. Granting.", new object[] { this.userProfile.name, achievementDef.nameToken, achievementDef.unlockableRewardIdentifier }); this.userProfile.AddUnlockToken(achievementDef.unlockableRewardIdentifier); } } else { BaseAchievement baseAchievement = (BaseAchievement)Activator.CreateInstance(achievementDef.type); baseAchievement.achievementDef = achievementDef; baseAchievement.owner = this; this.achievementsList.Add(baseAchievement); baseAchievement.OnInstall(); } } }