Removed all souts
This commit is contained in:
@@ -136,8 +136,6 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
TextureRegion[][] characters = TextureRegion.split(texture, 32, 32);
|
TextureRegion[][] characters = TextureRegion.split(texture, 32, 32);
|
||||||
this.team = new Team();
|
this.team = new Team();
|
||||||
this.enemyTeam = new Team();
|
this.enemyTeam = new Team();
|
||||||
|
|
||||||
System.out.println(this.chosenFaction);
|
|
||||||
for (int i = 1; i <= 5; i++) {
|
for (int i = 1; i <= 5; i++) {
|
||||||
GameCharacter temp = new Hacker("hacker" + i, characters[5][0], new BodySwap("test"));
|
GameCharacter temp = new Hacker("hacker" + i, characters[5][0], new BodySwap("test"));
|
||||||
mapRenderer.getGameTiles()[1][i].visit(temp);
|
mapRenderer.getGameTiles()[1][i].visit(temp);
|
||||||
@@ -176,7 +174,7 @@ public class MainGame extends Game implements ClientCallback {
|
|||||||
try {
|
try {
|
||||||
t.start();
|
t.start();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("There was an error connecting : " + e.getMessage());
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import java.io.IOException;
|
|||||||
import java.io.ObjectInputStream;
|
import java.io.ObjectInputStream;
|
||||||
import java.io.ObjectOutputStream;
|
import java.io.ObjectOutputStream;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
public class Client implements Runnable {
|
public class Client implements Runnable {
|
||||||
private final int port;
|
private final int port;
|
||||||
@@ -33,12 +32,10 @@ public class Client implements Runnable {
|
|||||||
this.connect();
|
this.connect();
|
||||||
try {
|
try {
|
||||||
if (this.receiveThread != null){
|
if (this.receiveThread != null){
|
||||||
System.out.println("[CLIENT RUN] starting receive thread");
|
|
||||||
this.receiveThread.start();
|
this.receiveThread.start();
|
||||||
}
|
}
|
||||||
else System.out.println("[CLIENT] couldnt connect to server, the receiving thread was null!");
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("[CLIENT] error connecting to server: " + e.getMessage() + ", cause: " + e.getCause().toString());
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -47,7 +44,6 @@ public class Client implements Runnable {
|
|||||||
* Connects the client to the server.
|
* Connects the client to the server.
|
||||||
*/
|
*/
|
||||||
public void connect() {
|
public void connect() {
|
||||||
System.out.println("[CLIENT] connecting to server on port " + this.port);
|
|
||||||
this.connecting = true;
|
this.connecting = true;
|
||||||
try {
|
try {
|
||||||
this.socket = new Socket(this.hostname, this.port);
|
this.socket = new Socket(this.hostname, this.port);
|
||||||
@@ -57,12 +53,8 @@ public class Client implements Runnable {
|
|||||||
this.receiveThread = new Thread(() -> receive(in));
|
this.receiveThread = new Thread(() -> receive(in));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
this.connecting = false;
|
this.connecting = false;
|
||||||
System.out.println("[CLIENT] there was an error connecting : " + e.getMessage());
|
e.printStackTrace();
|
||||||
StringBuilder sb = new StringBuilder(" Stacktrace : ");
|
|
||||||
Arrays.stream(e.getStackTrace()).forEach(n -> sb.append("\t\t").append(n).append("\n"));
|
|
||||||
System.out.println(sb.toString());
|
|
||||||
}
|
}
|
||||||
System.out.println("[CLIENT CONNECT] connected");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register(ObjectInputStream in) {
|
public void register(ObjectInputStream in) {
|
||||||
@@ -93,7 +85,6 @@ public class Client implements Runnable {
|
|||||||
*/
|
*/
|
||||||
public void writeData(Data data) {
|
public void writeData(Data data) {
|
||||||
try {
|
try {
|
||||||
System.out.println("[CLIENT] writing data " + data);
|
|
||||||
this.outputStream.writeObject(data);
|
this.outputStream.writeObject(data);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import netwerkprog.game.util.data.character.DamageData;
|
|||||||
import netwerkprog.game.util.data.character.MoveData;
|
import netwerkprog.game.util.data.character.MoveData;
|
||||||
import netwerkprog.game.util.data.connection.TeamData;
|
import netwerkprog.game.util.data.connection.TeamData;
|
||||||
import netwerkprog.game.util.game.Faction;
|
import netwerkprog.game.util.game.Faction;
|
||||||
import netwerkprog.game.util.game.GameCharacter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
@@ -118,12 +117,10 @@ public class GameInputProcessor implements InputProcessor {
|
|||||||
}
|
}
|
||||||
} else if (mainGame.getGamestate() == GAMESTATE.SELECTING_FACTION) {
|
} else if (mainGame.getGamestate() == GAMESTATE.SELECTING_FACTION) {
|
||||||
if (keycode == Input.Keys.NUM_1) {
|
if (keycode == Input.Keys.NUM_1) {
|
||||||
System.out.println("choosing mega");
|
|
||||||
mainGame.send(new TeamData(Faction.MEGACORPORATION, mainGame.getUsername()));
|
mainGame.send(new TeamData(Faction.MEGACORPORATION, mainGame.getUsername()));
|
||||||
mainGame.chooseMegaCorp();
|
mainGame.chooseMegaCorp();
|
||||||
}
|
}
|
||||||
if (keycode == Input.Keys.NUM_2) {
|
if (keycode == Input.Keys.NUM_2) {
|
||||||
System.out.println("choosing hacker");
|
|
||||||
mainGame.send(new TeamData(Faction.HACKER, mainGame.getUsername()));
|
mainGame.send(new TeamData(Faction.HACKER, mainGame.getUsername()));
|
||||||
mainGame.chooseHacker();
|
mainGame.chooseHacker();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,23 +128,17 @@ public class MapRenderer implements Renderable {
|
|||||||
GameTile cur = gameTileRow[col];
|
GameTile cur = gameTileRow[col];
|
||||||
//draw each tile
|
//draw each tile
|
||||||
batch.draw(cur.getTextureRegion(), cur.x, cur.y);
|
batch.draw(cur.getTextureRegion(), cur.x, cur.y);
|
||||||
|
|
||||||
if (cur.containsCharacter()) {
|
if (cur.containsCharacter()) {
|
||||||
//draw each character on a tile
|
//draw each character on a tile
|
||||||
GameCharacter character = cur.getCharacter();
|
GameCharacter character = cur.getCharacter();
|
||||||
|
|
||||||
if (!character.isDead()) {
|
if (!character.isDead()) {
|
||||||
batch.draw(character.getTextureRegion(), cur.x, cur.y);
|
batch.draw(character.getTextureRegion(), cur.x, cur.y);
|
||||||
|
|
||||||
//if he's showing an animation, draw the hitmarker.
|
//if he's showing an animation, draw the hitmarker.
|
||||||
if (character.isShowingAnimation())
|
if (character.isShowingAnimation())
|
||||||
batch.draw(hitMarker, cur.x, cur.y);
|
batch.draw(hitMarker, cur.x, cur.y);
|
||||||
|
|
||||||
// if hes selected, draw the green square
|
// if hes selected, draw the green square
|
||||||
if (cur.getCharacter().equals(mainGame.getSelectedCharacter()))
|
if (character.equals(mainGame.getSelectedCharacter()))
|
||||||
batch.draw(square, cur.x, cur.y);
|
batch.draw(square, cur.x, cur.y);
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// if hes dead, draw a tombstone
|
// if hes dead, draw a tombstone
|
||||||
batch.draw(tombStone, cur.x, cur.y);
|
batch.draw(tombStone, cur.x, cur.y);
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ public class SessionController implements DataCallback, Runnable {
|
|||||||
public void listen() {
|
public void listen() {
|
||||||
try {
|
try {
|
||||||
this.serverSocket = new ServerSocket(Data.port());
|
this.serverSocket = new ServerSocket(Data.port());
|
||||||
System.out.println("[SERVER] listening on port " + Data.port());
|
|
||||||
registerClient(serverSocket.accept());
|
registerClient(serverSocket.accept());
|
||||||
this.serverSocket.close();
|
this.serverSocket.close();
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
|||||||
@@ -69,8 +69,6 @@ public abstract class GameCharacter extends Actor implements Comparable<GameChar
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.damageAnimation = true;
|
this.damageAnimation = true;
|
||||||
|
|
||||||
System.out.println("OUCH character " + name + " was damaged for " + amount + ", animation: " + this.isShowingAnimation());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDead() {
|
public boolean isDead() {
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class TextRenderer implements Disposable {
|
|||||||
batch.dispose();
|
batch.dispose();
|
||||||
font.dispose();
|
font.dispose();
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
System.out.println("error: " + e.getMessage());
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ public class BST<E extends Comparable<E>> extends AbstractTree<E> {
|
|||||||
protected void inorder(TreeNode<E> root) {
|
protected void inorder(TreeNode<E> root) {
|
||||||
if (root == null) return;
|
if (root == null) return;
|
||||||
inorder(root.left);
|
inorder(root.left);
|
||||||
System.out.print(root.element + " ");
|
|
||||||
inorder(root.right);
|
inorder(root.right);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -152,7 +151,6 @@ public class BST<E extends Comparable<E>> extends AbstractTree<E> {
|
|||||||
if (root == null) return;
|
if (root == null) return;
|
||||||
postorder(root.left);
|
postorder(root.left);
|
||||||
postorder(root.right);
|
postorder(root.right);
|
||||||
System.out.print(root.element + " ");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -168,7 +166,6 @@ public class BST<E extends Comparable<E>> extends AbstractTree<E> {
|
|||||||
*/
|
*/
|
||||||
protected void preorder(TreeNode<E> root) {
|
protected void preorder(TreeNode<E> root) {
|
||||||
if (root == null) return;
|
if (root == null) return;
|
||||||
System.out.print(root.element + " ");
|
|
||||||
preorder(root.left);
|
preorder(root.left);
|
||||||
preorder(root.right);
|
preorder(root.right);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ public class RestartSessionControllerTest {
|
|||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
System.out.println(sessionThread.getState());
|
|
||||||
sessionThread = new Thread(sessionController);
|
sessionThread = new Thread(sessionController);
|
||||||
sessionThread.start();
|
sessionThread.start();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user