Fixed XML Issue where sometimes the last boat would not display itself #story[1188]

main
Fan-Wu Yang 8 years ago
parent ddc3a6ae47
commit d92410b9b4

@ -60,7 +60,6 @@ public class MockOutput implements RunnableWithFramePeriod {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
//If we get interrupted, exit the function.
Logger.getGlobal().log(Level.WARNING, "MockOutput.run().sleep(waitForXMLs) was interrupted on thread: " + Thread.currentThread(), e);
@ -72,7 +71,6 @@ public class MockOutput implements RunnableWithFramePeriod {
}
}
long previousFrameTime = System.currentTimeMillis();

@ -126,6 +126,7 @@ public class MockRace extends RaceState {
this.boats.add(mockBoat);
getRaceDataSource().incrementSequenceNumber();
}
/**

@ -21,6 +21,8 @@ import java.util.logging.Logger;
* Created by connortaylorbrown on 2/08/17.
*/
public class RaceServer {
private static RaceServer server;//this is for updating xml files as I cannot find an elegant way to do this and since it is near the end of the sprint we shouldn't be doing large scale refactors
private MockRace race;
private LatestMessages latestMessages;
@ -47,6 +49,7 @@ public class RaceServer {
public RaceServer(MockRace race, LatestMessages latestMessages) {
server = this;
this.race = race;
this.latestMessages = latestMessages;
}
@ -73,6 +76,12 @@ public class RaceServer {
}
public static void staticUpdateXML(){
if (server != null){
server.updateXMLFiles();
}
}
/**
* Checks if the race/boat/regatta data sources have changed, and if they have, update their xml representations.
*/

@ -1,5 +1,6 @@
package network.Messages;
import mock.model.RaceServer;
import network.Messages.Enums.XMLMessageType;
import java.util.*;
@ -152,6 +153,7 @@ public class LatestMessages extends Observable {
return false;
} else {
RaceServer.staticUpdateXML();
return true;
}

Loading…
Cancel
Save