예제 #1
0
        void FindResult_OnRun(ulong callHandle, LeaderboardFindResult_t param)
        {
            if (callHandle != findCall)
            {
                return; // we'll ignore results which we're not expecting
            }
            try
            {
                this.Invoke(new MethodInvoker(() =>
                {
                    if (param.m_bLeaderboardFound == 0)
                    {
                        rankGroupBox.Enabled = false;
                        Util.MsgBox(this, "No leaderboard found!");
                        return;
                    }

                    rankGroupBox.Enabled = true;
                }));


                currentBoard = param.m_hSteamLeaderboard;

                LoadSelfRank(param.m_hSteamLeaderboard);
            }
            finally
            {
                findCall = 0;
            }
        }
예제 #2
0
        static private void OnLeaderBoardFindResult(LeaderboardFindResult_t _callback, bool _IOFailure)
        {
            Debug.Log("STEAM LEADERBOARDS: Found - " + _callback.m_bLeaderboardFound + " leaderboardID - " + _callback.m_hSteamLeaderboard.m_SteamLeaderboard);
            m_steamLeaderBoard = _callback.m_hSteamLeaderboard;

            m_leaderboardInitiated = true;
        }
예제 #3
0
    private static void StoryScoreUpload(LeaderboardFindResult_t pCallback, bool failure)
    {
        storyscore = pCallback.m_hSteamLeaderboard;
        SteamAPICall_t h2 = SteamUserStats.FindLeaderboard("STORYMODETIME");

        m_findResult.Set(h2, StoryTimeUpload);
    }
예제 #4
0
    private static void EndlessScoreUpload(LeaderboardFindResult_t pCallback, bool failure)
    {
        endlessscore = pCallback.m_hSteamLeaderboard;
        SteamAPICall_t h4 = SteamUserStats.FindLeaderboard("ENDLESSMODETIME");

        m_findResult.Set(h4, EndlessTimeUpload);
    }
예제 #5
0
    private static void StoryTimeUpload(LeaderboardFindResult_t pCallback, bool failure)
    {
        storytime = pCallback.m_hSteamLeaderboard;
        SteamAPICall_t h3 = SteamUserStats.FindLeaderboard("ENDLESSMODESCORE");

        m_findResult.Set(h3, EndlessScoreUpload);
    }
예제 #6
0
 private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
 {
     if (pCallback.m_bLeaderboardFound != 0)
     {
         m_SteamLeaderboard = pCallback.m_hSteamLeaderboard;
     }
 }
