예제 #1
0
      public void EnterRoom(ref RichTextBox t, int mode, string username, string password, int rid, int rpassword, ref WatchStream w, int privacy)
      {
          textb = t;

          this.w = w;
          if (mode == 1)
          {
              byte[] bytes = Socket.ApplyConnection(username, password, 1, rid, rpassword);
              string info  = Encoding.ASCII.GetString(bytes);
              if (info == "1")
              {
                  w.Show();
                  StartRecieving(ref t);
                  isCapturing = true;
                  MessageBox.Show("Successfully Entered Room");
                  Sending = new Thread(SendText);
                  Sending.Start();
                  sending = false;
              }
              else
              {
                  w.Close();
                  w.d.Show();
                  isCapturing = false;
                  MessageBox.Show("Incorrect Room ID or Password");
              }
          }
          else
          {
              byte[]   roomInfo = Socket.ApplyConnection(username, password, 0, privacy);
              string   info     = Encoding.ASCII.GetString(roomInfo);
              string[] data     = info.Split(',');
              StartRecieving(ref t);
          }
      }
예제 #2
0
      public void JoinPublicRoom(ref RichTextBox t, int mode, string username, string password, ref WatchStream w)
      {
          textb  = t;
          this.w = w;

          byte[] bytes = Socket.ApplyConnection(username, password, mode);

          string info = Encoding.ASCII.GetString(bytes);

          if (info == "1")
          {
              isCapturing = true;
              w.Show();
              StartRecieving(ref t);


              MessageBox.Show("Successfully Entered Room");
              Sending = new Thread(SendText);
              Sending.Start();
              sending = false;
          }
          else
          {
              w.Close();
              w.d.Show();

              MessageBox.Show("Cannot Find Public Room right now, try again later");
          }
      }
예제 #3
0
 void UpdateUI(WatchStream t)
 {
     if (t.InvokeRequired)
     {
         var d = new UpdateGUIdel3(UpdateUI);
         t.Invoke(d, new object[] { t });
     }
     else
     {
         t.d.Show();
         t.Close();
     }
 }