package ru.matevosyan.server;
import java.net.*;
import java.io.*;
public class BotServer {
    public static void main(String[] ar)    {
        int port = 19999;
        try {
            ServerSocket ss = new ServerSocket(port);
            System.out.println("Waiting for a client...");

            Socket socket = ss.accept();
            System.out.println("Got a client");
            System.out.println();

            try (InputStream sin = socket.getInputStream();
            OutputStream sout = socket.getOutputStream();

//            DataInputStream in = new DataInputStream(sin);
//            DataOutputStream out = new DataOutputStream(sout)) {

                 PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
                 BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()))) {

                String line = null;

                while(true) {
//                    line = in.readUTF();
                    line = in.readLine();
                    System.out.println("The dumb client just sent me this line : " + String.valueOf(line));
                    System.out.println("I'm sending it back...");
//                    out.writeUTF(line);
                    out.write(line);
                    out.flush();
                    System.out.println("Waiting for the next line...");
                    System.out.println();
                }

            } catch (IOException ioe) {
                ioe.getMessage();
            }

        } catch(Exception x) { x.printStackTrace(); }
    }
}
@@ -528,18 +528,16 @@
 eam();%0A%0A
-//
         
@@ -587,18 +587,16 @@
 m(sin);%0A
-//
         
@@ -649,24 +649,26 @@
 m(sout)) %7B%0A%0A
+//
             
@@ -735,24 +735,26 @@
 m(), true);%0A
+//
             
@@ -883,12 +883,10 @@
 e = 
-null
+%22%22
 ;%0A%0A 
@@ -910,18 +910,32 @@
 ile(
-true
+!line.equals(%22%D0%9F%D0%BE%D0%BA%D0%B0%22)
 ) %7B%0A
-//
     
@@ -967,24 +967,26 @@
 .readUTF();%0A
+//
             
@@ -1193,86 +1193,1192 @@
 %22);%0A
-//                    out.writeUTF(line);%0A                    out.write(line);
+                    //out.writeUTF(line);%0A//                    out.write(line);%0A%0A                    if (line.contains(%22Hello%22)) %7B%0A                        out.writeUTF(%22Hello my friend%22);%0A                    %7D else if (line.contains(%22How do you do%22)) %7B%0A                        out.writeUTF(%22Thank's, I'm good, and you?%22);%0A                    %7D else if (line.equals(%22Which poem did you like?%22)) %7B%0A                        out.writeUTF(%22I love %5C%22My Foolish Dog%5C%22%22);%0A                    %7D else if (line.equals(%22Can you send me?%22)) %7B%0A%0A                        out.writeUTF(%22%5Cn%5CnYes, you are welcome %5Cn%22 +%0A                                %22My dog is quite hip%5Cn%22 +%0A                                %22Except when he takes a dip%5Cn%22 +%0A                                %22He looks like a fool%5Cn%22 +%0A                                %22when he jumps in the pool%5Cn%22 +%0A                                %22and reminds me of a sinking ship%5Cn%22 +%0A                                %22%5Cn%22);%0A                    %7D else if (line.contains(%22%D0%9F%D0%BE%D0%BA%D0%B0%22)) %7B%0A                        line = %22%D0%9F%D0%BE%D0%BA%D0%B0%22;%0A                    %7D else %7B%0A                        out.writeUTF(%22What do you want. I don't understand you!%22);%0A                    %7D
 %0A   
@@ -2531,33 +2531,32 @@
               %7D%0A
-%0A
             %7D ca

add server