Beispiel #1
0
 internal Comment(int time, CommentTargets target, string format, string comment)
 {
     this.time   = time;
     this.target = target;
     this.format = format;
     this.text   = comment;
 }
        private void increaseCount(CommentTargets commentTarget)
        {
            switch (commentTarget)
            {
            case CommentTargets.Map:
                totalM++;
                break;

            case CommentTargets.Replay:
                totalR++;
                break;

            case CommentTargets.Song:
                totalS++;
                break;
            }
        }
        void comment_IncomingCommentInfo(pWebRequest r, Exception e)
        {
            if (e != null)
            {
                return;
            }

            GameBase.Scheduler.Add(delegate
            {
                if (processed < 0)
                {
                    foreach (string line in r.ResponseString.Split('\n'))
                    {
                        if (line.Length == 0)
                        {
                            continue;
                        }

                        string[] split = line.Split('\t');
                        if (split.Length < 4)
                        {
                            continue;
                        }
                        int time;
                        Int32.TryParse(split[0], System.Globalization.NumberStyles.Integer, GameBase.nfi, out time);
                        if (time == 0)
                        {
                            continue;
                        }
                        CommentTargets target = (CommentTargets)Enum.Parse(typeof(CommentTargets), split[1], true);
                        string formatString   = split[2];
                        string comment        = split[3];
                        comments.AddInPlace(new Comment(time, target, formatString, comment));
                    }

                    processed = 0;

                    GameBase.Scheduler.Add(processComments, true);
                }
            });
        }