v2 transact

This commit is contained in:
2018-12-19 17:28:31 +01:00
parent efd95eacab
commit e48b0a7bdd
3 changed files with 40 additions and 38 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 17:27:29 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 17:28:31 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+20 -19
View File
@@ -1,4 +1,4 @@
/*Generated on:Wed Dec 19 2018 17:27:29 GMT+0100 (CET)*/ /*Generated on:Wed Dec 19 2018 17:28:31 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -4479,6 +4479,7 @@ class AutomaticDispose {
// Variablen // Variablen
get ADisSettings() { get ADisSettings() {
let self =this
return { return {
url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/", url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/",
branch: "master", branch: "master",
@@ -17015,7 +17016,7 @@ class AutomaticDispose {
} }
} }
}`), }`),
name: this.name, name: self.name,
runner: ['kt', 'om', 'os', 'vm', 've'], runner: ['kt', 'om', 'os', 'vm', 've'],
runner_divs: ['mission_list_krankentransporte', 'mission_list', /*'mission_list_sicherheitswache',*/ 'mission_list_alliance', 'mission_list_alliance_event'], runner_divs: ['mission_list_krankentransporte', 'mission_list', /*'mission_list_sicherheitswache',*/ 'mission_list_alliance', 'mission_list_alliance_event'],
runner_settings: ['Krankentransport-Automatic', 'MissionsOwn-Automatic', /*'MissionsOwn-Automatic',*/ 'Alliance-Automatic', 'AllianceEvent-Automatic'], runner_settings: ['Krankentransport-Automatic', 'MissionsOwn-Automatic', /*'MissionsOwn-Automatic',*/ 'Alliance-Automatic', 'AllianceEvent-Automatic'],
@@ -17038,20 +17039,20 @@ class AutomaticDispose {
self.Vehicles = {} self.Vehicles = {}
self.Patients = {} self.Patients = {}
this.ADis_MyHead = document.getElementsByTagName('head')[0]; self.ADis_MyHead = document.getElementsByTagName('head')[0];
this.ADis_MyBody = document.getElementsByTagName('body')[0]; self.ADis_MyBody = document.getElementsByTagName('body')[0];
// - // -
// - Sprechwunsch Variablen // - Sprechwunsch Variablen
// - // -
this.Jails = []; self.Jails = [];
this.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g; self.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g;
this.Hospitals = []; self.Hospitals = [];
this.RescueVehicleFrameWatchDog = null; self.RescueVehicleFrameWatchDog = null;
this.PoliceVehicleFrameWatchDog = null; self.PoliceVehicleFrameWatchDog = null;
this.ADisDB = new Dexie('LSS_AutomaticDispo'); self.ADisDB = new Dexie('LSS_AutomaticDispo');
this.ADisDB.version(1).stores({ self.ADisDB.version(1).stores({
/** /**
* AvailabelMissions * AvailabelMissions
* - missionID * - missionID
@@ -17096,7 +17097,7 @@ class AutomaticDispose {
*/ */
ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]" ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]"
}); });
this.ADisDB.on("populate", () => { self.ADisDB.on("populate", () => {
self.ADisDB.ADisSettings.add({ self.ADisDB.ADisSettings.add({
name: "Krankentransport-Automatic", name: "Krankentransport-Automatic",
value: 'true' value: 'true'
@@ -17118,10 +17119,10 @@ class AutomaticDispose {
value: 'false' value: 'false'
}); });
}); });
this.ADisDB.open().catch((err) => { self.ADisDB.open().catch((err) => {
console.error(err.stack || err); console.error(err.stack || err);
}); });
this.ADisDB.on("ready", async () => { self.ADisDB.on("ready", async () => {
self.adis_settings = { self.adis_settings = {
'Krankentransport-Automatic': false, 'Krankentransport-Automatic': false,
'Sprechwunsch-Automatic': false, 'Sprechwunsch-Automatic': false,
@@ -17203,7 +17204,7 @@ class AutomaticDispose {
RemovePoliceSprechwunschFromQueue(WunschID) { RemovePoliceSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return await this.ADisDB.ADisSprechwunschPolice.where({ return await self.ADisDB.ADisSprechwunschPolice.where({
missionID: WunschID missionID: WunschID
}).delete(); }).delete();
@@ -17214,7 +17215,7 @@ class AutomaticDispose {
RemoveRescueSprechwunschFromQueue(WunschID) { RemoveRescueSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return await this.ADisDB.ADisSprechwunsch.where({ return await self.ADisDB.ADisSprechwunsch.where({
vehicleID: WunschID vehicleID: WunschID
}).delete(); }).delete();
@@ -17258,8 +17259,8 @@ class AutomaticDispose {
OpenNextRescueSprechwunsch() { OpenNextRescueSprechwunsch() {
let self = this; let self = this;
return await self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return await this.ADSettings().then((setting) => { return await self.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunsch.where({ return self.ADisDB.ADisSprechwunsch.where({
done: 'false' done: 'false'
@@ -17403,7 +17404,7 @@ class AutomaticDispose {
}); });
self.Hospitals.reverse(); self.Hospitals.reverse();
this.Send_Vehicle_To_Hospital() self.Send_Vehicle_To_Hospital()
} }
// Krankenhaus einlieferung // Krankenhaus einlieferung
+19 -18
View File
@@ -4,11 +4,12 @@ class AutomaticDispose {
// Variablen // Variablen
get ADisSettings() { get ADisSettings() {
let self =this
return { return {
url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/", url: "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/",
branch: "master", branch: "master",
all_missions: /***ADis_AllMissions***/ 0, all_missions: /***ADis_AllMissions***/ 0,
name: this.name, name: self.name,
runner: ['kt', 'om', 'os', 'vm', 've'], runner: ['kt', 'om', 'os', 'vm', 've'],
runner_divs: ['mission_list_krankentransporte', 'mission_list', /*'mission_list_sicherheitswache',*/ 'mission_list_alliance', 'mission_list_alliance_event'], runner_divs: ['mission_list_krankentransporte', 'mission_list', /*'mission_list_sicherheitswache',*/ 'mission_list_alliance', 'mission_list_alliance_event'],
runner_settings: ['Krankentransport-Automatic', 'MissionsOwn-Automatic', /*'MissionsOwn-Automatic',*/ 'Alliance-Automatic', 'AllianceEvent-Automatic'], runner_settings: ['Krankentransport-Automatic', 'MissionsOwn-Automatic', /*'MissionsOwn-Automatic',*/ 'Alliance-Automatic', 'AllianceEvent-Automatic'],
@@ -31,20 +32,20 @@ class AutomaticDispose {
self.Vehicles = {} self.Vehicles = {}
self.Patients = {} self.Patients = {}
this.ADis_MyHead = document.getElementsByTagName('head')[0]; self.ADis_MyHead = document.getElementsByTagName('head')[0];
this.ADis_MyBody = document.getElementsByTagName('body')[0]; self.ADis_MyBody = document.getElementsByTagName('body')[0];
// - // -
// - Sprechwunsch Variablen // - Sprechwunsch Variablen
// - // -
this.Jails = []; self.Jails = [];
this.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g; self.JailRegEx = /\(Freie Zellen\:\s+(\d)\,\s+Entfernung\:\s+(\d+\,\d+)\s+km(?:\,\s+Abgabe an Besitzer\:\s+(\d+)%)?\)/g;
this.Hospitals = []; self.Hospitals = [];
this.RescueVehicleFrameWatchDog = null; self.RescueVehicleFrameWatchDog = null;
this.PoliceVehicleFrameWatchDog = null; self.PoliceVehicleFrameWatchDog = null;
this.ADisDB = new Dexie('LSS_AutomaticDispo'); self.ADisDB = new Dexie('LSS_AutomaticDispo');
this.ADisDB.version(1).stores({ self.ADisDB.version(1).stores({
/** /**
* AvailabelMissions * AvailabelMissions
* - missionID * - missionID
@@ -89,7 +90,7 @@ class AutomaticDispose {
*/ */
ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]" ADisMissions: "++missionID,runner,available,done,[missionID+available+done],[missionID+runner],[missionID+runner+done],[runner+available+done]"
}); });
this.ADisDB.on("populate", () => { self.ADisDB.on("populate", () => {
self.ADisDB.ADisSettings.add({ self.ADisDB.ADisSettings.add({
name: "Krankentransport-Automatic", name: "Krankentransport-Automatic",
value: 'true' value: 'true'
@@ -111,10 +112,10 @@ class AutomaticDispose {
value: 'false' value: 'false'
}); });
}); });
this.ADisDB.open().catch((err) => { self.ADisDB.open().catch((err) => {
console.error(err.stack || err); console.error(err.stack || err);
}); });
this.ADisDB.on("ready", async () => { self.ADisDB.on("ready", async () => {
self.adis_settings = { self.adis_settings = {
'Krankentransport-Automatic': false, 'Krankentransport-Automatic': false,
'Sprechwunsch-Automatic': false, 'Sprechwunsch-Automatic': false,
@@ -196,7 +197,7 @@ class AutomaticDispose {
RemovePoliceSprechwunschFromQueue(WunschID) { RemovePoliceSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunschPolice], async () => {
return await this.ADisDB.ADisSprechwunschPolice.where({ return await self.ADisDB.ADisSprechwunschPolice.where({
missionID: WunschID missionID: WunschID
}).delete(); }).delete();
@@ -207,7 +208,7 @@ class AutomaticDispose {
RemoveRescueSprechwunschFromQueue(WunschID) { RemoveRescueSprechwunschFromQueue(WunschID) {
let self = this; let self = this;
return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return await this.ADisDB.ADisSprechwunsch.where({ return await self.ADisDB.ADisSprechwunsch.where({
vehicleID: WunschID vehicleID: WunschID
}).delete(); }).delete();
@@ -251,8 +252,8 @@ class AutomaticDispose {
OpenNextRescueSprechwunsch() { OpenNextRescueSprechwunsch() {
let self = this; let self = this;
return await self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => { return self.ADisDB.transaction('rw', [self.ADisDB.ADisSprechwunsch], async () => {
return await this.ADSettings().then((setting) => { return await self.ADSettings().then((setting) => {
if (setting['Sprechwunsch-Automatic'] == 'true') { if (setting['Sprechwunsch-Automatic'] == 'true') {
return self.ADisDB.ADisSprechwunsch.where({ return self.ADisDB.ADisSprechwunsch.where({
done: 'false' done: 'false'
@@ -396,7 +397,7 @@ class AutomaticDispose {
}); });
self.Hospitals.reverse(); self.Hospitals.reverse();
this.Send_Vehicle_To_Hospital() self.Send_Vehicle_To_Hospital()
} }
// Krankenhaus einlieferung // Krankenhaus einlieferung