Beispiel #1
0
 public void serverConnect(Server s, Boolean isRightServer)
 {
     if (isRightServer)
     {
         RightServer      = s;
         RightServer.Win  = Win;
         RightServer.Side = 1;
         Win.setConnectionHandler(RightServer);
         RightServer.Connect();
     }
     else
     {
         LeftServer      = s;
         LeftServer.Win  = Win;
         LeftServer.Side = 0;
         Win.setConnectionHandler(LeftServer);
         LeftServer.Connect();
     }
 }
Beispiel #2
0
        public SkyWriter(string[] label, string text)
        {
            var server = Server.Connect(AppSettings.Get("ServerIp"), Convert.ToInt32(AppSettings.Get("ServerPort")),
                                        AppSettings.Get("Username"), AppSettings.Get("Password"));

            Console.WriteLine(DateTime.UtcNow.Ticks);
            ThreadPool.SetMaxThreads(50, 50);
            Task.Run(() => Console.WriteLine(DateTime.UtcNow.Ticks));
            Console.ReadKey();
            //////////////* skyWriter.Add(server[label[0]]);*/
            //skyWriter.AddRange(label.Select(l => server[l]));
            Console.WriteLine("STARTING");
            Text = text.ToLower();
            //  Console.ReadKey();
            skyWriter.AddRange(server.AllTurtles);
            for (int i = 0; i < skyWriter.Count; i++)
            {
                t.Add(new Thread(Turner));
                t[i].Start(i);
            }
            Console.ReadKey();
            //SortTurtles();
            //Fill();

            //t.Add(new Thread(writeLetter));
            //t.Add(new Thread(writeLetter1));
            //t.Add(new Thread(writeLetter2));
            //t.Add(new Thread(writeLetter3));
            //t.Add(new Thread(writeLetter4));

            //t.Add(new Thread(Turner));
            //t.Add(new Thread(Turner));
            //t.Add(new Thread(Turner));
            //t.Add(new Thread(Turner));
            //t.Add(new Thread(Turner));
            //t[0].Start(0);
            //t[1].Start(1);
            //t[2].Start(2);
            //t[3].Start(3);
            //t[4].Start(4);
            //
        }
Beispiel #3
0
 private void connect()
 {
     Server.Connect(txt_username.Text, txt_ipaddress.Text, (int)nud_port.Value, this);
     tabControl1.SelectedIndex = 1;
     ActiveControl             = rtb_send_message;
 }
 public void serverConnect(Server s, Boolean isRightServer)
 {
     if (isRightServer)
     {
         RightServer = s;
         RightServer.Win = Win;
         RightServer.Side = 1;
         Win.setConnectionHandler(RightServer);
         RightServer.Connect();
     }
     else
     {
         LeftServer = s;
         LeftServer.Win = Win;
         LeftServer.Side = 0;
         Win.setConnectionHandler(LeftServer);
         LeftServer.Connect();
     }
 }
Beispiel #5
0
 private void btn_connect_Click(object sender, EventArgs e)
 {
     Server.Connect(txt_username.Text, txt_ipaddress.Text, (int)nud_port.Value, this);
     tabControl1.SelectedIndex = 1;
 }