예제 #1
0
        public void LeaderboardRecordsListHaystack()
        {
            ManualResetEvent evt = new ManualResetEvent(false);
            INResultSet <INLeaderboardRecord> res = null;

            var message = new NLeaderboardRecordsListMessage.Builder(serverLeaderboardId)
                          .FilterByPagingToOwnerId(self.Id)
                          .Limit(20)
                          .Build();

            client.Send(message, (INResultSet <INLeaderboardRecord> results) =>
            {
                res = results;
                evt.Set();
            }, _ => {
                evt.Set();
            });

            evt.WaitOne(1000, false);
            Assert.IsNotNull(res);
            Assert.IsNotEmpty(res.Results);
            Assert.GreaterOrEqual(res.Results.Count, 1);
            Assert.IsNotEmpty(res.Results[0].Handle);
            Assert.Greater(res.Results[0].NumScore, 0);
        }
예제 #2
0
        public void LeaderboardRecordsList()
        {
            ManualResetEvent evt = new ManualResetEvent(false);
            INResultSet <INLeaderboardRecord> res = null;

            var message = new NLeaderboardRecordsListMessage.Builder(serverLeaderboardId)
                          .FilterByLocation("San Francisco")
                          .Build();

            client.Send(message, (INResultSet <INLeaderboardRecord> results) =>
            {
                res = results;
                evt.Set();
            }, _ => {
                evt.Set();
            });

            evt.WaitOne(1000, false);
            Assert.IsNotNull(res);
            Assert.IsNotEmpty(res.Results);
            Assert.GreaterOrEqual(res.Results.Count, 1);
            Assert.IsNotEmpty(res.Results[0].Handle);
            Assert.AreEqual(res.Results[0].Location, "San Francisco");
            Assert.Greater(res.Results[0].NumScore, 0);
        }