Added Client Flushing its own messages (work only in terminal)
This commit is contained in:
@@ -14,8 +14,10 @@ public class Client {
|
||||
private final ClientConnexion connexion;
|
||||
|
||||
public static void main(String[] args) {
|
||||
String host = "localhost";
|
||||
int port = 6665;
|
||||
try {
|
||||
Client client = new Client(new InetSocketAddress("192.168.199.131", 6665));
|
||||
Client client = new Client(new InetSocketAddress(host, port));
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
while(true) {
|
||||
String message = scanner.nextLine();
|
||||
|
||||
@@ -87,8 +87,6 @@ public class ClientConnexion implements PacketVisitor, PacketHandler{
|
||||
|
||||
@Override
|
||||
public void visitPacket(RoomListPacket packet) {
|
||||
// System.out.println("Handled room list !");
|
||||
// throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
|
||||
System.out.println("Rooms :");
|
||||
for (String room : packet.getRoomNames()) {
|
||||
System.out.println("\t" + room);
|
||||
|
||||
Reference in New Issue
Block a user