aboutsummaryrefslogtreecommitdiff
path: root/captain/db.f90
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeff@approximatrix.com>2021-06-29 16:06:44 -0400
committerJeffrey Armstrong <jeff@approximatrix.com>2021-06-29 16:06:44 -0400
commitcd4a5891b8e2a019fdfda7512d6490e075628292 (patch)
tree8012dc7dc52f17632f5b429dea79709e55ab96c4 /captain/db.f90
parentd282a7e283a1704cdde2649c7caf130fb923051a (diff)
downloadlevitating-cd4a5891b8e2a019fdfda7512d6490e075628292.tar.gz
levitating-cd4a5891b8e2a019fdfda7512d6490e075628292.zip
Tokens are now checked for file uploads. Fixed major buffer bugs in status reporting.
Diffstat (limited to 'captain/db.f90')
-rw-r--r--captain/db.f9020
1 files changed, 20 insertions, 0 deletions
diff --git a/captain/db.f90 b/captain/db.f90
index 1f9bc01..448c17d 100644
--- a/captain/db.f90
+++ b/captain/db.f90
@@ -146,6 +146,26 @@ contains
end subroutine update_player_token_db
+ subroutine get_player_token_db(name, token)
+ implicit none
+
+ character(*), intent(in)::name
+ character(*), intent(out)::token
+ type(sqlite3_stmt)::stmt
+
+ token = " "
+
+ if(stmt%prepare(db, "SELECT token FROM players WHERE name=?") == SQLITE_OK) then
+ if(stmt%bind_text(1, name) == SQLITE_OK ) then
+ if(stmt%step() == SQLITE_ROW) then
+ call stmt%column_text(0, token)
+ end if
+ end if
+ end if
+ call stmt%finalize()
+
+ end subroutine get_player_token_db
+
function player_has_token_db(name)
implicit none