Updating.
This commit is contained in:
parent
d5c8ba286a
commit
7723ca5bbb
2 changed files with 12 additions and 2 deletions
BIN
Client.class
BIN
Client.class
Binary file not shown.
14
Client.java
14
Client.java
|
@ -9,6 +9,7 @@ import java.io.BufferedReader;
|
|||
import java.io.InputStreamReader;
|
||||
import java.util.Scanner;
|
||||
import java.io.DataInputStream;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class Client {
|
||||
public static void main (String[] args) {
|
||||
|
@ -26,7 +27,7 @@ public class Client {
|
|||
String userInput;
|
||||
char[] b = new char[256];
|
||||
in.read(b, 0, 256);
|
||||
System.out.println("Response:\n" + b);
|
||||
System.out.println(b);
|
||||
|
||||
while((userInput = stdIn.readLine()) != null) {
|
||||
output.println(userInput);
|
||||
|
@ -34,9 +35,18 @@ public class Client {
|
|||
char[] buffer = new char[256];
|
||||
in.read(buffer, 0, 256);
|
||||
System.out.println(buffer);
|
||||
for(int i = 0; i < buffer.length - 10; ++i) {
|
||||
if(Arrays.copyOfRange(buffer, i, i+10).equals("GAME OVER")) {
|
||||
System.out.println("b");
|
||||
break;
|
||||
}
|
||||
}
|
||||
System.out.println("testing.");
|
||||
}
|
||||
|
||||
output.close();
|
||||
in.close();
|
||||
stdIn.close();
|
||||
echoSocket.close();
|
||||
}
|
||||
|
||||
catch (IOException e){
|
||||
|
|
Reference in a new issue