예제 #7
0
    static private void OnFindLeaderboardResult(LeaderboardFindResult_t pCallback, bool failure)
    {
        RawFuncs.Print("2. " + Time.time + " STEAM LEADERBOARDS: Found - " + pCallback.m_bLeaderboardFound + " leaderboardID - " + pCallback.m_hSteamLeaderboard.m_SteamLeaderboard);
        for (int i = 0; i < queue.Count; i++)
        {
            if (queue[i].open)
            {
                if (queue[i].waitingForRef && !queue[i].hasRef)
                {
                    queue[i].hasRef   = true;
                    queue[i].steamRef = pCallback.m_hSteamLeaderboard;
                }
                else
                {
                    //the open one isn't waiting/already has a ref, which means it's probably the wrong one?
                    //shoulnd't ever get here, but probably the packet got lost, then showed up later?

                    //just ignore this result

                    //(possibly kill this one, and add to it's timespent, as it might be better to move on?)
                }

                return;
            }
        }
        return;



        //RawFuncs.Print("" + Time.time + " STEAM LEADERBOARDS: Found - " + pCallback.m_bLeaderboardFound + " leaderboardID - " + pCallback.m_hSteamLeaderboard.m_SteamLeaderboard);
        //leaderboardSteamRefs[requestIndex] = pCallback.m_hSteamLeaderboard;
        //leaderboardFound[requestIndex] = true;
        //requestIndex++;
        //waiting = false;
    }
    private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool failure)
    {
        UnityEngine.Debug.Log("STEAM LEADERBOARDS: Found - " + pCallback.m_bLeaderboardFound + " leaderboardID - " + pCallback.m_hSteamLeaderboard.m_SteamLeaderboard);
        s_currentLeaderboard = pCallback.m_hSteamLeaderboard;
        s_initialized        = true;

        DownloadEntries();
    }
		// SteamAPICall_t
		public CallbackHandle FindOrCreateLeaderboard( string pchLeaderboardName /*const char **/, LeaderboardSortMethod eLeaderboardSortMethod /*ELeaderboardSortMethod*/, LeaderboardDisplayType eLeaderboardDisplayType /*ELeaderboardDisplayType*/, Action<LeaderboardFindResult_t, bool> CallbackFunction = null /*Action<LeaderboardFindResult_t, bool>*/ )
		{
			SteamAPICall_t callback = 0;
			callback = platform.ISteamUserStats_FindOrCreateLeaderboard( pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType );
			
			if ( CallbackFunction == null ) return null;
			
			return LeaderboardFindResult_t.CallResult( steamworks, callback, CallbackFunction );
		}
    private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
    {
        Debug.Log("[" + LeaderboardFindResult_t.k_iCallback + " - LeaderboardFindResult] - " + pCallback.m_hSteamLeaderboard + " -- " + pCallback.m_bLeaderboardFound);

        if (pCallback.m_bLeaderboardFound != 0)
        {
            m_SteamLeaderboard = pCallback.m_hSteamLeaderboard;
        }
    }
 private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
 {
     if (pCallback.m_bLeaderboardFound != 0)
     {
         this.m_SteamLeaderboard[(int)this.CurrentScoreToSubmit.Type] = pCallback.m_hSteamLeaderboard;
         SteamUserStats.UploadLeaderboardScore(this.m_SteamLeaderboard[(int)this.CurrentScoreToSubmit.Type], ELeaderboardUploadScoreMethod.k_ELeaderboardUploadScoreMethodForceUpdate, this.CurrentScoreToSubmit.Score.ToInt(), null, 0);
         this.IsSubmittingScore = false;
     }
 }
		// SteamAPICall_t
		public CallbackHandle FindLeaderboard( string pchLeaderboardName /*const char **/, Action<LeaderboardFindResult_t, bool> CallbackFunction = null /*Action<LeaderboardFindResult_t, bool>*/ )
		{
			SteamAPICall_t callback = 0;
			callback = platform.ISteamUserStats_FindLeaderboard( pchLeaderboardName );
			
			if ( CallbackFunction == null ) return null;
			
			return LeaderboardFindResult_t.CallResult( steamworks, callback, CallbackFunction );
		}
예제 #13
0
 public void FindResult(LeaderboardFindResult_t pCallback, bool bIOFailure, Action action)
 {
     if (pCallback.m_bLeaderboardFound != 1 || bIOFailure)
     {
         Debug.Log("There was an error retrieving the leaderboard.");
     }
     else
     {
         leaderboard_T = pCallback.m_hSteamLeaderboard;
         action.Invoke();
     }
 }
예제 #14
0
    /// <summary>
    /// Ons the leaderboard find result.
    /// </summary>
    /// <param name="pCallback">P callback.</param>
    /// <param name="bIOFailure">If set to <c>true</c> b IOFailure.</param>
    private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
    {
        if (pCallback.m_bLeaderboardFound != 0)
        {
            steamLeaderboard = pCallback.m_hSteamLeaderboard;
        }

        if (callBackFind != null)
        {
            callBackFind(pCallback);
        }
    }
예제 #15
0
 void OnLeaderboardFindResult(LeaderboardFindResult_t cb, bool IOFailure)
 {
     if (cb.m_bLeaderboardFound == 0 || IOFailure)
     {
         print("<Steamworks> Leader board could not be found");
         hasLeaderBoard = false;
     }
     else
     {
         leaderboard = cb.m_hSteamLeaderboard;
         DownloadGlobalScores(1, 100);
     }
 }
예제 #16
0
 private void OnFindLeaderboardResponse(LeaderboardFindResult_t callback, bool isFailure)
 {
     if (isFailure || callback.m_bLeaderboardFound != 1)
     {
         UnityEngine.Debug.LogError(string.Format("Leaderboard {0} is not found", LEADERBOARD_NAME));
     }
     else
     {
         UnityEngine.Debug.Log(string.Format("Leaderboard {0} found", LEADERBOARD_NAME));
         _leaderboardId = callback.m_hSteamLeaderboard;
         _isReady       = true;
     }
 }
