Beispiel #1
0
 public void dm_get(EnumCommentType dm_type, string name, string msg)
 {
     try
     {
         if (dm_type == EnumCommentType.HEART)
         {
             label1.Text = "Watching Now: " + msg;
             statistic(dm_type, msg);
         }
         else if (dm_type == EnumCommentType.GIFT)
         {
             richTextBox1.AppendText("recevie gift: " + name + msg + "\n");
             dm_gift_add_to_list(name, msg);
         }
         else if (dm_type == EnumCommentType.WELCOME)
         {
             //Console.WriteLine("Vip: " + name + "\n");
             richTextBox1.AppendText("VIP: " + name + "\n");
         }
         else if (dm_type == EnumCommentType.MSG)
         {
             //Console.WriteLine("MSG: " + name + "说: " + msg + "\n");
             richTextBox1.AppendText("MSG: " + name + " said : " + msg + "\n");
             statistic(dm_type, name);
         }
         else if (dm_type == EnumCommentType.DEBUG)
         {
             richTextBox1.AppendText(msg + "\n");
         }
         Object obj = null;
         FormUtil.formManager.TryGetValue("slider", out obj);
         if (obj != null)
         {
             BubbleSilder.MainWindow slider = (BubbleSilder.MainWindow)obj;
             if (dm_type == EnumCommentType.WELCOME && checkBox3.Checked == false)
             {
                 return;
             }
             else if (dm_type == EnumCommentType.GIFT && checkBox2.Checked == false)
             {
                 return;
             }
             else
             {
                 slider.GetDANMU(dm_type, name, msg);
             }
         }
     }
     catch
     {
         Console.WriteLine("failed to dm_get()");
     }
 }
Beispiel #2
0
        private void statistic(EnumCommentType dm_type, string name)
        {
            return;

            if (dm_type == EnumCommentType.HEART)
            {
                if (Convert.ToInt32(name) > speaker_dm.max_audience)
                {
                    speaker_dm.max_audience = Convert.ToInt32(name);
                }
                return;
            }
            else
            {
                //统计弹幕 发言人,弹幕数量
                if (speaker_dm.namelist.Contains(name) == false)
                {
                    speaker_dm.namelist.Add(name);
                    speaker_dm.speaker_count++;
                }
                speaker_dm.dm_count++;
            }
        }
Beispiel #3
0
 public void dm_invoke(EnumCommentType dm_type, string name, string msg)
 {
     this.Invoke(new dm_delegate(dm_get), dm_type, name, msg);
 }