From c3f8d65a4fb1f5674557ee67cf7f74369df86ad1 Mon Sep 17 00:00:00 2001 From: Darkelarious Date: Sat, 19 Nov 2016 20:56:04 +0100 Subject: Massive improvements on efficiency, robustness, security, reliability and more --- lib/MasterServer/Database/SQLite/dbClientList.pm | 45 ------------------------ 1 file changed, 45 deletions(-) delete mode 100755 lib/MasterServer/Database/SQLite/dbClientList.pm (limited to 'lib/MasterServer/Database/SQLite/dbClientList.pm') diff --git a/lib/MasterServer/Database/SQLite/dbClientList.pm b/lib/MasterServer/Database/SQLite/dbClientList.pm deleted file mode 100755 index 58c1392..0000000 --- a/lib/MasterServer/Database/SQLite/dbClientList.pm +++ /dev/null @@ -1,45 +0,0 @@ - -package MasterServer::Database::SQLite::dbClientList; - -use strict; -use warnings; -use Exporter 'import'; - -our @EXPORT = qw| get_gamenames - get_game_list |; - - -################################################################################ -## get a list of distinct gamenames currently in the database. it does not -## matter whether they are recent or old, as long as the game is currently in -## the database. -## -## returns: hashref of gamenames -################################################################################ -sub get_gamenames { - my $self = shift; - - return $self->{dbh}->selectall_arrayref( - "SELECT distinct gamename - FROM serverlist"); -} - -################################################################################ -## get the list of games of a certain $gamename, excluding the ones excempted -## via the blacklist -## only returns server addresses that are no more than 1 hours old -################################################################################ -sub get_game_list { - my ($self, $gamename) = @_; - - return $self->{dbh}->selectall_arrayref( - "SELECT ip, port - FROM serverlist - WHERE updated > datetime(CURRENT_TIMESTAMP, '-3600 seconds') - AND gamename = ? - AND NOT blacklisted", - undef, lc $gamename); -} - - -1; -- cgit v1.2.3