示例#1
0
        public LeaderboardEntry GetLeaderboard(LeaderboardIdentity leaderboardId)
        {
            // FIXME: Should we just magically have leaderboards by this point? -flibit
            if (!LeaderboardReader.Leaderboards.ContainsKey(leaderboardId.Key))
            {
                latestKey = leaderboardId.Key;
                SteamAPICall_t call = SteamUserStats.FindLeaderboard(leaderboardId.Key);
                if (call.m_SteamAPICall != 0)
                {
                    CallResult <LeaderboardFindResult_t> foundLeaderboard;
                    foundLeaderboard = new CallResult <LeaderboardFindResult_t>();
                    foundLeaderboard.Set(
                        call,
                        OnLeaderboardFound
                        );
                    while (GamerServicesDispatcher.UpdateAsync())
                    {
                        if (string.IsNullOrEmpty(latestKey))
                        {
                            break;
                        }
                    }
                }
            }

            // FIXME: Do these other parameters even matter? -flibit
            return(new LeaderboardEntry(
                       null,
                       0,
                       0,
                       LeaderboardReader.Leaderboards[leaderboardId.Key]
                       ));
        }
示例#2
0
        public static LeaderboardReader Read(
            LeaderboardIdentity leaderboardId,
            IEnumerable <Gamer> gamers,
            Gamer pivotGamer,
            int pageSize
            )
        {
            IAsyncResult result = BeginRead(
                leaderboardId,
                gamers,
                pivotGamer,
                pageSize,
                null,
                null
                );

            while (!result.IsCompleted)
            {
                if (!GamerServicesDispatcher.UpdateAsync())
                {
                    // readAction.IsCompleted = true;
                }
            }
            return(EndRead(result));
        }
示例#3
0
 public static IAsyncResult BeginRead(
     LeaderboardIdentity leaderboardId,
     IEnumerable <Gamer> gamers,
     Gamer pivotGamer,
     int pageSize,
     AsyncCallback callback,
     object asyncState
     )
 {
     readAction = new LeaderboardReaderAction(
         asyncState,
         callback,
         leaderboardId,
         0,
         pageSize,
         pivotGamer,
         gamers
         );
     if (readAction.Leaderboard.m_SteamLeaderboard == 0)
     {
         FindLeaderboard(leaderboardId.Key);
     }
     else
     {
         DownloadEntries();
     }
     return(readAction);
 }
示例#4
0
 public static IAsyncResult BeginRead(
     LeaderboardIdentity leaderboardId,
     int pageStart,
     int pageSize,
     AsyncCallback callback,
     object asyncState
     )
 {
     readAction = new LeaderboardReaderAction(
         asyncState,
         callback,
         leaderboardId,
         pageStart,
         pageSize,
         null,
         null
         );
     if (readAction.Leaderboard.m_SteamLeaderboard == 0)
     {
         FindLeaderboard(leaderboardId.Key);
     }
     else
     {
         DownloadEntries();
     }
     return(readAction);
 }
示例#5
0
        internal LeaderboardReader(
            LeaderboardIdentity identity,
            int start,
            int size,
            SteamLeaderboard_t board,
            List <LeaderboardEntry> entries,
            bool friends
            )
        {
            LeaderboardIdentity  = identity;
            PageStart            = start;
            pageSize             = size;
            leaderboard          = board;
            TotalLeaderboardSize = SteamUserStats.GetLeaderboardEntryCount(leaderboard);
            isFriendBoard        = friends;

            entryCache   = entries;
            this.entries = new List <LeaderboardEntry>(pageSize);
            for (int i = PageStart; i < pageSize && i < entryCache.Count; i += 1)
            {
                this.entries.Add(entryCache[i]);
            }

            IsDisposed = false;
        }
示例#6
0
 public static IAsyncResult BeginRead(
     LeaderboardIdentity leaderboardId,
     Gamer pivotGamer,
     int pageSize,
     AsyncCallback callback,
     object asyncState
     )
 {
     throw new NotSupportedException();
 }
示例#7
0
        public static LeaderboardReader Read(
            LeaderboardIdentity leaderboardId,
            int pageStart,
            int pageSize
            )
        {
            IAsyncResult result = BeginRead(
                leaderboardId,
                pageStart,
                pageSize,
                null,
                null
                );

            while (!result.IsCompleted)
            {
                if (!GamerServicesDispatcher.UpdateAsync())
                {
                    readAction.IsCompleted = true;
                }
            }
            return(EndRead(result));
        }
示例#8
0
            public LeaderboardReaderAction(
                object state,
                AsyncCallback callback,
                LeaderboardIdentity identity,
                int start,
                int size,
                Gamer pivot,
                IEnumerable <Gamer> gamers
                )
            {
                AsyncState      = state;
                Callback        = callback;
                IsCompleted     = false;
                AsyncWaitHandle = new ManualResetEvent(true);

                ID         = identity;
                PageStart  = start;
                PageSize   = size;
                PivotGamer = pivot;
                Gamers     = gamers;

                Leaderboards.TryGetValue(ID.Key, out Leaderboard);
            }
示例#9
0
 internal LeaderboardEntry GetLeaderboard(LeaderboardIdentity leaderboardIdentity)
 {
     throw new NotImplementedException();
 }
 public LeaderboardEntry GetLeaderboard(LeaderboardIdentity aLeaderboardIdentity)
 {
     throw new NotImplementedException();
 }
示例#11
0
 public LeaderboardEntry GetLeaderboard(LeaderboardIdentity aLeaderboardIdentity)
 {
     throw new NotImplementedException ();
 }
示例#12
0
 public static void BeginRead (LeaderboardIdentity id, SignedInGamer gamer, int leaderboardPageSize, AsyncCallback leaderboardReadCallback, SignedInGamer gamer2)
 {
     throw new NotImplementedException ();
 }
示例#13
0
 public static void BeginRead(LeaderboardIdentity id, SignedInGamer gamer, int leaderboardPageSize, AsyncCallback leaderboardReadCallback, SignedInGamer gamer2)
 {
     throw new NotImplementedException();
 }