public static extern LeaderboardDisplay _GetLeaderboardDisplayType(IntPtr self, SteamLeaderboard_t hSteamLeaderboard);
Пример #2
0
 public static SteamAPICall_t DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, CSteamID[] prgUsers, int cUsers)
 {
     InteropHelp.TestIfAvailableClient();
     return((SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntriesForUsers(hSteamLeaderboard, prgUsers, cUsers));
 }
Пример #3
0
 public static SteamAPICall_t AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC)
 {
     InteropHelp.TestIfAvailableClient();
     return((SteamAPICall_t)NativeMethods.ISteamUserStats_AttachLeaderboardUGC(hSteamLeaderboard, hUGC));
 }
Пример #4
0
 public static string GetLeaderboardName(SteamLeaderboard_t hSteamLeaderboard)
 {
     InteropHelp.TestIfAvailableClient();
     return(InteropHelp.PtrToStringUTF8(NativeMethods.ISteamUserStats_GetLeaderboardName(hSteamLeaderboard)));
 }
Пример #5
0
 public static ELeaderboardDisplayType GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUserStats_GetLeaderboardDisplayType(hSteamLeaderboard));
 }
Пример #6
0
 internal async Task <LeaderboardUGCSet_t?> AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC)
 {
     return(await LeaderboardUGCSet_t.GetResultAsync(_AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC )));
 }
 public bool Equals(SteamLeaderboard_t other) => default;                               // 0x0000000180004FB0-0x0000000180004FC0
 public int CompareTo(SteamLeaderboard_t other) => default;                             // 0x0000000180004F10-0x0000000180004F20
 public static extern SteamAPICall_t _UploadLeaderboardScore(IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In, Out] int[]  pScoreDetails, int cScoreDetailsCount);
        public CallResult <LeaderboardScoreUploaded_t> UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In, Out] int[]  pScoreDetails, int cScoreDetailsCount)
        {
            var returnValue = _UploadLeaderboardScore(Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount);

            return(new CallResult <LeaderboardScoreUploaded_t>(returnValue, IsServer));
        }
 public static extern SteamAPICall_t _DownloadLeaderboardEntriesForUsers(IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In, Out] SteamId[]  prgUsers, int cUsers);
        /// <summary>
        /// Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers
        /// </summary>
        public CallResult <LeaderboardScoresDownloaded_t> DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, [In, Out] SteamId[]  prgUsers, int cUsers)
        {
            var returnValue = _DownloadLeaderboardEntriesForUsers(Self, hSteamLeaderboard, prgUsers, cUsers);

            return(new CallResult <LeaderboardScoresDownloaded_t>(returnValue, IsServer));
        }
        public CallResult <LeaderboardScoresDownloaded_t> DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd)
        {
            var returnValue = _DownloadLeaderboardEntries(Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd);

            return(new CallResult <LeaderboardScoresDownloaded_t>(returnValue, IsServer));
        }
 public static extern SteamAPICall_t _DownloadLeaderboardEntries(IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd);
        public LeaderboardDisplay GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard)
        {
            var returnValue = _GetLeaderboardDisplayType(Self, hSteamLeaderboard);

            return(returnValue);
        }
Пример #15
0
 internal async Task <LeaderboardScoresDownloaded_t?> DownloadLeaderboardEntriesForUsers(SteamLeaderboard_t hSteamLeaderboard, [In, Out] SteamId[]  prgUsers, int cUsers)
 {
     return(await LeaderboardScoresDownloaded_t.GetResultAsync(_DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers )));
 }
 public static extern SteamAPICall_t _AttachLeaderboardUGC(IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC);
Пример #17
0
 internal async Task <LeaderboardScoreUploaded_t?> UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In, Out] int[]  pScoreDetails, int cScoreDetailsCount)
 {
     return(await LeaderboardScoreUploaded_t.GetResultAsync(_UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount )));
 }
        public CallResult <LeaderboardUGCSet_t> AttachLeaderboardUGC(SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC)
        {
            var returnValue = _AttachLeaderboardUGC(Self, hSteamLeaderboard, hUGC);

            return(new CallResult <LeaderboardUGCSet_t>(returnValue, IsServer));
        }
 public static explicit operator ulong(SteamLeaderboard_t that) => default;             // 0x00000001802A78B0-0x00000001802A78C0
 public bool Equals(SteamLeaderboard_t other) => default;                               // 0x0000000180004FB0-0x0000000180004FC0
Пример #20
0
 internal string GetLeaderboardName(SteamLeaderboard_t hSteamLeaderboard)
 {
     return(_GetLeaderboardName(Self, hSteamLeaderboard));
 }
Пример #21
0
 public static ELeaderboardSortMethod GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUserStats_GetLeaderboardSortMethod(CSteamAPIContext.GetSteamUserStats(), hSteamLeaderboard));
 }
