public void RequestUserAchievements(SteamID steamID, OnUserStatsReceived onUserStatsReceived, IEnumerable <string> requestedAchievements) { Achievements achievements = new Achievements(); achievements.Init(steamID, true); achievements.RequestCurrentAchievements(onUserStatsReceived, requestedAchievements); }
public void RequestUserStats(SteamID steamID, OnUserStatsReceived onUserStatsReceived, IEnumerable <string> requestedStats) { Stats stats = new Stats(); stats.Init(steamID, true); stats.RequestCurrentStats(onUserStatsReceived, requestedStats); }
internal static void InstallEvents() { UserStatsReceived_t.Install(x => { if (x.SteamIDUser == SteamClient.SteamId) { StatsRecieved = true; } OnUserStatsReceived?.Invoke(x.SteamIDUser, x.Result); }); UserStatsStored_t.Install(x => OnUserStatsStored?.Invoke(x.Result)); UserAchievementStored_t.Install(x => OnAchievementProgress?.Invoke(x.AchievementName, (int)x.CurProgress, (int)x.MaxProgress)); UserStatsUnloaded_t.Install(x => OnUserStatsUnloaded?.Invoke(x.SteamIDUser)); }
public void RequestCurrentAchievements(OnUserStatsReceived onUserStatsReceived, IEnumerable <string> requestedAchievements) { this._requestedAchievements = requestedAchievements; this._onUserStatsReceived = onUserStatsReceived; if (this._internalOnUserStatsReceived == null) { this._internalOnUserStatsReceived = new OnUserStatsReceivedFromSteam(this.OnUserStatsReceivedCallback); } if (this._gameserverStats != IntPtr.Zero) { CommunityExpress.Instance.AddGameServerUserStatsReceivedCallback(Achievements.SteamUnityAPI_SteamGameServerStats_RequestUserStats(this._gameserverStats, this._id.ToUInt64()), new OnUserStatsReceivedFromSteam(this.OnUserStatsReceivedCallback)); } else { Achievements.SteamUnityAPI_SteamUserStats_RequestCurrentStats(this._stats, Marshal.GetFunctionPointerForDelegate((Delegate)this._internalOnUserStatsReceived)); } }
internal static void InstallEvents() { Dispatch.Install <UserStatsReceived_t>(x => { if (x.SteamIDUser == SteamClient.SteamId) { StatsRecieved = true; } OnUserStatsReceived?.Invoke(x.SteamIDUser, x.Result); }); Dispatch.Install <UserStatsStored_t>(x => OnUserStatsStored?.Invoke(x.Result)); Dispatch.Install <UserAchievementStored_t>(x => OnAchievementProgress?.Invoke(new Achievement(x.AchievementNameUTF8()), (int)x.CurProgress, (int)x.MaxProgress)); Dispatch.Install <UserStatsUnloaded_t>(x => OnUserStatsUnloaded?.Invoke(x.SteamIDUser)); Dispatch.Install <UserAchievementIconFetched_t>(x => OnAchievementIconFetched?.Invoke(x.AchievementNameUTF8(), x.IconHandle)); }