diff --git a/src/swganh/app/kernel_interface.h b/src/swganh/app/kernel_interface.h index 9e90d41f7..debd7d764 100644 --- a/src/swganh/app/kernel_interface.h +++ b/src/swganh/app/kernel_interface.h @@ -62,7 +62,9 @@ class KernelInterface { virtual swganh::database::DatabaseManager* GetDatabaseManager() = 0; - virtual boost::asio::io_service& GetIoService() = 0; + virtual boost::asio::io_service& GetIoThreadPool() = 0; + + virtual boost::asio::io_service& GetCpuThreadPool() = 0; // also add entity manager, blah blah. }; diff --git a/src/swganh/app/swganh_app.cc b/src/swganh/app/swganh_app.cc index d826d9e4c..cc399d818 100644 --- a/src/swganh/app/swganh_app.cc +++ b/src/swganh/app/swganh_app.cc @@ -58,8 +58,8 @@ options_description AppConfig::BuildConfigDescription() { desc.add_options() ("help,h", "Display help message and config options") - ("server_mode", boost::program_options::value(&server_mode)->default_value("all"), - "Specifies the service configuration mode to run the server in.") + ("server_mode", boost::program_options::value(&server_mode)->default_value("all"), + "Specifies the service configuration mode to run the server in.") ("plugin,p", boost::program_options::value>(&plugins), "Only used when single_server_mode is disabled, loads a module of the specified name") @@ -81,6 +81,12 @@ options_description AppConfig::BuildConfigDescription() { ("db_threads", value(&db_threads)->default_value(2), "Total number of threads to allocate for database management") + ("io_threads", value(&io_threads)->default_value(2), + "Total number of threads to allocate for pulling threads off the wire") + + ("cpu_threads", value(&cpu_threads)->default_value(boost::thread::hardware_concurrency()), + "Total number of threads to allocate for processing.") + ("db.galaxy_manager.host", boost::program_options::value(&galaxy_manager_db.host), "Host address for the galaxy_manager datastore") ("db.galaxy_manager.schema", boost::program_options::value(&galaxy_manager_db.schema), @@ -140,10 +146,12 @@ options_description AppConfig::BuildConfigDescription() { } SwganhApp::SwganhApp(int argc, char* argv[]) - : io_service_() - , io_work_(new boost::asio::io_service::work(io_service_)) + : io_pool_() + , cpu_pool_() + , io_work_(new boost::asio::io_service::work(io_pool_)) + , cpu_work_(new boost::asio::io_service::work(cpu_pool_)) { - kernel_ = make_shared(io_service_); + kernel_ = make_shared(io_pool_, cpu_pool_); running_ = false; initialized_ = false; @@ -158,9 +166,11 @@ SwganhApp::~SwganhApp() kernel_->Shutdown(); io_work_.reset(); + cpu_work_.reset(); // join the threadpool threads until each one has exited. for_each(io_threads_.begin(), io_threads_.end(), std::mem_fn(&boost::thread::join)); + for_each(cpu_threads_.begin(), cpu_threads_.end(), std::mem_fn(&boost::thread::join)); kernel_.reset(); } @@ -244,28 +254,46 @@ void SwganhApp::Start() { running_ = true; - // Start up a threadpool for running io_service based tasks/active objects - // The increment starts at 2 because the main thread of execution already counts - // as thread in use as does the console thread. - for (uint32_t i = 1; i < boost::thread::hardware_concurrency(); ++i) { - boost::thread t([this] () { - try - { - io_service_.run(); - } - catch(...) + //Create a number of threads to pull packets off the wire. + for (uint32_t i = 0; i < kernel_->GetAppConfig().io_threads; ++i) { + boost::thread t([this] () { + //Continue looping despite errors. + //If we successfully leave the run method we return. + while(true) { - LOG(severity_level::error) << "A near fatal exception has occurred."; + try + { + io_pool_.run(); + return; + } + catch(...) + { + LOG(severity_level::error) << "A near fatal exception has occurred."; + } } - - }); - -#ifdef _WIN32 - SetPriorityClass(t.native_handle(), REALTIME_PRIORITY_CLASS); -#endif - + }); io_threads_.push_back(move(t)); } + + for (uint32_t i = 0; i < kernel_->GetAppConfig().cpu_threads; ++i) { + boost::thread t([this] () { + //Continue looping despite errors. + //If we successfully leave the run method we return. + while(true) + { + try + { + cpu_pool_.run(); + return; + } + catch(...) + { + LOG(severity_level::error) << "A near fatal exception has occurred."; + } + } + }); + cpu_threads_.push_back(move(t)); + } kernel_->GetServiceManager()->Start(); diff --git a/src/swganh/app/swganh_app.h b/src/swganh/app/swganh_app.h index 590b40e28..d26bcf20d 100644 --- a/src/swganh/app/swganh_app.h +++ b/src/swganh/app/swganh_app.h @@ -78,9 +78,9 @@ class SwganhApp : public swganh::app::AppInterface, private boost::noncopyable { void SetupLogging_(); - boost::asio::io_service io_service_; - std::unique_ptr io_work_; - std::vector io_threads_; + boost::asio::io_service io_pool_, cpu_pool_; + std::unique_ptr io_work_, cpu_work_; + std::vector io_threads_, cpu_threads_; std::shared_ptr kernel_; std::atomic running_; bool initialized_; diff --git a/src/swganh/app/swganh_kernel.cc b/src/swganh/app/swganh_kernel.cc index b8cfad287..eeed8610a 100644 --- a/src/swganh/app/swganh_kernel.cc +++ b/src/swganh/app/swganh_kernel.cc @@ -29,8 +29,9 @@ using swganh::service::ServiceManager; using std::make_shared; using std::shared_ptr; -SwganhKernel::SwganhKernel(boost::asio::io_service& io_service) - : io_service_(io_service) +SwganhKernel::SwganhKernel(boost::asio::io_service& io_pool, boost::asio::io_service& cpu_pool) + : io_pool_(io_pool) + , cpu_pool_(cpu_pool) { version_.major = VERSION_MAJOR; version_.minor = VERSION_MINOR; @@ -76,7 +77,7 @@ DatabaseManager* SwganhKernel::GetDatabaseManager() { swganh::EventDispatcher* SwganhKernel::GetEventDispatcher() { if (!event_dispatcher_) { - event_dispatcher_.reset(new swganh::EventDispatcher(GetIoService())); + event_dispatcher_.reset(new swganh::EventDispatcher(GetCpuThreadPool())); } return event_dispatcher_.get(); @@ -112,8 +113,14 @@ ServiceDirectoryInterface* SwganhKernel::GetServiceDirectory() { return service_directory_.get(); } -boost::asio::io_service& SwganhKernel::GetIoService() { - return io_service_; +boost::asio::io_service& SwganhKernel::GetIoThreadPool() +{ + return io_pool_; +} + +boost::asio::io_service& SwganhKernel::GetCpuThreadPool() +{ + return cpu_pool_; } swganh::tre::ResourceManager* SwganhKernel::GetResourceManager() diff --git a/src/swganh/app/swganh_kernel.h b/src/swganh/app/swganh_kernel.h index e04e9a473..85f33a85a 100644 --- a/src/swganh/app/swganh_kernel.h +++ b/src/swganh/app/swganh_kernel.h @@ -33,7 +33,10 @@ struct AppConfig { std::string galaxy_name; std::string tre_config; uint32_t resource_cache_size; - uint32_t db_threads; + + uint32_t io_threads; + uint32_t cpu_threads; + uint32_t db_threads; /*! * @Brief Contains information about the database config" @@ -69,7 +72,7 @@ struct AppConfig { class SwganhKernel : public swganh::app::KernelInterface { public: - explicit SwganhKernel(boost::asio::io_service& io_service); + explicit SwganhKernel(boost::asio::io_service& io_pool, boost::asio::io_service& cpu_pool); virtual ~SwganhKernel(); void Shutdown(); @@ -88,7 +91,9 @@ class SwganhKernel : public swganh::app::KernelInterface { swganh::service::ServiceDirectoryInterface* GetServiceDirectory(); - boost::asio::io_service& GetIoService(); + boost::asio::io_service& GetIoThreadPool(); + + boost::asio::io_service& GetCpuThreadPool(); swganh::tre::ResourceManager* GetResourceManager(); @@ -104,7 +109,7 @@ class SwganhKernel : public swganh::app::KernelInterface { std::unique_ptr service_directory_; std::unique_ptr resource_manager_; - boost::asio::io_service& io_service_; + boost::asio::io_service &io_pool_, &cpu_pool_; }; }} // namespace swganh::app diff --git a/src/swganh/network/soe/session.cc b/src/swganh/network/soe/session.cc index 3790a98cd..ad085cd63 100644 --- a/src/swganh/network/soe/session.cc +++ b/src/swganh/network/soe/session.cc @@ -17,11 +17,11 @@ using namespace swganh::network; using namespace swganh::network::soe; using namespace std; -Session::Session(ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint) +Session::Session(ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint) : std::enable_shared_from_this() , remote_endpoint_(remote_endpoint) , server_(server) - , strand_(io_service) + , strand_(cpu_pool) , connected_(false) , crc_seed_(0xDEADBABE) , last_acknowledged_sequence_(0) diff --git a/src/swganh/network/soe/session.h b/src/swganh/network/soe/session.h index a92e780b3..4022203bf 100644 --- a/src/swganh/network/soe/session.h +++ b/src/swganh/network/soe/session.h @@ -47,7 +47,7 @@ class Session : public std::enable_shared_from_this { /** * Adds itself to the Session Manager. */ - Session(ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint); + Session(ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint); ~Session(); /** diff --git a/src/swganh_core/combat/buff_manager.cc b/src/swganh_core/combat/buff_manager.cc index be43f63db..a5467d638 100644 --- a/src/swganh_core/combat/buff_manager.cc +++ b/src/swganh_core/combat/buff_manager.cc @@ -21,7 +21,7 @@ using namespace std; BuffManager::BuffManager(swganh::app::SwganhKernel* kernel) : kernel_(kernel) - , timer_(kernel_->GetIoService()) + , timer_(kernel_->GetCpuThreadPool()) {} void BuffManager::Start() diff --git a/src/swganh_core/combat/combat_service.cc b/src/swganh_core/combat/combat_service.cc index 64bad3daa..76da5fcd4 100644 --- a/src/swganh_core/combat/combat_service.cc +++ b/src/swganh_core/combat/combat_service.cc @@ -60,7 +60,7 @@ using swganh::app::SwganhKernel; CombatService::CombatService(SwganhKernel* kernel) : generator_(1, 100) -, active_(kernel->GetIoService()) +, active_(kernel->GetCpuThreadPool()) , kernel_(kernel) , buff_manager_(kernel) { diff --git a/src/swganh_core/command/command_queue.cc b/src/swganh_core/command/command_queue.cc index 4e54ff161..b29f04ccf 100644 --- a/src/swganh_core/command/command_queue.cc +++ b/src/swganh_core/command/command_queue.cc @@ -30,10 +30,10 @@ using swganh::object::Tangible; CommandQueue::CommandQueue( swganh::app::SwganhKernel* kernel) : kernel_(kernel) - , timer_(kernel->GetIoService()) + , timer_(kernel->GetCpuThreadPool()) , processing_(false) , default_command_(nullptr) - , active_(kernel->GetIoService()) + , active_(kernel->GetCpuThreadPool()) { command_service_ = kernel->GetServiceManager()->GetService("CommandService"); } diff --git a/src/swganh_core/connection/connection_client.cc b/src/swganh_core/connection/connection_client.cc index 3f2d2a60e..becec25a7 100644 --- a/src/swganh_core/connection/connection_client.cc +++ b/src/swganh_core/connection/connection_client.cc @@ -14,8 +14,8 @@ using namespace swganh::connection; using namespace swganh::object; using namespace swganh::observer; -ConnectionClient::ConnectionClient(ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint) - : ConnectionClientInterface(server, io_service, remote_endpoint) +ConnectionClient::ConnectionClient(ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint) + : ConnectionClientInterface(server, cpu_pool, remote_endpoint) {} ConnectionClient::State ConnectionClient::GetState() const diff --git a/src/swganh_core/connection/connection_client.h b/src/swganh_core/connection/connection_client.h index 457c9a93a..c8c600066 100644 --- a/src/swganh_core/connection/connection_client.h +++ b/src/swganh_core/connection/connection_client.h @@ -19,7 +19,7 @@ class ConnectionClient : public swganh::connection::ConnectionClientInterface /** * Creates a new instance */ - ConnectionClient(swganh::network::soe::ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint); + ConnectionClient(swganh::network::soe::ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint); /** * @return the current state of this remote client diff --git a/src/swganh_core/connection/connection_client_interface.h b/src/swganh_core/connection/connection_client_interface.h index 3ca5bd4b6..746f721f8 100644 --- a/src/swganh_core/connection/connection_client_interface.h +++ b/src/swganh_core/connection/connection_client_interface.h @@ -26,9 +26,9 @@ class ConnectionClientInterface : public swganh::network::soe::Session DISCONNECTING }; - ConnectionClientInterface(swganh::network::soe::ServerInterface* server, boost::asio::io_service& io_service, + ConnectionClientInterface(swganh::network::soe::ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint) - : Session(server, io_service, remote_endpoint) + : Session(server, cpu_pool, remote_endpoint) { } diff --git a/src/swganh_core/connection/connection_service.cc b/src/swganh_core/connection/connection_service.cc index a1776534f..bc728cfa0 100644 --- a/src/swganh_core/connection/connection_service.cc +++ b/src/swganh_core/connection/connection_service.cc @@ -53,7 +53,7 @@ ConnectionService::ConnectionService( : ConnectionServiceInterface(kernel) , kernel_(kernel) , ping_server_(nullptr) - , active_(kernel->GetIoService()) + , active_(kernel->GetIoThreadPool()) , listen_address_(listen_address) , listen_port_(listen_port) , ping_port_(ping_port) @@ -85,7 +85,7 @@ ServiceDescription ConnectionService::GetServiceDescription() { } void ConnectionService::Startup() { - ping_server_ = make_shared(kernel_->GetIoService(), ping_port_); + ping_server_ = make_shared(kernel_->GetIoThreadPool(), ping_port_); character_service_ = kernel_->GetServiceManager()->GetService("CharacterService"); login_service_ = kernel_->GetServiceManager()->GetService("LoginService"); @@ -128,7 +128,7 @@ shared_ptr ConnectionService::CreateSession(const udp::endpoint& endpoi boost::lock_guard lg(session_map_mutex_); if (session_map_.find(endpoint) == session_map_.end()) { - session = make_shared(this, kernel_->GetIoService(), endpoint); + session = make_shared(this, kernel_->GetCpuThreadPool(), endpoint); session_map_.insert(make_pair(endpoint, session)); LOG(info) << "Created Connection Service Session for " << endpoint.address().to_string(); } diff --git a/src/swganh_core/connection/connection_service_interface.h b/src/swganh_core/connection/connection_service_interface.h index 49ab65584..68343d95a 100644 --- a/src/swganh_core/connection/connection_service_interface.h +++ b/src/swganh_core/connection/connection_service_interface.h @@ -50,7 +50,7 @@ class ConnectionServiceInterface : public swganh::service::ServiceInterface, pub public: ConnectionServiceInterface(swganh::app::SwganhKernel* kernel) - : swganh::network::BaseSwgServer(kernel->GetIoService()) + : swganh::network::BaseSwgServer(kernel->GetIoThreadPool()) { } diff --git a/src/swganh_core/galaxy/galaxy_service.cc b/src/swganh_core/galaxy/galaxy_service.cc index cad32eb4c..f095c9f46 100644 --- a/src/swganh_core/galaxy/galaxy_service.cc +++ b/src/swganh_core/galaxy/galaxy_service.cc @@ -55,7 +55,7 @@ uint64_t GalaxyService::GetGalaxyTimeInMilliseconds() } void GalaxyService::Startup() { - galaxy_timer_ = std::make_shared(kernel_->GetIoService(), boost::posix_time::seconds(10)); + galaxy_timer_ = std::make_shared(kernel_->GetCpuThreadPool(), boost::posix_time::seconds(10)); galaxy_timer_->async_wait(boost::bind(&GalaxyService::GalaxyStatusTimerHandler_, this, boost::asio::placeholders::error, 10)); } diff --git a/src/swganh_core/login/login_client.cc b/src/swganh_core/login/login_client.cc index 4c9445abb..048b111a8 100644 --- a/src/swganh_core/login/login_client.cc +++ b/src/swganh_core/login/login_client.cc @@ -10,8 +10,8 @@ using namespace swganh::login; using namespace swganh::login; LoginClient::LoginClient( - ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint) - : LoginClientInterface(server, io_service, remote_endpoint) + ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint) + : LoginClientInterface(server, cpu_pool, remote_endpoint) {} string LoginClient::GetUsername() const diff --git a/src/swganh_core/login/login_client.h b/src/swganh_core/login/login_client.h index a91fba451..878586626 100644 --- a/src/swganh_core/login/login_client.h +++ b/src/swganh_core/login/login_client.h @@ -9,7 +9,7 @@ namespace login { class LoginClient : public swganh::login::LoginClientInterface { public: - LoginClient(swganh::network::soe::ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint); + LoginClient(swganh::network::soe::ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint); std::string GetUsername() const; void SetUsername(std::string username); diff --git a/src/swganh_core/login/login_client_interface.h b/src/swganh_core/login/login_client_interface.h index b7049927f..bf0ec3bd1 100644 --- a/src/swganh_core/login/login_client_interface.h +++ b/src/swganh_core/login/login_client_interface.h @@ -14,8 +14,8 @@ class Account; class LoginClientInterface : public swganh::network::soe::Session { public: - LoginClientInterface(swganh::network::soe::ServerInterface* server, boost::asio::io_service& io_service, boost::asio::ip::udp::endpoint remote_endpoint) - :Session(server, io_service, remote_endpoint) + LoginClientInterface(swganh::network::soe::ServerInterface* server, boost::asio::io_service& cpu_pool, boost::asio::ip::udp::endpoint remote_endpoint) + :Session(server, cpu_pool, remote_endpoint) { } diff --git a/src/swganh_core/login/login_service.cc b/src/swganh_core/login/login_service.cc index 1174f1261..c76b057fa 100644 --- a/src/swganh_core/login/login_service.cc +++ b/src/swganh_core/login/login_service.cc @@ -49,12 +49,12 @@ using boost::asio::ip::udp; using swganh::app::SwganhKernel; LoginService::LoginService(string listen_address, uint16_t listen_port, SwganhKernel* kernel) - : swganh::login::LoginServiceInterface(kernel->GetIoService()) + : swganh::login::LoginServiceInterface(kernel->GetCpuThreadPool()) , kernel_(kernel) - , galaxy_status_timer_(kernel->GetIoService()) + , galaxy_status_timer_(kernel->GetCpuThreadPool()) , listen_address_(listen_address) , listen_port_(listen_port) - , active_(kernel->GetIoService()) + , active_(kernel->GetCpuThreadPool()) { account_provider_ = kernel->GetPluginManager()->CreateObject("Login::AccountProvider"); @@ -93,7 +93,7 @@ shared_ptr LoginService::CreateSession(const udp::endpoint& endpoint) boost::lock_guard lg(session_map_mutex_); if (session_map_.find(endpoint) == session_map_.end()) { - session = make_shared(this, kernel_->GetIoService(), endpoint); + session = make_shared(this, kernel_->GetCpuThreadPool(), endpoint); session_map_.insert(make_pair(endpoint, session)); } } @@ -274,7 +274,7 @@ void LoginService::HandleLoginClientId_(const std::shared_ptrSendTo(error); - auto timer = std::make_shared(kernel_->GetIoService(), boost::posix_time::seconds(login_error_timeout_secs_)); + auto timer = std::make_shared(kernel_->GetCpuThreadPool(), boost::posix_time::seconds(login_error_timeout_secs_)); timer->async_wait([login_client] (const boost::system::error_code& e) { if (login_client) diff --git a/src/swganh_core/object/object_manager.cc b/src/swganh_core/object/object_manager.cc index 318633f25..6e69d97a8 100644 --- a/src/swganh_core/object/object_manager.cc +++ b/src/swganh_core/object/object_manager.cc @@ -69,7 +69,7 @@ ObjectManager::ObjectManager(swganh::app::SwganhKernel* kernel) //Load slot definitions slot_definition_ = kernel->GetResourceManager()->GetResourceByName("abstract/slot/slot_definition/slot_definitions.iff"); - persist_timer_ = std::make_shared(kernel_->GetIoService(), boost::posix_time::minutes(5)); + persist_timer_ = std::make_shared(kernel_->GetCpuThreadPool(), boost::posix_time::minutes(5)); persist_timer_->async_wait(boost::bind(&ObjectManager::PersistObjectsByTimer, this, boost::asio::placeholders::error)); // Load the highest object_id from the db diff --git a/src/swganh_core/player/player_service.cc b/src/swganh_core/player/player_service.cc index 8a1381bed..45c65c857 100644 --- a/src/swganh_core/player/player_service.cc +++ b/src/swganh_core/player/player_service.cc @@ -121,7 +121,7 @@ void PlayerService::OnPlayerExit(shared_ptr player) player->ClearStatusFlags(); player->AddStatusFlag(swganh::object::LD); // set a timer to 30 seconds to destroy the object, unless logged back in. - auto deadline_timer = std::make_shared(kernel_->GetIoService(), boost::posix_time::seconds(30)); + auto deadline_timer = std::make_shared(kernel_->GetCpuThreadPool(), boost::posix_time::seconds(30)); auto parent = std::static_pointer_cast(player->GetContainer()); auto object_controller = std::static_pointer_cast(parent->GetController()); diff --git a/src/swganh_core/simulation/simulation_service_objects.cc b/src/swganh_core/simulation/simulation_service_objects.cc index bd0a9afcd..f504deba4 100644 --- a/src/swganh_core/simulation/simulation_service_objects.cc +++ b/src/swganh_core/simulation/simulation_service_objects.cc @@ -77,39 +77,20 @@ using namespace swganh::object; void SimulationService::RegisterObjectFactories() { auto object_manager = GetObjectManager(); - - std::promise prom1, prom2, prom3; - std::future fut1=prom1.get_future(), fut2= prom2.get_future(), fut3 = prom3.get_future(); - - kernel_->GetIoService().post([&] () { - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - object_manager->RegisterObjectType(); - prom1.set_value(true); - }); - - kernel_->GetIoService().post([&] () { - object_manager->RegisterObjectType(); - prom2.set_value(true); - }); - - kernel_->GetIoService().post([&] () { - object_manager->RegisterObjectType(); - prom3.set_value(true); - }); - - fut1.wait(); - fut2.wait(); - fut3.wait(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); + object_manager->RegisterObjectType(); } \ No newline at end of file diff --git a/src/swganh_core/spawn/spawn_service.cc b/src/swganh_core/spawn/spawn_service.cc index 77a901195..69fcb7204 100644 --- a/src/swganh_core/spawn/spawn_service.cc +++ b/src/swganh_core/spawn/spawn_service.cc @@ -44,7 +44,7 @@ using namespace swganh::scripting; SpawnService::SpawnService(SwganhKernel* kernel) : kernel_(kernel) , fsm_manager_(kernel->GetEventDispatcher()) - , timer_(kernel_->GetIoService(), boost::posix_time::seconds(60)) + , timer_(kernel_->GetCpuThreadPool(), boost::posix_time::seconds(60)) { } diff --git a/src/swganh_core/static/static_service.cc b/src/swganh_core/static/static_service.cc index 3bea906da..def5e88eb 100644 --- a/src/swganh_core/static/static_service.cc +++ b/src/swganh_core/static/static_service.cc @@ -49,7 +49,7 @@ enum PERSISTENT_NPC_TYPE StaticService::StaticService(SwganhKernel* kernel) : kernel_(kernel) - , active_(kernel->GetIoService()) + , active_(kernel->GetCpuThreadPool()) { //Static Objects kernel_->GetEventDispatcher()->Subscribe("SceneManager:NewScene", [&] (const std::shared_ptr& newEvent) diff --git a/src/swganh_core/weather/weather_service.cc b/src/swganh_core/weather/weather_service.cc index 9a34e8368..d15b61abd 100644 --- a/src/swganh_core/weather/weather_service.cc +++ b/src/swganh_core/weather/weather_service.cc @@ -172,7 +172,7 @@ void WeatherService::tickPlanetWeather_() void WeatherService::RunWeatherSequence() { - weather_timer_ = std::make_shared(kernel_->GetIoService(), boost::posix_time::seconds(10)); + weather_timer_ = std::make_shared(kernel_->GetCpuThreadPool(), boost::posix_time::seconds(10)); weather_timer_->async_wait(boost::bind(&WeatherService::RunWeatherSequenceTimer, this, boost::asio::placeholders::error, 10 )); }