aboutsummaryrefslogtreecommitdiff
path: root/captain/requtils.f90
diff options
context:
space:
mode:
Diffstat (limited to 'captain/requtils.f90')
-rw-r--r--captain/requtils.f9040
1 files changed, 40 insertions, 0 deletions
diff --git a/captain/requtils.f90 b/captain/requtils.f90
index a0c42c7..41eacc6 100644
--- a/captain/requtils.f90
+++ b/captain/requtils.f90
@@ -32,6 +32,11 @@ implicit none
module procedure instruction_link_from_name
module procedure instruction_link_from_id
end interface
+
+ interface get_player_status_utf8
+ module procedure get_player_status_utf8_by_id
+ module procedure get_player_status_utf8_by_name
+ end interface
contains
@@ -143,10 +148,45 @@ contains
! Envelope 0x2709
res = char(226)//char(156)//char(137)//" "
+ case(PLAYER_STATUS_OFFLINE)
+ ! Fancy question mark 0xe29d93
+ res = char(226)//char(157)//char(147)//" "
+
end select
end function get_status_utf8
+ function get_player_status_utf8_by_id(player_id) result(res)
+ use captain_db, only: is_player_online, is_player_busy, &
+ PLAYER_STATUS_BUSY, PLAYER_STATUS_IDLE, PLAYER_STATUS_OFFLINE
+ implicit none
+
+ integer, intent(in)::player_id
+ character(4)::res
+
+ if(is_player_online(player_id)) then
+ if(is_player_busy(player_id)) then
+ res = get_status_utf8(PLAYER_STATUS_BUSY)
+ else
+ res = get_status_utf8(PLAYER_STATUS_IDLE)
+ end if
+ else
+ res = get_status_utf8(PLAYER_STATUS_OFFLINE)
+ end if
+
+ end function get_player_status_utf8_by_id
+
+ function get_player_status_utf8_by_name(player) result(res)
+ use captain_db, only: get_player_id
+ implicit none
+
+ character(*), intent(in)::player
+ character(4)::res
+
+ res = get_player_status_utf8_by_id(get_player_id(player))
+
+ end function get_player_status_utf8_by_name
+
function is_request_static(req)
use server_response
use logging