예제 #17
0
 private void IniSteamLeaderboard(LeaderboardFindResult_t pCallback, bool bIOFailure)
 {
     if (pCallback.m_hSteamLeaderboard.m_SteamLeaderboard == 0 || bIOFailure)
     {
         Debug.Log("SteamLeaderboard_t Error");
     }
     else
     {
         Debug.Log("SteamLeaderboard_t OK");
         SteamLeaderboard  = pCallback;
         getterLeaderboard = true;
     }
 }
예제 #18
0
 private void OnLeaderBoardResults(LeaderboardFindResult_t pCallback, bool bIOFailure)
 {
     if (pCallback.m_bLeaderboardFound == 0 || bIOFailure)
     {
         Debug.Log("[LeaderBoard] There was an error finding leaderboard.");
     }
     else
     {
         hSteamLeaderboard = pCallback.m_hSteamLeaderboard;
         Debug.Log("[LeaderBoard] Leaderboard Found: " + hSteamLeaderboard);
         foundLeaderboard = true;
     }
 }
예제 #19
0
 private void OnLeaderboardFound(
     LeaderboardFindResult_t board,
     bool bIOFailure
     )
 {
     if (!bIOFailure && board.m_bLeaderboardFound > 0)
     {
         LeaderboardReader.Leaderboards.Add(
             latestKey,
             board.m_hSteamLeaderboard
             );
     }
     latestKey = null;
 }
        private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool failure, string findId)
        {
            // UnityEngine.Debug.Log("STEAM LEADERBOARDS: Found - " + pCallback.m_bLeaderboardFound + " leaderboardID - " + pCallback.m_hSteamLeaderboard.m_SteamLeaderboard);

            if (!failure && leaderbordsStatus.ContainsKey(findId))
            {
                leaderbordsStatus[findId] = pCallback.m_hSteamLeaderboard;

                if (leaderboardGetScoreQueue.IndexOf(findId) > -1)
                {
                    GetScore(findId);
                    leaderboardGetScoreQueue.Remove(findId);
                }
            }
        }
예제 #21
0
    //-------------------------------------------------------------------------------------------------------
    //---------------------------------------------私有------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------

    /// <summary>
    /// 创建排行榜回调
    /// </summary>
    /// <param name="itemResult"></param>
    /// <param name="bIOFailure"></param>
    private void OnLeaderboardCreateResult(LeaderboardFindResult_t itemResult, bool bIOFailure)
    {
        if (bIOFailure || itemResult.m_bLeaderboardFound == 0)
        {
            if (this.mCreateCallBack != null)
            {
                this.mCreateCallBack.CreateSteamLeaderboardFail(SteamLeaderboardFailEnum.CREATE_FAIL);
            }
            return;
        }
        if (this.mCreateCallBack != null)
        {
            this.mCreateCallBack.CreateSteamLeaderboardSuccess(itemResult.m_hSteamLeaderboard.m_SteamLeaderboard);
        }
    }
예제 #22
0
 /// <summary>
 /// 查询排行榜回调
 /// </summary>
 /// <param name="pCallback"></param>
 /// <param name="bIOFailure"></param>
 private void OnLeaderboardFindResult(LeaderboardFindResult_t itemResult, bool bIOFailure)
 {
     if (bIOFailure || itemResult.m_bLeaderboardFound == 0)
     {
         if (mFindCallBack != null)
         {
             mFindCallBack.FindLeaderboardFail(SteamLeaderboardFailEnum.FIND_FAIL);
         }
         return;
     }
     if (mFindCallBack != null)
     {
         mFindCallBack.FindLeaderboardSuccess(itemResult.m_hSteamLeaderboard.m_SteamLeaderboard);
     }
 }
    void OnFindLeaderboard(LeaderboardFindResult_t callback, bool ioFailure)
    {
        if (callback.m_bLeaderboardFound == 0 || ioFailure)
        {
            Debug.LogError("Leaderboard could not be found!");
            return;
        }
        else
        {
            Debug.Log("Leaderboard found: " + callback.m_hSteamLeaderboard);
        }

        currentLeaderboard = callback.m_hSteamLeaderboard;
        downloadInProgress = false;
    }
