diff options
author | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-09-15 11:04:52 -0400 |
---|---|---|
committer | Jeffrey Armstrong <jeff@approximatrix.com> | 2021-09-15 11:04:52 -0400 |
commit | a3fe1adbf76e16e218864a8cfecdea7e6bc5dccd (patch) | |
tree | cb5e5d4117bd96bcd1f43003193d43e94e05457f /captain/requtils.f90 | |
parent | 842079426ac0b36ed6187faed231ecba15132b41 (diff) | |
download | levitating-a3fe1adbf76e16e218864a8cfecdea7e6bc5dccd.tar.gz levitating-a3fe1adbf76e16e218864a8cfecdea7e6bc5dccd.zip |
Added online and offline checking based on last checkin time for players. Added labeling of online status to most places players appear. Fixed css so display works in NetSurf.
Diffstat (limited to 'captain/requtils.f90')
-rw-r--r-- | captain/requtils.f90 | 40 |
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 |