The Battle for Wesnoth  1.15.3+dev
Public Member Functions | Private Member Functions | Private Attributes | List of all members
dbconn Class Reference

#include <dbconn.hpp>

Public Member Functions

 dbconn (const config &c)
 
std::string get_uuid ()
 
std::string get_tournaments ()
 
bool user_exists (const std::string &name)
 
bool extra_row_exists (const std::string &name)
 
bool is_user_in_group (const std::string &name, int group_id)
 
std::string get_user_string (const std::string &table, const std::string &column, const std::string &name)
 
int get_user_int (const std::string &table, const std::string &column, const std::string &name)
 
void write_user_int (const std::string &column, const std::string &name, int value)
 
ban_check get_ban_info (const std::string &name, const std::string &ip)
 
void insert_game_info (const std::string &uuid, int game_id, const std::string &version, const std::string &name, const std::string &map_name, const std::string &era_name, int reload, int observers, int is_public, int has_password, const std::string &map_source, const std::string &map_version, const std::string &era_source, const std::string &era_version)
 
void update_game_end (const std::string &uuid, int game_id, const std::string &replay_location)
 
void insert_game_player_info (const std::string &uuid, int game_id, const std::string &username, int side_number, int is_host, const std::string &faction, const std::string &version, const std::string &source, const std::string &current_user)
 
void insert_modification_info (const std::string &uuid, int game_id, const std::string &modification_name, const std::string &modification_source, const std::string &modification_version)
 
void set_oos_flag (const std::string &uuid, int game_id)
 

Private Member Functions

void log_sql_exception (const std::string &text, const mariadb::exception::base &e)
 
template<typename... Args>
void get_complex_results (rs_base &base, const std::string &sql, Args &&... args)
 
template<typename... Args>
std::string get_single_string (const std::string &sql, Args &&... args)
 
template<typename... Args>
int get_single_int (const std::string &sql, Args &&... args)
 
template<typename... Args>
bool exists (const std::string &sql, Args &&... args)
 
template<typename... Args>
mariadb::result_set_ref select (const std::string &sql, Args &&... args)
 
template<typename... Args>
int modify (const std::string &sql, Args &&... args)
 
template<typename... Args>
mariadb::statement_ref query (const std::string &sql, Args &&... args)
 
template<typename Arg , typename... Args>
void prepare (mariadb::statement_ref stmt, int i, Arg arg, Args &&... args)
 
template<typename Arg >
int prepare (mariadb::statement_ref stmt, int i, Arg arg)
 
void prepare (mariadb::statement_ref stmt, int i)
 

Private Attributes

mariadb::account_ref account_
 
mariadb::connection_ref connection_
 
std::string db_users_table_
 
std::string db_banlist_table_
 
std::string db_extra_table_
 
std::string db_game_info_table_
 
std::string db_game_player_info_table_
 
std::string db_game_modification_info_table_
 
std::string db_user_group_table_
 
std::string db_tournament_query_
 

Detailed Description

Definition at line 30 of file dbconn.hpp.

Constructor & Destructor Documentation

◆ dbconn()

dbconn::dbconn ( const config c)

Member Function Documentation

◆ exists()

template<typename... Args>
bool dbconn::exists ( const std::string &  sql,
Args &&...  args 
)
private

◆ extra_row_exists()

bool dbconn::extra_row_exists ( const std::string &  name)

◆ get_ban_info()

ban_check dbconn::get_ban_info ( const std::string &  name,
const std::string &  ip 
)

◆ get_complex_results()

template<typename... Args>
void dbconn::get_complex_results ( rs_base base,
const std::string &  sql,
Args &&...  args 
)
private

◆ get_single_int()

template<typename... Args>
int dbconn::get_single_int ( const std::string &  sql,
Args &&...  args 
)
private

◆ get_single_string()

template<typename... Args>
std::string dbconn::get_single_string ( const std::string &  sql,
Args &&...  args 
)
private

◆ get_tournaments()

std::string dbconn::get_tournaments ( )

◆ get_user_int()

int dbconn::get_user_int ( const std::string &  table,
const std::string &  column,
const std::string &  name 
)