Пример #22
0
 internal int GetLeaderboardEntryCount(SteamLeaderboard_t hSteamLeaderboard)
 {
     return(_GetLeaderboardEntryCount(Self, hSteamLeaderboard));
 }
Пример #23
0
 public static int GetLeaderboardEntryCount(SteamLeaderboard_t hSteamLeaderboard)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUserStats_GetLeaderboardEntryCount(hSteamLeaderboard));
 }
Пример #24
0
 internal LeaderboardSort GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard)
 {
     return(_GetLeaderboardSortMethod(Self, hSteamLeaderboard));
 }
Пример #25
0
 public static SteamAPICall_t DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd)
 {
     InteropHelp.TestIfAvailableClient();
     return((SteamAPICall_t)NativeMethods.ISteamUserStats_DownloadLeaderboardEntries(hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd));
 }
Пример #26
0
 internal LeaderboardDisplay GetLeaderboardDisplayType(SteamLeaderboard_t hSteamLeaderboard)
 {
     return(_GetLeaderboardDisplayType(Self, hSteamLeaderboard));
 }
Пример #27
0
 public static SteamAPICall_t UploadLeaderboardScore(SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, int[] pScoreDetails, int cScoreDetailsCount)
 {
     InteropHelp.TestIfAvailableClient();
     return((SteamAPICall_t)NativeMethods.ISteamUserStats_UploadLeaderboardScore(hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount));
 }
Пример #28
0
 internal async Task <LeaderboardScoresDownloaded_t?> DownloadLeaderboardEntries(SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd)
 {
     return(await LeaderboardScoresDownloaded_t.GetResultAsync(_DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd )));
 }
Пример #29
0
    private IEnumerator UpdateLeaderboard(int timeInMilliseconds, string leaderboardName)
    {
        Debug.Log("updating leaderboard");
        if (!SteamManager.Initialized)
        {
            Debug.Log("steammanager not initialized");
            yield break;
        }

        bool findLeaderboardCallCompleted = false;
        bool error = false;
        bool uploadedScoreCallCompleted = false;

        Steamworks.SteamLeaderboard_t         speedrunLeaderboard = new Steamworks.SteamLeaderboard_t();
        Steamworks.LeaderboardScoreUploaded_t leaderboardScore    = new Steamworks.LeaderboardScoreUploaded_t();

        Steamworks.SteamAPICall_t speedrunLeaderboardSearch = Steamworks.SteamUserStats.FindLeaderboard(leaderboardName);
        Steamworks.CallResult <Steamworks.LeaderboardFindResult_t> findLeaderboardCallResult = Steamworks.CallResult <Steamworks.LeaderboardFindResult_t> .Create();

        findLeaderboardCallResult.Set(speedrunLeaderboardSearch, (leaderboardFindResult, failure) =>
        {
            if (!failure && leaderboardFindResult.m_bLeaderboardFound == 1)
            {
                speedrunLeaderboard = leaderboardFindResult.m_hSteamLeaderboard;
                Debug.Log("speedrunLeaderboard found");
            }
            else
            {
                error = true;
            }

            findLeaderboardCallCompleted = true;
        });

        while (!findLeaderboardCallCompleted)
        {
            yield return(null);
        }

        if (error)
        {
            Debug.Log("Error finding High Score leaderboard.");
            yield break;
        }

        Steamworks.SteamAPICall_t uploadedScoreCall = Steamworks.SteamUserStats.UploadLeaderboardScore(speedrunLeaderboard, Steamworks.ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodKeepBest, timeInMilliseconds, new int[0], 0);
        Steamworks.CallResult <Steamworks.LeaderboardScoreUploaded_t> leaderboardScoreUploadedCallResult = Steamworks.CallResult <Steamworks.LeaderboardScoreUploaded_t> .Create();

        leaderboardScoreUploadedCallResult.Set(uploadedScoreCall, (scoreUploadedResult, failure) =>
        {
            if (!failure && scoreUploadedResult.m_bSuccess == 1)
            {
                leaderboardScore = scoreUploadedResult;
                Debug.Log("leaderboardScore found");
            }
            else
            {
                error = true;
            }

            uploadedScoreCallCompleted = true;
        });

        while (!uploadedScoreCallCompleted)
        {
            yield return(null);
        }

        if (error)
        {
            Debug.Log("Error uploading to High Score leaderboard.");
            yield break;
        }

        if (leaderboardScore.m_bScoreChanged == 1)
        {
            Debug.Log(String.Format("New high score! Global rank #{0}.", leaderboardScore.m_nGlobalRankNew));
        }
        else
        {
            Debug.Log(String.Format("A previous score was better. Global rank #{0}.", leaderboardScore.m_nGlobalRankNew));
        }
    }
        public LeaderboardSort GetLeaderboardSortMethod(SteamLeaderboard_t hSteamLeaderboard)
        {
            var returnValue = _GetLeaderboardSortMethod(Self, hSteamLeaderboard);

            return(returnValue);
        }