Skip to content
Snippets Groups Projects
Commit c86bbcca authored by Elrabu's avatar Elrabu
Browse files

Update: fixed spelling.

parent ff26037b
No related branches found
No related tags found
2 merge requests!35Update: Added more Stuff to be transported over the server.,!2Merge of Multiplayer Feature into development branch
......@@ -20,16 +20,17 @@ public class Client {
in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
}
public int sendMessage(int number) throws IOException {
public int sendX(int number) throws IOException {
out.println(number);
return number;
}
public int receiveInt() throws IOException {
String response = in.readLine();
return Integer.parseInt(response);
public int sendY(int number) throws IOException {
out.println(number);
return number;
}
public void stopConnection() throws IOException {
in.close();
out.close();
......
......@@ -9,9 +9,14 @@ public class ConnectionHandling {
Client client = new Client();
client.startConnection("localhost", 4444);
for (int i = 0; i < 10; i++){
int resp1 = client.sendMessage(1);
System.out.println(resp1);
int x = client.sendX(1);
System.out.println(x);
int y = client.sendX(0);
System.out.println(y);
TimeUnit.SECONDS.sleep(1);
}
}
}
......@@ -5,10 +5,12 @@ import java.io.*;
public class Server {
private ServerSocket serverSocket;
private static BufferedReader px;
private static BufferedReader py;
public static void main(String[] args) throws IOException {
Server server = new Server();
server.start("lolcalhost",4444);
server.start("localhost",4444);
}
public void start(String lolcalhost, int port) throws IOException {
......@@ -27,7 +29,7 @@ public class Server {
private Socket clientSocket;
private PrintWriter out;
private BufferedReader in;
private static BufferedReader px;
public EchoClientHandler(Socket socket) {
this.clientSocket = socket;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment