Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -12,12 +12,12 @@ import java.util.Arrays;
|
||||
public class Client implements Runnable {
|
||||
private final int port;
|
||||
private final String hostname;
|
||||
private boolean isConnected;
|
||||
private final ClientCallback callback;
|
||||
private Socket socket;
|
||||
private Thread receiveThread;
|
||||
private ClientCallback callback;
|
||||
private ObjectOutputStream outputStream;
|
||||
private Thread receiveThread;
|
||||
private boolean connecting;
|
||||
private boolean isConnected;
|
||||
|
||||
public Client(String hostname, ClientCallback callback) {
|
||||
this.port = Data.port();
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user