Beispiel #1
0
        public override string GetStats(string password)
        {
            string result = null;

            try
            {
                if (password == null)
                {
                    password = this.AdminUsername + ":" + this.AdminPassword;
                }
                else if (password.IndexOf(':') < 0)
                {
                    password = this.AdminUsername + ":" + password;
                }
                if (base.UseBASS && this.IsConnected)
                {
                    result = BassEnc.BASS_Encode_CastGetStats(base.Encoder.EncoderHandle, BASSEncodeStats.BASS_ENCODE_STATS_ICESERV, password);
                }
                else
                {
                    result = this.ICEcastGetStats(password, BASSEncodeStats.BASS_ENCODE_STATS_ICESERV);
                }
            }
            catch
            {
                result = null;
            }
            return(result);
        }
Beispiel #2
0
        public override int GetListeners(string password)
        {
            int result = -1;

            try
            {
                if (password == null)
                {
                    password = this.AdminUsername + ":" + this.AdminPassword;
                }
                else if (password.IndexOf(':') < 0)
                {
                    password = this.AdminUsername + ":" + password;
                }
                string text;
                if (base.UseBASS && this.IsConnected)
                {
                    text = BassEnc.BASS_Encode_CastGetStats(base.Encoder.EncoderHandle, BASSEncodeStats.BASS_ENCODE_STATS_ICE, password);
                }
                else
                {
                    text = this.ICEcastGetStats(password, BASSEncodeStats.BASS_ENCODE_STATS_ICE);
                }
                if (text != null)
                {
                    int num  = text.ToUpper().IndexOf("<LISTENERS>");
                    int num2 = text.ToUpper().IndexOf("</LISTENERS>");
                    if (num > 0 && num2 > 0)
                    {
                        num   += 11;
                        result = int.Parse(text.Substring(num, num2 - num));
                    }
                }
            }
            catch
            {
                result = -1;
            }
            return(result);
        }