public void endChat() { com.closeConnection(); System.out.println("\nLog"); System.out.println("-----------------------------------------------"); session.printLog(); System.exit(1); }
public void readMessage() { JPacket packet = com.receiveMessage(); if (packet.jmsg.msg.equals("End Chat")) { endChat(); System.out.println("Chat Over"); } else { logMessage(packet, "OtherGuy"); System.out.println("OtherGuy: " + packet.jmsg.msg); } }
public void sendMessage() throws Exception { String userInput; userInput = console.readLine(); JPacket packet = new JPacket(userInput); com.sendMessage(packet); if (userInput.equals("End Chat")) { endChat(); System.out.println("Chat Over"); } else logMessage(packet, "You"); }