Added colors
This commit is contained in:
@@ -15,7 +15,7 @@ public class Client {
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
Client client = new Client(new InetSocketAddress("localhost", 6665));
|
||||
Client client = new Client(new InetSocketAddress("192.168.199.131", 6665));
|
||||
Scanner scanner = new Scanner(System.in);
|
||||
while(true) {
|
||||
String message = scanner.nextLine();
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.net.InetSocketAddress;
|
||||
import network.PacketHandler;
|
||||
import network.SocketReader;
|
||||
import network.SocketWriter;
|
||||
import network.protocol.ANSIColor;
|
||||
import network.protocol.Packet;
|
||||
import network.protocol.PacketVisitor;
|
||||
import network.protocol.packets.ChatMessagePacket;
|
||||
@@ -53,7 +54,7 @@ public class ClientConnexion implements PacketVisitor, PacketHandler{
|
||||
sb.append(" ");
|
||||
sb.append(packet.getChatter());
|
||||
sb.append(" : ");
|
||||
sb.append(packet.getContent());
|
||||
sb.append(ANSIColor.formatString(packet.getContent() + "&n")); // make the color back to normal at the end of every message
|
||||
System.out.println(sb);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user