felix-d1strict / AL-JobTracker

Euro Truck Simulator 2 and American Truck Simulator - Jobtracker for Ace Logistics.
https://ace-logistics.uk
GNU General Public License v3.0
3 stars 1 forks source link

Job-Start - Save to database #20

Closed felix-d1strict closed 3 years ago

felix-d1strict commented 3 years ago

Is your feature request related to a problem? Please describe. Jobs should already be saved in the database at the begin of the job.

Describe the solution you'd like A Simple query, "if job status = 1 then send request to API". As an example. Likewise, a discord notification should be triggered at the job start.

Describe alternatives you've considered

Additional context However, this requires another change to the API, so I'll put this suggestion on the 1.1.1.

doouz commented 3 years ago

I understand that with this change you must have the tracker open before starting a job, since the job would only be created when the jobstatus is equal to 1, after this, if the jobstatus is 2 or 3 it would be the second call to the weburl. Based on this, how are the jobs identified? because a person may start a job in their personal profile, and then switch to another profile to go to their company's Convoy and that would leave 2 jobs started in the database, it would be ideal for the jobtracker to assign them a unique ID, otherwise the only way to identify a job would be by comparing the cityid, companyid and cargoid values, and if they match then apply finished or canceled work based on the content of jobstatus.

felix-d1strict commented 3 years ago

Yes, that's kind of what I had in mind. However, we will see the query if the job has just been started, etc. will be implemented on the server side. There, we already have a kind of unique ID anyway, which we can use for this. Only here in the tracker the trigger must take place whether a job is just in progress.

I understand that with this change you must have the tracker open before starting a job

In most cases this is already the case, because the tracker (at least if you have selected this in the installer) is also started with the start of Windows.