Skip to content

Commit

Permalink
Bugfixing for completed task attribute override for session source id…
Browse files Browse the repository at this point in the history
… of replay task
  • Loading branch information
carlosbpf committed Apr 15, 2024
1 parent 5e0caf8 commit 5d67d13
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void afterPropertiesSet() throws Exception {

System.out.println(" ================================================================== ");
System.out.println(" ================================================================== ");
System.out.println(" === POGS Version 1.14.1 === ");
System.out.println(" === POGS Version 1.14.2 === ");
System.out.println(" ================================================================== ");
System.out.println(" ================================================================== ");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,19 @@ public class PaginatedTaskEventReplayRunner implements Runnable {
public void run() {

Long timeBeforeStarts = taskWrapper.getTaskStartTimestamp() + 500 - new Date().getTime();
List<Round> roundId = roundDao.listBySessionId(sourceSessionId);
CompletedTask ct = completedTaskDao.getByRoundIdTaskIdTeamId(roundId.get(0).getId(), null, taskWrapper.getId());
if(ct == null) {
return;
}

_log.info("Starting taskEventReplay for task: " + taskWrapper.getId());
try {
if (timeBeforeStarts > 0) {
_log.debug("Sleeping before sending, for: " + timeBeforeStarts);
Thread.sleep(timeBeforeStarts);
}
_log.debug("Sending replay entries for: " + timeBeforeStarts);
_log.debug("Sending replay entries for: " + timeBeforeStarts + " for source session ID: " + sourceSessionId);
List<Round> roundId = roundDao.listBySessionId(sourceSessionId);
CompletedTask ct = completedTaskDao.getByRoundIdTaskIdTeamId(roundId.get(0).getId(), null, taskWrapper.getId());
if(ct == null) {
return;
}

Integer totalEvents = eventLogService.countEventsBySessionIdCompletedTaskIdTotal(sourceSessionId,ct.getId());
Integer totalPages = Double.valueOf(Math.ceil((double) totalEvents/EVENTS_PER_PAGE)).intValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ private void updateTaskReferencesBasedOnCompletedTaskAttributes(){
List<CompletedTaskAttribute> list = completedTaskAttributeService.listCompletedTaskAttributes(getCompletedTask().getId());
for(CompletedTaskAttribute sea: list){
if(sea.getAttributeName().equals("REPLAY_SESSION_ID")){
System.out.println("Found replay session override in TASK ID.");
Task taskToUpdate = taskService.get(getCompletedTask().getTaskId());
taskToUpdate.setReplayFromSessionId(Long.parseLong(sea.getStringValue()));
taskService.update(taskToUpdate);
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/plugins/coloredWackamolePlugin/taskWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class Wackamole {
//if (this.pogsPlugin.getTeammates().length == self.memberReady) {
// 5 seconds Count down, then display gameGrid
// and mole start popping up randomly
var countDownDate = new Date().getTime() + 5000;
var countDownDate = new Date().getTime() + 60*1000;
self.countDownTo(countDownDate, "loadingCountDown",
function () {
setTimeout(function () {
Expand All @@ -265,7 +265,7 @@ class Wackamole {

this.molePopUp();

}.bind(this), 5000)
}.bind(this), 60*1000)
}.bind(this)
);
//}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/static/js/pogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,4 +570,4 @@ class Pogs {


new Pogs();
console.log("Version 1.14.1");
console.log("Version 1.14.2");

0 comments on commit 5d67d13

Please sign in to comment.