Ejemplo n.º 1
0
        private void Splash_Load(object sender, EventArgs e)
        {
            Interactive.STATUS = "Initialzing...";
            lblLoad.Text       = Interactive.STATUS;
            label3.Text        = "Version " + Application.ProductVersion;

            LIS = new LiveStart(bgWLoad);
            bgWLoad.RunWorkerAsync();
        }
Ejemplo n.º 2
0
        protected void ProcessNotice(string rawMessage)
        {
            var json = JObject.Parse(rawMessage);

            ReceiveNotice?.Invoke(this, new ReceiveNoticeEventArgs {
                RawMessage = rawMessage, JsonMessage = json
            });
            //Debug.WriteLine(rawMessage);
            switch (json["cmd"].ToString())
            {
            case "DANMU_MSG":
                var danmaku = new Model.Danmaku
                {
                    UserID         = json["info"][2][0].Value <int>(),
                    UserName       = json["info"][2][1].ToString(),
                    Text           = json["info"][1].ToString(),
                    IsAdmin        = json["info"][2][2].ToString() == "1",
                    IsVIP          = json["info"][2][3].ToString() == "1",
                    UserGuardLevel = json["info"][7].Value <int>()
                };
                ReceiveDanmaku?.Invoke(this, new ReceiveDanmakuEventArgs {
                    Danmaku = danmaku, JsonMessage = json, RawMessage = rawMessage
                });
                //Console.WriteLine($"{DateTime.Now:yyyy-MM-dd HH:mm:ss} [{RoomID}]-弹幕:{(danmaku.IsAdmin?"房":"")}{(danmaku.IsVIP?"爷":"")} {danmaku.UserName + ":"}{danmaku.Text}");
                break;

            case "SEND_GIFT":
                var gift = new Gift
                {
                    GiftName  = json["data"]["giftName"].ToString(),
                    UserName  = json["data"]["uname"].ToString(),
                    UserID    = json["data"]["uid"].ToObject <int>(),
                    GiftCount = json["data"]["num"].ToObject <int>()
                };
                ReceiveGift?.Invoke(this, new ReceiveGiftEventArgs {
                    Gift = gift, JsonMessage = json, RawMessage = rawMessage
                });
                break;

            case "ROOM_REAL_TIME_MESSAGE_UPDATE":
                break;

            case "INTERACT_WORD":
                //Console.WriteLine(rawMessage);

                break;

            case "ONLINERANK":
                break;

            case "LIVE":
                LiveStart?.Invoke(this, null);
                break;

            case "PREPARING":
                break;

            case "CUT":
                break;

            case "SEND_TOP":
                break;

            case "ROOM_RANK":
                break;
            }
        }
Ejemplo n.º 3
0
 private void bgWLoad_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
 {
     bgWLoad.Dispose();
     LIS = null;
     this.Hide();
 }