Exemple #1
0
 // Faz a conexão como servidor
 private void ConectarComoServidor(string ip, int port)
 {
     gs = new GerenciadorSocket(ip, port);
     if (gs.IniciarComoServidor(ref status))
     {
         ComecarJogo();
     }
 }
Exemple #2
0
 // Faz a conexão como cliente
 private void ConectarComoCliente(string ip, int port)
 {
     gs = new GerenciadorSocket(ip, port);
     if (gs.IniciarComoCliente())
     {
         ComecarJogo();
     }
 }
Exemple #3
0
        public FormJogo(FormPrincipal principal, bool ehServidor, GerenciadorSocket gs)
        {
            // O servidor sempre começa o jogo
            this.ehMeuTurno = ehServidor;
            this.Principal  = principal;
            this.ehServidor = ehServidor;

            InitializeComponent();

            if (ehServidor)
            {
                this.Text = "Jogo da Velha | Servidor";
                this.SetDesktopLocation(250, 200);
            }
            else
            {
                this.Text = "Jogo da Velha | Cliente";
                this.SetDesktopLocation(700, 200);
            }

            this.gs = gs;
        }