Fixed latency issues caused by clientside movement packets queueing up but currently the trails aren't working anymore #fix #refactor

This commit is contained in:
Peter Galloway
2017-07-26 22:02:46 +12:00
parent 6e9535d78f
commit 9cedbeb6f6
2 changed files with 8 additions and 8 deletions
@@ -210,14 +210,14 @@ public class BoatGroup extends Group {
double groundSpeed, long timeValid, double frameRate) {
if (lastTimeValid == 0) {
lastTimeValid = timeValid - 200;
moveTo(newXValue, newYValue, rotation);
}
framesToMove = Math.round((frameRate / (1000.0f / (timeValid - lastTimeValid))));
double dx = newXValue - boatPoly.getLayoutX();
double dy = newYValue - boatPoly.getLayoutY();
xIncrement = dx / framesToMove;
yIncrement = dy / framesToMove;
moveTo(newXValue, newYValue, rotation);
// framesToMove = Math.round((frameRate / (1000.0f / (timeValid - lastTimeValid))));
// double dx = newXValue - boatPoly.getLayoutX();
// double dy = newYValue - boatPoly.getLayoutY();
//
// xIncrement = dx / framesToMove;
// yIncrement = dy / framesToMove;
destinationSet = true;
@@ -23,7 +23,7 @@ import java.util.logging.Logger;
public class MainServerThread extends Observable implements Runnable, ClientConnectionDelegate{
private static final int PORT = 4942;
private static final Integer CLIENT_UPDATES_PER_SECOND = 5;
private static final Integer CLIENT_UPDATES_PER_SECOND = 10;
private static final int LOG_LEVEL = 1;
private Thread thread;