Exemplo n.º 1
0
        private void socketButton_Click(object sender, EventArgs e)
        {
            Initialise.SetVisibilityEnable(ref startButton, false);
            Initialise.SetVisibilityEnable(ref loadButton, false);
            Initialise.SetVisibilityEnable(ref socketButton, false);
            Initialise.SetVisibilityEnable(ref exit, false);
            buttonClient.Text = "Start Client";
            buttonHost.Text   = "Start Host";
            Initialise.SetVisibilityEnable(ref buttonHost, true);
            Initialise.SetVisibilityEnable(ref buttonClient, true);
            online = true;


            ipLabel.Text = "Yours DNS: " + SocketConnect.serverIp;
            //iphost.MapToIPv4().ToString() +
            ipLabel.Location = new Point(200, 100);
            ipLabel.Size     = new Size(200, 50);
            ipLabel.Enabled  = true;
            ipLabel.Visible  = true;
            this.Controls.Add(ipLabel);

            secondIP.Location = new Point(200, 150);
            ipLabel.Size      = new Size(200, 50);
            secondIP.Text     = "Insert DNS";
            secondIP.Enabled  = true;
            secondIP.Visible  = true;
            this.Controls.Add(secondIP);
        }
Exemplo n.º 2
0
 private void loadButton_Click(object sender, EventArgs e)
 {
     Initialise.SetVisibilityEnable(ref startButton, false);
     Initialise.SetVisibilityEnable(ref loadButton, false);
     Initialise.SetVisibilityEnable(ref socketButton, false);
     LoadGame(new Point(2, 2), new Point(452, 452));
 }
Exemplo n.º 3
0
        private void buttonClient_Click(object sender, EventArgs e)
        {
            SocketConnect.HostClientStart(8181, 8080, false);

            Initialise.SetVisibilityEnable(ref buttonHost, false);
            Initialise.SetVisibilityEnable(ref buttonClient, false);

            startButton.Text = "Start when both players ready";
            Initialise.SetVisibilityEnable(ref startButton, true);
        }
Exemplo n.º 4
0
 private void startButton_Click(object sender, EventArgs e)
 {
     Initialise.SetVisibilityEnable(ref startButton, false);
     Initialise.SetVisibilityEnable(ref loadButton, false);
     Initialise.SetVisibilityEnable(ref socketButton, false);
     Initialise.SetVisibilityEnable(ref exit, false);
     if (online == true)
     {
         timerHost.Enabled = true;
         timerSend.Enabled = true;
     }
     disconect = false;
     StartGame();
 }
Exemplo n.º 5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Initialise.SetLocationAndSize(ref startButton, new Point(200, 200), new Size(150, 70));
            startButton.Text = "Start Local";
            Initialise.SetVisibilityEnable(ref startButton, true);

            Initialise.SetLocationAndSize(ref socketButton, new Point(200, 300), new Size(150, 70));
            socketButton.Text = "Start Online";
            Initialise.SetVisibilityEnable(ref socketButton, true);

            Initialise.SetLocationAndSize(ref loadButton, new Point(200, 400), new Size(150, 50));
            loadButton.Text = "Load";
            Initialise.SetVisibilityEnable(ref loadButton, false);

            Initialise.SetLocationAndSize(ref exit, new Point(200, 450), new Size(150, 50));
            exit.Text = "Exit";
            Initialise.SetVisibilityEnable(ref exit, true);
        }