8485868788899091929394
// send message // every 20 tick if (i++ % 20 == 0 && i < 100) { try { System.out.println("sending packet to server"); client.sendPacket(new NetworkMessage( "Client said Yes or No")); } catch (IOException ex) { ex.printStackTrace();
919293949596979899100101
System.exit(0); } // send the client nick name try { client.sendPacket(new NetworkMessage(nick)); } catch (IOException ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(null, "Connection Failed.\n"
5859606162636465666768
bsClient.update(100); // the main work // send packet to server // every 50 tick if (++sendCounter % 50 == 0) { bsClient.sendPacket(new AllFieldTypePacket()); } // disconnect from server // after 200 tick if (sendCounter > 200) {