change rescue + police transport

This commit is contained in:
2018-12-19 19:53:56 +01:00
parent f7ce310ea7
commit ccb451a1ed
3 changed files with 74 additions and 74 deletions

View File

@@ -128,11 +128,11 @@ class AutomaticDispose {
if (window.location.pathname === "/" || window.location.pathname === "/#") {
self.GetAvailableMissions()
self.IndexPage()
setInterval(self.CollectRescueSprechwuensche.bind(self), 2500);
setInterval(self.OpenNextRescueSprechwunsch.bind(self), 5000);
setInterval(self.CollectRescueSprechwuensche.bind(self), 3500);
setInterval(self.OpenNextRescueSprechwunsch.bind(self), 1000);
self.CollectRescueSprechwuensche();
setInterval(self.CollectPoliceSprechwuensche.bind(self), 2500);
setInterval(self.OpenNextPoliceSprechwunsch.bind(self), 5000);
setInterval(self.CollectPoliceSprechwuensche.bind(self), 3500);
setInterval(self.OpenNextPoliceSprechwunsch.bind(self), 1000);
self.CollectPoliceSprechwuensche();
setTimeout(() => {
@@ -1168,41 +1168,41 @@ class AutomaticDispose {
// return tellParent(`console.log('handler:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`); // delete Mission here as completed
// })
// } else {
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
return self.ADisDB.transaction('rw', [self.ADisDB.ADisMissions], () => {
self.ADSettings().then((setting) => {
if (setting[self.MyRunnerSettings] === 'true') {
let where = {
missionID: self.MissionID,
runner: self.MyRunner,
done: 'false'
let where = {
missionID: self.MissionID,
runner: self.MyRunner,
done: 'false'
}
// console.log(where);
return self.ADisDB.ADisMissions.where(where).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1)
}
}).then((Wunsch) => {
if (Wunsch !== undefined) {
return Wunsch.count(function (count) {
if (count > 0) {
return Wunsch.each((mywunsch) => {
console.table(mywunsch);
return self.MainHandler()
});
} else {
return self.UpdateMissionsToDone(self.MissionID).then(() => {
return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
// console.log(where);
return self.ADisDB.ADisMissions.where(where).and(function (item) {
return item.next_check <= Math.floor(new Date().getTime() / 1000)
}).limit(1)
}
}).then((Wunsch) => {
if (Wunsch !== undefined) {
return Wunsch.count(function (count) {
if (count > 0) {
return Wunsch.each((mywunsch) => {
console.table(mywunsch);
return self.MainHandler()
});
} else {
return self.UpdateMissionsToDone(self.MissionID).then(() => {
return tellParent(`console.log('wunsch:1000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
});
} else {
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
})
});
} else {
return self.RemoveMissionsFromQueue(self.MissionID).then(() => {
return tellParent(`console.log('wunsch:2000:done:${window.name}:${self.MissionID}');window.AutomaticDisposeCall.FreeIframe('${self.MyRunner}');`);
})
}
})
})
// }
}, 500);
}