Skip to content

Commit

Permalink
Merge pull request #32 from frank-weinberg/combat_lag
Browse files Browse the repository at this point in the history
Write collected game data to a file only once per jam (at jam end).
  • Loading branch information
jaredquinn authored Mar 18, 2018
2 parents b2557f8 + 4ad6616 commit 20f0e21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/com/carolinarollergirls/scoreboard/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ public void snapshot(boolean jamEnd) {
JamStats js = findJamStats(period, jam, true);
js.snapshot(jamEnd);

saveLock.notifyAll();
if (jamEnd) { // only write the data to file once per jam to combat lag from writing it multiple times over at the end of each jam
saveLock.notifyAll();
}
} catch (Exception e) {
ScoreBoardManager.printMessage("Error catching snapshot: " + e.getMessage());
e.printStackTrace();
Expand Down

0 comments on commit 20f0e21

Please sign in to comment.