Removed some comments and auxiliar code
import org.terasology.network.ServerEvent;
import org.terasology.world.block.BlockComponent;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
/** List of classes selected to replay */
private List<Class<?>> selectedClassesToReplay;
- //test purposes
- private long maxTimestampDiff;
- private StringBuffer buffer;
-
public EventSystemReplayImpl(EventLibrary eventLibrary, NetworkSystem networkSystem, EngineEntityManager entityManager,
RecordedEventStore recordedEventStore, EntityIdMap entityIdMap,
@@ -134,7 +127,6 @@ public EventSystemReplayImpl(EventLibrary eventLibrary, NetworkSystem networkSys
this.recordAndReplaySerializer = recordAndReplaySerializer;
this.recordAndReplayUtils = recordAndReplayUtils;
this.selectedClassesToReplay = selectedClassesToReplay;
- this.buffer = new StringBuffer();
}
/**
@@ -223,22 +215,12 @@ private void processRecordedEvents() {
private void finishReplay() {
recordedEventStore.popEvents();
RecordAndReplayStatus.setCurrentStatus(RecordAndReplayStatus.REPLAY_FINISHED); // stops the replay if every recorded event was already replayed
- //System.out.println("Max diff: " + this.maxTimestampDiff);
- try {
- BufferedWriter writer = new BufferedWriter(new FileWriter(new File("diff_data.txt")));
- writer.write(this.buffer.toString());
- writer.flush();
- writer.close();
- } catch (Exception e) {
- e.printStackTrace();
- }
}
private void loadNextRecordedEventFile() {
String recordingPath = PathManager.getInstance().getRecordingPath(recordAndReplayUtils.getGameTitle()).toString();
recordAndReplaySerializer.deserializeRecordedEvents(recordingPath);
fillRecordedEvents();
- this.buffer.append("DESERIALIZATION!\n");
}
private void initialiseReplayData() {
@@ -266,12 +248,6 @@ private void processRecordedEventsBatch(long maxDuration) {
recordedEvents.poll();
EntityRef entity = getEntityRef(re);
// Sends recorded event to be processed
- this.buffer.append("Record - " + re.getTimestamp() + " Replay - " + passedTime);
- this.buffer.append(" Time diff: " + (passedTime - re.getTimestamp()) + " Event: " + re.getEvent().toString() + "\n");
- if (this.maxTimestampDiff < (passedTime - re.getTimestamp())) {
- this.maxTimestampDiff = passedTime - re.getTimestamp();
- }
-
if (re.getComponent() != null) {
originalSend(entity, re.getEvent(), re.getComponent());
} else {