예제 #24
0
        private void OnLeaderboardFindResult(LeaderboardFindResult_t param, bool bIOFailure)
        {
            if (param.m_bLeaderboardFound == 0 || bIOFailure)
            {
                Debug.LogError("Failed to find leaderboard", this);
                return;
            }

            if (param.m_bLeaderboardFound != 0)
            {
                LeaderboardId = param.m_hSteamLeaderboard;
                BoardFound.Invoke();
                RefreshUserEntry();
            }
        }
예제 #25
0
    private int mFindDataType = 0;//0 自己 1所有

    /// <summary>
    /// 查询排行榜回调
    /// </summary>
    /// <param name="pCallback"></param>
    /// <param name="bIOFailure"></param>
    void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
    {
        if (pCallback.m_bLeaderboardFound != 0)
        {
            m_SteamLeaderboard = pCallback.m_hSteamLeaderboard;
            if (OnLeaderboardFindResultCallBack != null)
            {
                OnLeaderboardFindResultCallBack.leaderboradFindSuccess(m_SteamLeaderboard.m_SteamLeaderboard);
            }
        }
        else
        {
            OnLeaderboardFindResultCallBack.leaderboradFindFail("查询失败");
        }
    }
예제 #26
0
 private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
 {
     if (!SteamManager.Initialized)
     {
         return;
     }
     if (pCallback.m_hSteamLeaderboard.m_SteamLeaderboard == 0 || pCallback.m_bLeaderboardFound == 0)
     {
         Debug.LogError("There is no Leaderboard found");
     }
     else
     {
         m_steamLeaderboard = pCallback.m_hSteamLeaderboard;
         //UploadScore(PlayerControl.Ins.Award);
     }
 }
예제 #27
0
 private static void OnLeaderboardFound(
     LeaderboardFindResult_t board,
     bool bIOFailure
     )
 {
     if (!bIOFailure && board.m_bLeaderboardFound > 0)
     {
         Leaderboards.Add(readAction.ID.Key, board.m_hSteamLeaderboard);
         readAction.Leaderboard = board.m_hSteamLeaderboard;
         DownloadEntries();
     }
     else
     {
         readAction.IsCompleted = true;
     }
 }
        internal void OnBoardCreated(LeaderboardFindResult_t result, bool error)
        {
            if (error || (result.LeaderboardFound == 0))
            {
                IsError = true;
                return;
            }

            BoardId = result.SteamLeaderboard;

            if (IsValid)
            {
                Name         = client.native.userstats.GetLeaderboardName(BoardId);
                TotalEntries = client.native.userstats.GetLeaderboardEntryCount(BoardId);
            }
        }
예제 #29
0
    private void OnLeaderboardFindResult(LeaderboardFindResult_t pCallback, bool bIOFailure)
    {
        Debug.Log("[" + LeaderboardFindResult_t.k_iCallback + " - LeaderboardFindResult] - " + pCallback.m_hSteamLeaderboard + " -- " + pCallback.m_bLeaderboardFound);

        if (pCallback.m_bLeaderboardFound != 0)
        {
            m_SteamLeaderboard = pCallback.m_hSteamLeaderboard;
        }

        if (downloadEntries)
        {
            SteamAPICall_t downloadHandle = SteamUserStats.DownloadLeaderboardEntries(m_SteamLeaderboard, ELeaderboardDataRequest.k_ELeaderboardDataRequestGlobal, (int)downloadRange.x, (int)downloadRange.y);
            LeaderboardScoresDownloaded.Set(downloadHandle, OnLeaderboardScoresDownloaded);
            downloadEntries = false;
        }
    }
        // SteamAPICall_t
        public CallbackHandle FindLeaderboard(string pchLeaderboardName /*const char **/, Action <LeaderboardFindResult_t, bool> CallbackFunction = null /*Action<LeaderboardFindResult_t, bool>*/)
        {
            SteamAPICall_t callback = 0;

            callback = platform.ISteamUserStats_FindLeaderboard(Utility.GetUtf8Bytes(pchLeaderboardName));

            if (CallbackFunction == null)
            {
                return(null);
            }
            if (callback == 0)
            {
                return(null);
            }

            return(LeaderboardFindResult_t.CallResult(steamworks, callback, CallbackFunction));
        }