Horizon Official Technical Documentation
|
|
#include <Auth.hpp>
Public Member Functions | |
AuthServer () | |
Horizon Constructor. More... | |
~AuthServer () | |
Horizon Destructor. More... | |
bool | read_config () |
Read /config/horizon-server.yaml. More... | |
void | initialize () override |
void | finalize () override |
void | generate_salt (std::vector< unsigned char > &salt) |
void | hash_password (const std::string &password, const std::vector< unsigned char > &salt, std::vector< unsigned char > &hash) |
void | initialize_cli_commands () |
Initialize CLI Comamnds. More... | |
bool | clicmd_reload_config (std::string) |
CLI Command: Reload Configuration. More... | |
bool | clicmd_create_new_account (std::string) |
bool | clicmd_reset_password (std::string) |
void | verify_connected_sessions () |
TaskScheduler & | getScheduler () |
auth_config_type & | get_auth_config () |
void | update (uint64_t time) |
![]() | |
Server () | |
~Server () | |
void | parse_exec_args (const char *argv[], int argc) |
virtual void | initialize () |
virtual void | finalize () |
virtual void | post_initialize () |
virtual void | post_finalize () |
void | print_help () |
struct general_server_configuration & | general_conf () |
bool | parse_common_configs (sol::table &cfg) |
std::shared_ptr< boost::mysql::tcp_ssl_connection > | get_database_connection () |
bool | test_database_connection () |
![]() | |
Kernel (general_server_configuration &config) | |
~Kernel () | |
virtual void | initialize ()=0 |
virtual void | finalize ()=0 |
virtual void | post_initialize ()=0 |
virtual void | post_finalize ()=0 |
struct general_server_configuration & | general_conf () |
template<typename T > | |
std::shared_ptr< T > | get_component (std::string uuid) |
template<typename T > | |
std::shared_ptr< T > | get_component_of_type (Horizon::System::runtime_module_type type, int segment_number=1) |
template<typename T > | |
void | register_component (Horizon::System::runtime_module_type type, T &&component) |
template<typename T > | |
void | register_component (Horizon::System::runtime_module_type type, std::shared_ptr< T > component) |
void | deregister_component (Horizon::System::runtime_module_type type, int segment_number=1) |
int | get_registered_component_count_of_type (Horizon::System::runtime_module_type type) |
template<typename ComponentType , std::size_t Priority, typename Key , typename Value > | |
int | get_segment_number_for_resource (Horizon::System::runtime_module_type module_t, Key resource_key, Value resource_not_found_value) |
int | get_component_count () |
KernelComponents & | get_components () |
void | system_routine_queue_push (std::shared_ptr< Horizon::System::RuntimeContext > context) |
void | system_routine_queue_push (std::shared_ptr< Horizon::System::RuntimeContextChain > context) |
void | system_routine_process_queue () |
void | system_routine_register (Horizon::System::runtime_module_type module_t, Horizon::System::runtime_synchronization_method sync_t, std::shared_ptr< Horizon::System::RuntimeContext > context) |
Horizon::System::SystemRoutineManager & | get_system_routine_manager () |
boost::asio::io_context & | get_io_context () |
void | set_signal_interrupt_command_line_loop (bool signal) |
bool | get_signal_interrupt_command_line_loop () |
Static Public Member Functions | |
static AuthServer * | getInstance () |
Protected Attributes | |
TaskScheduler | _task_scheduler |
std::mutex | _conf_lock |
auth_config_type | _auth_config |
boost::asio::deadline_timer | _update_timer |
![]() | |
struct general_server_configuration | general_config |
![]() | |
boost::asio::io_context | _io_context_global |
KernelComponents | _components |
general_server_configuration | _config |
AuthServer::AuthServer | ( | ) |
Horizon Constructor.
AuthServer::~AuthServer | ( | ) |
Horizon Destructor.
bool AuthServer::clicmd_create_new_account | ( | std::string | cmd | ) |
References ACCOUNT_GENDER_FEMALE, ACCOUNT_GENDER_MALE, ACCOUNT_GENDER_NONE, ACCOUNT_STATE_NONE, Server::get_database_connection(), HLog, and sAuth.
Referenced by initialize_cli_commands().
bool AuthServer::clicmd_reload_config | ( | std::string | ) |
CLI Command: Reload Configuration.
References Server::general_conf(), general_server_configuration::get_config_file_path(), HLog, and read_config().
Referenced by initialize_cli_commands().
bool AuthServer::clicmd_reset_password | ( | std::string | cmd | ) |
References Server::get_database_connection(), HLog, and sAuth.
Referenced by initialize_cli_commands().
|
overridevirtual |
Server shutdown routine begins here...
Reimplemented from Server.
References Server::finalize(), Kernel::get_io_context(), HLog, and Server::post_finalize().
Referenced by update().
|
inline |
References Horizon::Auth::SALT_LEN.
|
inline |
References _auth_config, and _conf_lock.
Referenced by initialize(), read_config(), and verify_connected_sessions().
|
inlinestatic |
|
inline |
|
inline |
References Horizon::Auth::HASH_LEN, and Horizon::Auth::ITERATIONS.
|
overridevirtual |
Core Signal Handler
Reimplemented from Server.
References _task_scheduler, _update_timer, Server::general_conf(), get_auth_config(), Kernel::get_io_context(), HLog, HLogShutdown, Server::initialize(), initialize_cli_commands(), MAX_CORE_UPDATE_INTERVAL, Server::post_initialize(), TaskContext::Repeat(), TaskScheduler::Schedule(), sClientSocketMgr, set_shutdown_stage(), SHUTDOWN_CLEANUP_COMPLETE, SignalHandler(), update(), and verify_connected_sessions().
void AuthServer::initialize_cli_commands | ( | ) |
Initialize CLI Comamnds.
References clicmd_create_new_account(), clicmd_reload_config(), clicmd_reset_password(), Server::general_conf(), and Horizon::System::RUNTIME_COMMANDLINE.
Referenced by initialize().
bool AuthServer::read_config | ( | ) |
Read /config/horizon-server.yaml.
Process Configuration that is common between servers.
References Horizon::Auth::auth_config_type::char_server::_host, Horizon::Auth::auth_config_type::char_server::_is_new, Horizon::Auth::auth_config_type::char_server::_name, Horizon::Auth::auth_config_type::char_server::_port, Horizon::Auth::auth_config_type::char_server::_type, Horizon::Auth::auth_config_type::add_char_server(), Server::general_conf(), get_auth_config(), Horizon::Auth::auth_config_type::get_char_servers(), general_server_configuration::get_config_file_path(), HLog, horizon_config_error, Horizon::Auth::auth_config_type::max_network_threads(), Server::parse_common_configs(), Horizon::Auth::auth_config_type::session_max_timeout(), Horizon::Auth::auth_config_type::set_max_network_threads(), and Horizon::Auth::auth_config_type::set_session_max_timeout().
Referenced by clicmd_reload_config().
void AuthServer::update | ( | uint64_t | time | ) |
Cancel all pending tasks.
Stop all networks
References Kernel::_components, _task_scheduler, _update_timer, TaskScheduler::CancelAll(), finalize(), Server::general_conf(), get_shutdown_stage(), getScheduler(), HLog, MAX_CORE_UPDATE_INTERVAL, sClientSocketMgr, SHUTDOWN_NOT_STARTED, TaskScheduler::Update(), and update().
Referenced by initialize(), and update().
void AuthServer::verify_connected_sessions | ( | ) |
References GridTypeListIterator::count(), get_auth_config(), HLog, and sAuth.
Referenced by initialize().
|
protected |
Referenced by get_auth_config().
|
protected |
Referenced by get_auth_config().
|
protected |
Referenced by getScheduler(), initialize(), and update().
|
protected |
Referenced by initialize(), and update().