internal static LeaderboardUpdate From(LeaderboardScoreUploaded_t e) =>
 new LeaderboardUpdate
 {
     Score         = e.Score,
     Changed       = e.ScoreChanged == 1,
     NewGlobalRank = e.GlobalRankNew,
     OldGlobalRank = e.GlobalRankPrevious
 };
        private static void OnClient(IntPtr thisptr, IntPtr pvParam)
        {
            Action <LeaderboardScoreUploaded_t> action = LeaderboardScoreUploaded_t.actionClient;

            if (action != null)
            {
                action(LeaderboardScoreUploaded_t.Fill(pvParam));
            }
            else
            {
            }
        }
예제 #3
0
        internal static LeaderboardUpdate From(LeaderboardScoreUploaded_t e)
        {
            LeaderboardUpdate leaderboardUpdate = new LeaderboardUpdate()
            {
                Score         = e.Score,
                Changed       = e.ScoreChanged == 1,
                NewGlobalRank = e.GlobalRankNew,
                OldGlobalRank = e.GlobalRankPrevious
            };

            return(leaderboardUpdate);
        }
        public static async Task <LeaderboardScoreUploaded_t?> GetResultAsync(SteamAPICall_t handle)
        {
            LeaderboardScoreUploaded_t?nullable;
            bool flag = false;

            while (!SteamUtils.IsCallComplete(handle, out flag))
            {
                await Task.Delay(1);

                if ((SteamClient.IsValid ? false : !SteamServer.IsValid))
                {
                    nullable = null;
                    return(nullable);
                }
            }
            if (!flag)
            {
                IntPtr intPtr = Marshal.AllocHGlobal(LeaderboardScoreUploaded_t.StructSize);
                try
                {
                    if (!(!SteamUtils.Internal.GetAPICallResult(handle, intPtr, LeaderboardScoreUploaded_t.StructSize, 1106, ref flag) | flag))
                    {
                        nullable = new LeaderboardScoreUploaded_t?(LeaderboardScoreUploaded_t.Fill(intPtr));
                    }
                    else
                    {
                        nullable = null;
                    }
                }
                finally
                {
                    Marshal.FreeHGlobal(intPtr);
                }
            }
            else
            {
                nullable = null;
            }
            return(nullable);
        }