aboutsummaryrefslogtreecommitdiff
path: root/captain/db.f90
diff options
context:
space:
mode:
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