| 20 | {} |
| 21 | |
| 22 | Server::Server( |
| 23 | CommandsProcessor& commands_processor, |
| 24 | const GameResourcesConstPtr& game_resources, |
| 25 | const MapLoaderPtr& map_loader, |
| 26 | const IConnectionsListenerPtr& connections_listener, |
| 27 | const DrawLoadingCallback& draw_loading_callback ) |
| 28 | : game_resources_(game_resources) |
| 29 | , map_loader_(map_loader) |
| 30 | , connections_listener_(connections_listener) |
| 31 | , draw_loading_callback_(draw_loading_callback) |
| 32 | , map_end_callback_( [this]{ map_end_triggered_= true; } ) |
| 33 | , last_tick_( Time::CurrentTime() ) |
| 34 | , server_accumulated_time_( Time::FromSeconds(0) ) |
| 35 | { |
| 36 | PC_ASSERT( game_resources_ != nullptr ); |
| 37 | PC_ASSERT( map_loader_ != nullptr ); |
| 38 | PC_ASSERT( connections_listener_ != nullptr ); |
| 39 | |
| 40 | CommandsMapPtr commands= std::make_shared<CommandsMap>(); |
| 41 | |
| 42 | commands->emplace( "ammo", std::bind( &Server::GiveAmmo, this ) ); |
| 43 | commands->emplace( "armor", std::bind( &Server::GiveArmor, this ) ); |
| 44 | commands->emplace( "weapon", std::bind( &Server::GiveWeapon, this ) ); |
| 45 | commands->emplace( "keys", std::bind( &Server::GiveKeys, this ) ); |
| 46 | commands->emplace( "chojin", std::bind( &Server::ToggleGodMode, this ) ); |
| 47 | commands->emplace( "noclip", std::bind( &Server::ToggleNoclip, this ) ); |
| 48 | |
| 49 | commands_= std::move( commands ); |
| 50 | commands_processor.RegisterCommands( commands_ ); |
| 51 | |
| 52 | UpdateTimes(); |
| 53 | } |
| 54 | |
| 55 | Server::~Server() |
| 56 | {} |
nothing calls this directly
no test coverage detected