public void connected(boolean isTcp) { this.isTcp = isTcp; if (!connected) { connected = true; game.connected(); } }
public Sender(TicTacToe t) { game = t; tcpPort = (int) (Math.random() * 100 + 1000); System.out.println("porta tcp: " + tcpPort); udpPort = (int) (Math.random() * 100 + 1000); System.out.println("porta udp: " + udpPort); game.createDialog("TCP: " + tcpPort + "\nUDP: " + udpPort, "Escutando nas portas"); tcp = new TcpServer(this, tcpPort); udp = new UdpServer(this, udpPort); }
public void makePlay(int player, int pos) { game.setLastPlay(1); game.makePlay(2, pos); }