Exemple #1
0
 public Cyvi(AoDisplay ad)
 {
     hpQueue = new BlockingCollection<string>();
     tkQueue = new BlockingCollection<string>();
     ctoken = new CancellationTokenSource();
     curToken = null;
     cvQueue = new BlockingCollection<string>();
     AD = ad;
 }
Exemple #2
0
 public Cyvi(AoDisplay ad, bool record)
 {
     //this.count = count;
     this.record = record;
     if (record)
     {
         Log = new Log(); Log.Start(312, true);
     }
     this.ad = ad;
     this.cvQueues = new Queue<string>();
     this.cinReqCount = 0;
     this.cinGate = false;
     this.hpQueues = new Queue<string>();
     cinListenThread = new Thread(() => Util.SafeExecute(() => CinListenStarts(),
         delegate(Exception e) { if (Log != null) { Log.Logger(e.ToString()); } }));
 }
Exemple #3
0
 public AoTV(AoDisplay ad)
 {
     AD = ad;
     Tuple = AD.Tuple;
 }
Exemple #4
0
 private void ButtonOKClick(object sender, RoutedEventArgs e)
 {
     string addr = addrTextBox.Text;
     if (LOCALHOST == addr)
         addr = "127.0.0.1";
     string nick = userTextBox.Text;
     int tick = -1;
     int nickIdx = nick.LastIndexOf('_');
     string nickPure;
     if (nickIdx > 0 && int.TryParse(nick.Substring(nickIdx + 1), out tick))
         nickPure = nick.Substring(0, nickIdx);
     else nickPure = nick;
     int ava = 0;
     if (IsRoomGained)
     {
         bool record = IsHallRecord;
         DecidedRoom = selectedRoom;
         //MessageBox.Show("Waiting!");
         return;
     }
     if (IsReplayMode)
     {
         AoDisplay a0d = new AoDisplay(VideoPathBox.Text);
         a0d.Show();
         this.Close();
     }
     else
     {
         // int ava = portial.GetUid();
         if (IsHallMode)
         {
             bool watch = IsHallWatched;
             bool record = IsHallRecord;
             bool resume = IsHallReconnect;
             bool msglog = true;
             int mode = IsHallSelModeEnabled ? SelMode : Base.Rules.RuleCode.DEF_CODE;
             //int pkg = GetPkgCode();
             int level = 0;
             if (IsHallLevelEnabled != false)
             {
                 if (PkgMode == 4 && LvTryTuxCheckBox.IsChecked == true) { PkgMode = 5; }
                 level = ((PkgMode << 1) | (LvTestCheckBox.IsChecked == true ? 1 : 0));
             }
             //int team = IsHallTeamEnabled ? HallTeamMode : Base.Rules.RuleCode.DEF_CODE;
             int team = Base.Rules.RuleCode.HOPE_IP; // set hope ip as the main rule
             string[] trainer = (LvTestCheckBox.IsChecked == true && LvRingText.Text.Length > 0) ?
                 LvRingText.Text.Split(',') : null;
             SaveToConfig("THEATER", SecertCodeDoor.Text, "IP", addrTextBox.Text, "NICK", nickPure,
                 "TICK", tick, "MODE", mode, "LEVEL", IsHallLevelEnabled != false ? PkgMode : 0,
                 "TEAM", team, "TRAINER", (LvTestCheckBox.IsChecked == true) ? LvRingText.Text : "");
             if (resume)
             {
                 int room;
                 if (!int.TryParse(roomInputTextBox.Text, out room))
                     room = 0;
                 AoDisplay a0d = new AoDisplay(nick, addr, room, record, msglog);
                 a0d.Show();
                 this.Close();
             }
             else if (!watch)
             {
                 AoDisplay a0d = new AoDisplay(addr, nick, ava, record, msglog, mode, level, trainer, team);
                 a0d.Show();
                 this.Close();
             }
             else
             {
                 int port = Base.NetworkCode.HALL_PORT;
                 zi = new ZI(nick, addr, port, record, this);
                 ziThread = new Thread(delegate ()
                 {
                     bool success = zi.StartWatchHall();
                     if (!success)
                     {
                         Dispatcher.BeginInvoke((Action)(() =>
                         {
                             Auxs.MessageHouse.Show("找不到远端服务器", addr + "对您一开始是拒绝的。");
                         }));
                     }
                 });
                 ziThread.Start();
                 IsRoomGained = true;
             }
         }
         else
         {
             bool watch = IsDirWatched;
             bool record = IsDirRecord;
             bool msglog = true;
             int room;
             if (!int.TryParse(DirRoomTextBox.Text, out room))
                 room = 0;
             int team = IsDirTeamEnabled ? DirTeamMode : 0;
             AoDisplay a0d = new AoDisplay(addr, nick, ava, watch, record, msglog, room, team);
             a0d.Show();
             this.Close();
         }
     }
 }