diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-11 20:09:08 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-05-11 20:09:08 -0400 |
commit | a25527272916f342875809d7c3606ba0ebd350b4 (patch) | |
tree | 4a4767bd07d181509535a2cc397a5a057b3503ef /captain/external.f90 | |
parent | 0f31824a5e4969d56d88678e05274163be3d8b77 (diff) | |
download | levitating-a25527272916f342875809d7c3606ba0ebd350b4.tar.gz levitating-a25527272916f342875809d7c3606ba0ebd350b4.zip |
Moved some command handling into requtils to share with web and gemini modes. Started work on handling post requests to add players.
Diffstat (limited to 'captain/external.f90')
-rw-r--r-- | captain/external.f90 | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/captain/external.f90 b/captain/external.f90 index 8ca5c97..f3efaaf 100644 --- a/captain/external.f90 +++ b/captain/external.f90 @@ -387,44 +387,6 @@ contains end function generate_one_instuction_gemini - subroutine handle_instruction_command(req) - use captain_db - use server_response - use remote_launch - implicit none - - type(request), intent(in)::req - character(32)::command - character(PLAYER_NAME_LENGTH)::argument, instruction_name - - integer::i, j - - i = index(req%location, "/", back=.true.) - j = index(req%location, ".", back=.true.) - - instruction_name = req%location(i+1:j-1) - - i = index(req%query_string, "=") - command = req%query_string(1:i-1) - argument = req%query_string(i+1:len_trim(req%query_string)) - - if(trim(command) == "launch") then - call launch_instructions_on_player(instruction_name, argument) - - else if(trim(command) == "assign") then - i = get_instruction_id(trim(instruction_name)) - j = get_player_id(trim(argument)) - call add_player_for_instruction(i, j) - - else if(trim(command) == "remove") then - i = get_instruction_id(trim(instruction_name)) - j = get_player_id(trim(argument)) - call remove_player_for_instruction(i, j) - - end if - - end subroutine handle_instruction_command - function generate_instructions_gemini() result(res) use captain_db implicit none @@ -514,6 +476,7 @@ contains function external_input_request_gemini(req) result(resp) use server_response use captain_db + use request_utils, only: handle_instruction_command implicit none class(request), intent(in)::req |