mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 22:38:43 +00:00
Minor bug fixes.
Server will now only save incoming connections if in lobbying mode as it should Commented out boat status printing tags: #story[1047]
This commit is contained in:
@@ -136,13 +136,7 @@ public class GameState implements Runnable {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println("-----------------------");
|
// printBoatStatus(playerYacht);
|
||||||
System.out.println("Sails are in: " + playerYacht.getSailIn());
|
|
||||||
System.out.println("Heading: " + playerYacht.getHeading());
|
|
||||||
System.out.println("Velocity: " + playerYacht.getVelocityMMS() / 1000);
|
|
||||||
System.out.println("Lat: " + playerYacht.getLocation().getLat());
|
|
||||||
System.out.println("Lng: " + playerYacht.getLocation().getLng());
|
|
||||||
System.out.println("-----------------------\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void update() {
|
public static void update() {
|
||||||
@@ -186,4 +180,14 @@ public class GameState implements Runnable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void printBoatStatus(Yacht playerYacht) {
|
||||||
|
System.out.println("-----------------------");
|
||||||
|
System.out.println("Sails are in: " + playerYacht.getSailIn());
|
||||||
|
System.out.println("Heading: " + playerYacht.getHeading());
|
||||||
|
System.out.println("Velocity: " + playerYacht.getVelocityMMS() / 1000);
|
||||||
|
System.out.println("Lat: " + playerYacht.getLocation().getLat());
|
||||||
|
System.out.println("Lng: " + playerYacht.getLocation().getLng());
|
||||||
|
System.out.println("-----------------------\n");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,9 +27,11 @@ public class ServerListenThread extends Thread{
|
|||||||
private void acceptConnection() {
|
private void acceptConnection() {
|
||||||
try {
|
try {
|
||||||
Socket thisClient = serverSocket.accept();
|
Socket thisClient = serverSocket.accept();
|
||||||
if (thisClient != null){
|
if (thisClient != null && GameState.getCurrentStage().equals(GameStages.LOBBYING)) {
|
||||||
ServerToClientThread thisConnection = new ServerToClientThread(thisClient);
|
ServerToClientThread thisConnection = new ServerToClientThread(thisClient);
|
||||||
delegate.clientConnected(thisConnection);
|
delegate.clientConnected(thisConnection);
|
||||||
|
} else {
|
||||||
|
thisClient.close();
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.getMessage();
|
e.getMessage();
|
||||||
|
|||||||
Reference in New Issue
Block a user