Removed Test Characters and cleaned Client

This commit is contained in:
MickWerf
2020-06-07 17:13:14 +02:00
parent 2283767c3d
commit d31a10971e
5 changed files with 3 additions and 38 deletions

View File

@@ -1,11 +0,0 @@
package netwerkprog.game.client.game.characters;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import netwerkprog.game.util.game.Faction;
import netwerkprog.game.util.game.GameCharacter;
public class DevTest1 extends GameCharacter {
public DevTest1() {
super("DevTest1", Faction.HACKER, new TextureRegion());
}
}

View File

@@ -1,10 +0,0 @@
package netwerkprog.game.client.game.characters;
import netwerkprog.game.util.game.Faction;
import netwerkprog.game.util.game.GameCharacter;
public class DevTest2 extends GameCharacter {
public DevTest2() {
super("DevTest2", Faction.MEGACORPORATION, null);
}
}

View File

@@ -1,10 +0,0 @@
package netwerkprog.game.client.game.characters;
import netwerkprog.game.util.game.Faction;
import netwerkprog.game.util.game.GameCharacter;
public class DevTest3 extends GameCharacter {
public DevTest3() {
super("DevTest3", Faction.AI, null);
}
}

View File

@@ -15,7 +15,7 @@ public class Client implements Runnable {
private boolean isConnected;
private Socket socket;
private Thread receiveThread;
private ClientCallback callback;
private final ClientCallback callback;
private ObjectOutputStream outputStream;
private boolean connecting;
@@ -67,8 +67,7 @@ public class Client implements Runnable {
public void register(ObjectInputStream in) {
while (connecting) {
String username = "DEV";
writeData(new ConnectionData("Connect", username));
writeData(new ConnectionData("Connect", "Request"));
try {
Object object = in.readObject();
if (object instanceof Data) {
@@ -128,9 +127,7 @@ public class Client implements Runnable {
} catch (InterruptedException e) {
e.printStackTrace();
}
writeData(new ConnectionData("Disconnect", "DEV"));
writeData(new ConnectionData("Disconnect", "Request"));
try {
this.socket.close();
} catch (IOException e) {

View File

@@ -41,7 +41,6 @@ public class ServerClient implements Runnable, DataSource {
while (this.isConnected) {
try {
Object object = this.in.readObject();
System.out.println("[SERVERCLIENT] got object " + object);
if (object instanceof Data) {
Data data = (Data) object;
if (data.getPayload() instanceof ConnectionData) {