Example #1
0
        public List <Structs.PlayerList> GetPlayerList(int MaxResults, int StartIndex)
        {
            List <Structs.PlayerList> Result = new List <Structs.PlayerList>();

            GbxCall request = Client.Request("GetPlayerList", new object[] { MaxResults, StartIndex });

            GbxCall response = Client.GetResponse(request.Handle);

            if (response.Params.Count == 1 &&
                response.Params[0].GetType() == typeof(ArrayList))
            {
                foreach (Hashtable ht in (ArrayList)response.Params[0])
                {
                    Structs.PlayerList pl = new Structs.PlayerList();
                    pl.SpectatorStatus = (int)ht["SpectatorStatus"];
                    pl.Flags           = (int)ht["Flags"];
                    pl.LadderRanking   = (int)ht["LadderRanking"];
                    pl.PlayerId        = (int)ht["PlayerId"];
                    pl.TeamId          = (int)ht["TeamId"];
                    pl.Login           = (string)ht["Login"];
                    pl.Nickname        = (string)ht["NickName"];
                    Result.Add(pl);
                }
            }

            return(Result);
        }
        public List<Structs.PlayerList> GetPlayerList(int MaxResults, int StartIndex)
        {
            List<Structs.PlayerList> Result = new List<Structs.PlayerList>();

            GbxCall request = Client.Request("GetPlayerList", new object[] { MaxResults, StartIndex });

            GbxCall response = Client.GetResponse(request.Handle);

            if (response.Params.Count == 1 &&
                response.Params[0].GetType() == typeof(ArrayList))
            {
                foreach (Hashtable ht in (ArrayList)response.Params[0])
                {
                    Structs.PlayerList pl = new Structs.PlayerList();
                    pl.SpectatorStatus = (int)ht["SpectatorStatus"];
                    pl.Flags = (int)ht["Flags"];
                    pl.LadderRanking = (int)ht["LadderRanking"];
                    pl.PlayerId = (int)ht["PlayerId"];
                    pl.TeamId = (int)ht["TeamId"];
                    pl.Login = (string)ht["Login"];
                    pl.Nickname = (string)ht["NickName"];
                    Result.Add(pl);
                }
            }

            return Result;
        }