◆ get_user_string()

std::string dbconn::get_user_string ( const std::string &  table,
const std::string &  column,
const std::string &  name 
)

◆ get_uuid()

std::string dbconn::get_uuid ( )

◆ insert_game_info()

void dbconn::insert_game_info ( const std::string &  uuid,
int  game_id,
const std::string &  version,
const std::string &  name,
const std::string &  map_name,
const std::string &  era_name,
int  reload,
int  observers,
int  is_public,
int  has_password,
const std::string &  map_source,
const std::string &  map_version,
const std::string &  era_source,
const std::string &  era_version 
)

◆ insert_game_player_info()

void dbconn::insert_game_player_info ( const std::string &  uuid,
int  game_id,
const std::string &  username,
int  side_number,
int  is_host,
const std::string &  faction,
const std::string &  version,
const std::string &  source,
const std::string &  current_user 
)

◆ insert_modification_info()

void dbconn::insert_modification_info ( const std::string &  uuid,
int  game_id,
const std::string &  modification_name,
const std::string &  modification_source,
const std::string &  modification_version 
)

◆ is_user_in_group()

bool dbconn::is_user_in_group ( const std::string &  name,
int  group_id 
)

◆ log_sql_exception()

void dbconn::log_sql_exception ( const std::string &  text,
const mariadb::exception::base e 
)
private

◆ modify()

template<typename... Args>
int dbconn::modify ( const std::string &  sql,
Args &&...  args 
)
private

◆ prepare() [1/3]

template<typename Arg , typename... Args>
void dbconn::prepare ( mariadb::statement_ref  stmt,
int  i,
Arg  arg,
Args &&...  args 
)
private

◆ prepare() [2/3]

template<typename Arg >
int dbconn::prepare ( mariadb::statement_ref  stmt,
int  i,
Arg  arg 
)
private

◆ prepare() [3/3]

void dbconn::prepare ( mariadb::statement_ref  stmt,
int  i 
)
private

◆ query()

template<typename... Args>
mariadb::statement_ref dbconn::query ( const std::string &  sql,
Args &&...  args 
)
private

◆ select()

template<typename... Args>
mariadb::result_set_ref dbconn::select ( const std::string &  sql,
Args &&...  args 
)
private

◆ set_oos_flag()

void dbconn::set_oos_flag ( const std::string &  uuid,
int  game_id 
)

◆ update_game_end()

void dbconn::update_game_end ( const std::string &  uuid,
int  game_id,
const std::string &  replay_location 
)

◆ user_exists()

bool dbconn::user_exists ( const std::string &  name)

◆ write_user_int()

void dbconn::write_user_int ( const std::string &  column,
const std::string &  name,
int  value 
)

Member Data Documentation

◆ account_

mariadb::account_ref dbconn::account_
private

Definition at line 50 of file dbconn.hpp.

◆ connection_

mariadb::connection_ref dbconn::connection_
private

Definition at line 51 of file dbconn.hpp.

◆ db_banlist_table_

std::string dbconn::db_banlist_table_
private

Definition at line 54 of file dbconn.hpp.

◆ db_extra_table_

std::string dbconn::db_extra_table_
private

Definition at line 55 of file dbconn.hpp.

◆ db_game_info_table_

std::string dbconn::db_game_info_table_
private

Definition at line 56 of file dbconn.hpp.

◆ db_game_modification_info_table_

std::string dbconn::db_game_modification_info_table_
private

Definition at line 58 of file dbconn.hpp.

◆ db_game_player_info_table_

std::string dbconn::db_game_player_info_table_
private

Definition at line 57 of file dbconn.hpp.

◆ db_tournament_query_

std::string dbconn::db_tournament_query_
private

Definition at line 60 of file dbconn.hpp.

◆ db_user_group_table_

std::string dbconn::db_user_group_table_
private

Definition at line 59 of file dbconn.hpp.

◆ db_users_table_

std::string dbconn::db_users_table_
private

Definition at line 53 of file dbconn.hpp.


The documentation for this class was generated from the following file: