Beispiel #1
0
 public ClientThread(TcpClient tcpClient, ClientClass client)
 {
     TcpClient   = tcpClient;
     this.reader = new StreamReader(tcpClient.GetStream(), Encoding.ASCII);
     this.writer = new StreamWriter(tcpClient.GetStream(), Encoding.ASCII);
     this.client = client;
 }
Beispiel #2
0
 public GameForm(ClientClass client, string name)
 {
     DoubleBuffered = true;
     this.name      = name.Remove(0, 9).Replace(System.Environment.NewLine, "");
     this.client    = client;
     StartGame();
     this.LabelPlayerNumber.Text += "2";
 }
Beispiel #3
0
        private void buttonConnect_Click(object sender, EventArgs e)
        {
            client = new TcpClient(textBoxIP.Text, int.Parse(textBoxPort.Text));
            ClientClass tcpclient = new ClientClass(client);
            Form        z         = new NewGame(false, naam, tcpclient, this, textBoxIP.Text, textBoxPort.Text);

            z.Show();
            this.Hide();
        }
Beispiel #4
0
        public NewGame(bool isHost, string name, ClientClass client, Form oldForm, string ip, string port)
        {
            Player2 = name;

            this.Name    = "Load game";
            this.oldForm = oldForm;
            this.isHost  = isHost;
            this.client  = client;
            this.ip      = ip;
            this.port    = port;

            InitializeComponent();
            this.button_Start.Hide();
            this.label_Player2.Text += Player2;
            label_PlayerOne.Text    += Player1;

            //Packet_NameMessage temp1 = (Packet_NameMessage)client.received;
            //label_PlayerOne.Text += temp1.message;
        }
Beispiel #5
0
 public OpponentForm(ClientClass client, GameForm form)
 {
     this.form   = form;
     this.client = client;
     StartGame();
 }