예제 #1
0
 public void connected(boolean isTcp) {
   this.isTcp = isTcp;
   if (!connected) {
     connected = true;
     game.connected();
   }
 }
예제 #2
0
 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);
 }
예제 #3
0
 public void makePlay(int player, int pos) {
   game.setLastPlay(1);
   game.makePlay(2, pos);
 }