mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed disconnection issues. Fix is only temporary until a consistent interface for disconnections exists.
#bug #implement
This commit is contained in:
@@ -423,7 +423,6 @@ public class GameState implements Runnable {
|
||||
private void checkForLegProgression(ServerYacht yacht) {
|
||||
Integer currentMarkSeqID = yacht.getCurrentMarkSeqID();
|
||||
CompoundMark currentMark = markOrder.getCurrentMark(currentMarkSeqID);
|
||||
// System.out.println(yacht.getCurrentMarkSeqID());
|
||||
|
||||
Boolean hasProgressed;
|
||||
if (currentMarkSeqID == 0) {
|
||||
|
||||
@@ -192,7 +192,6 @@ public class ServerToClientThread implements Runnable, Observer {
|
||||
long computedCrc = checksum.getValue();
|
||||
long packetCrc = Message.bytesToLong(getBytes(4));
|
||||
if (computedCrc == packetCrc) {
|
||||
//System.out.println("RECEIVED A PACKET");
|
||||
switch (PacketType.assignPacketType(type, payload)) {
|
||||
case BOAT_ACTION:
|
||||
BoatAction actionType = ServerPacketParser
|
||||
@@ -229,7 +228,11 @@ public class ServerToClientThread implements Runnable, Observer {
|
||||
}
|
||||
|
||||
//@TODO calculate lat/lng values
|
||||
xml.setRegatta(new Regatta("Party Parrot Test Server", "Bermuda Test Course", 57.6679590, 11.8503233));
|
||||
xml.setRegatta(
|
||||
new Regatta(
|
||||
"Party Parrot Test Server", "Bermuda Test Course",
|
||||
57.6679590, 11.8503233)
|
||||
);
|
||||
xml.setRace(race);
|
||||
|
||||
XMLMessage xmlMessage;
|
||||
@@ -289,8 +292,7 @@ public class ServerToClientThread implements Runnable, Observer {
|
||||
try {
|
||||
os.write(message.getBuffer());
|
||||
} catch (SocketException e) {
|
||||
//serverLog("Player " + sourceId + " side socket disconnected", 1);
|
||||
return;
|
||||
logger.warn("Player " + sourceId + " side socket disconnected", 1);
|
||||
} catch (IOException e) {
|
||||
logger.warn("Message send failed", 1);
|
||||
}
|
||||
|
||||
@@ -410,7 +410,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
|
||||
List<Text> vboxEntries = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < yachts.size(); i++) {
|
||||
// System.out.println("yacht == null " + String.valueOf(yacht == null));
|
||||
if (yachts.get(i).getBoatStatus() == 3) { // 3 is finish status
|
||||
Text textToAdd = new Text(i + 1 + ". " +
|
||||
yachts.get(i).getShortName() + " (Finished)");
|
||||
|
||||
@@ -49,17 +49,13 @@ public class Marker extends Group {
|
||||
*/
|
||||
public void addArrows(MarkArrowFactory.RoundingSide roundingSide, double entryAngle,
|
||||
double exitAngle) {
|
||||
|
||||
//Change Color.GRAY to this.colour to revert all gray arrows.
|
||||
enterArrows.add(
|
||||
MarkArrowFactory.constructEntryArrow(roundingSide, entryAngle, exitAngle, colour)
|
||||
MarkArrowFactory.constructEntryArrow(roundingSide, entryAngle, exitAngle, Color.GRAY)
|
||||
);
|
||||
exitArrows.add(
|
||||
MarkArrowFactory.constructExitArrow(roundingSide, exitAngle, colour)
|
||||
MarkArrowFactory.constructExitArrow(roundingSide, exitAngle, Color.GRAY)
|
||||
);
|
||||
// Platform.runLater(() -> {
|
||||
// this.getChildren().add(enterArrows.get(enterArrows.size()-1));
|
||||
// this.getChildren().add(exitArrows.get(exitArrows.size()-1));
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -140,7 +140,6 @@ public class GeoUtilityTest {
|
||||
// for (int i = 0; i < 100000; i++) {
|
||||
// assertTrue(GeoUtility.isPointInTriangle(v1, v2, v3, p1));
|
||||
// }
|
||||
// System.out.println((System.nanoTime() - startTime) / 1000000000.0);
|
||||
|
||||
// test for different orders of vertices, which should not affect the result
|
||||
assertTrue(GeoUtility.isPointInTriangle(v2, v1, v3, p1));
|
||||
|
||||
Reference in New Issue
Block a user