aboutsummaryrefslogtreecommitdiff
path: root/player/instructions.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-04-05 16:30:15 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-04-05 16:30:15 -0400
commitaef2c3629718705975a181a345d3908776b14af5 (patch)
treee17ce550c12f1bd173a3e5a39f6388ca300e6651 /player/instructions.f90
parent15837a5fd46a1c9051d54138ba3ade26c74091f1 (diff)
downloadlevitating-aef2c3629718705975a181a345d3908776b14af5.tar.gz
levitating-aef2c3629718705975a181a345d3908776b14af5.zip
Fixed checkin json to return a name of instructions needed and a job id
Diffstat (limited to 'player/instructions.f90')
-rw-r--r--player/instructions.f9041
1 files changed, 38 insertions, 3 deletions
diff --git a/player/instructions.f90 b/player/instructions.f90
index 61502da..273c379 100644
--- a/player/instructions.f90
+++ b/player/instructions.f90
@@ -40,6 +40,42 @@ contains
end function work_available
+ subroutine get_instruction_name_from_checkin(j, name)
+ use json_module
+ implicit none
+
+ class(json_file)::j
+ character(*), intent(out)::name
+
+ character(len=:), allocatable::json_string_value
+ logical::found
+
+ name = " "
+ call j%get("instruction", json_string_value, found)
+ if(found) then
+ name = json_string_value
+ end if
+
+ end subroutine get_instruction_name_from_checkin
+
+ function get_job_id_from_checkin(j)
+ use json_module
+ implicit none
+
+ class(json_file)::j
+ integer::get_job_id_from_checkin
+
+ character(len=:), allocatable::json_string_value
+ logical::found
+
+ get_job_id_from_checkin = -1
+ call j%get("job", json_string_value, found)
+ if(found) then
+ read(json_string_value, *) get_job_id_from_checkin
+ end if
+
+ end function get_job_id_from_checkin
+
subroutine get_description(j, description)
use json_module
implicit none
@@ -271,7 +307,7 @@ contains
end function perform_task
- subroutine perform_tasks(j)
+ subroutine perform_tasks(j, job_id)
use json_module
use talking
use player_endpoints
@@ -279,17 +315,16 @@ contains
implicit none
class(json_file)::j
+ integer, intent(in)::job_id
integer::task_count
integer::i
integer::server_status
logical::res
- integer::job_id
character(len=:), pointer::captured_filename
character(len=1024)::url
task_count = get_task_count(j)
- job_id = get_job_id(j)
do i = 1, task_count