Example #1
0
        public Player(string init, Constants.PlayerInitType type, bool minimal)
        {
            name   = string.Empty;
            id     = string.Empty;
            url    = string.Empty;
            link   = string.Empty;
            groups = new ArrayList( );
            groups.Clear( );

            if (type == Constants.PlayerInitType.playername)
            {
                name = init;
            }
            else if (type == Constants.PlayerInitType.playerid)
            {
                id   = init;
                link = "http://steamcommunity.com/profiles/" + id + "/?xml=1";
            }
            else if (type == Constants.PlayerInitType.playerurl)
            {
                url  = init;
                link = "http://steamcommunity.com/id/" + url + "/?xml=1";
            }
            else if (type == Constants.PlayerInitType.link)
            {
                string tmp = init;
                int    beg = tmp.IndexOf(".com/");
                if (beg != -1)
                {
                    beg += 5;
                    beg  = tmp.IndexOf("/", beg);
                    if (beg == -1)
                    {
                        beg = tmp.Length;
                    }
                    init = tmp.Substring(beg);
                }
                if (!init.Contains("?xml=1"))
                {
                    if ((init.Substring(init.Length - 1, 1)) == "/")
                    {
                        init = init + "?xml=1";
                    }
                    else
                    {
                        init = init + "/?xml=1";
                    }
                }
                link = init;
            }
            GetDetailsMinimal( );
        }
Example #2
0
 public void Init(string usr, Constants.PlayerInitType type)
 {
     player = new Player(usr, type);
     player.GetDetails();
 }