Make sure that modules were loaded before acknowledging that server is running

This commit is contained in:
mrkubax10 2023-10-15 11:37:48 +02:00
parent 23a7a9fd40
commit 62c85aeb66

View File

@ -72,8 +72,6 @@ Server::Server(std::atomic<bool>* running_atomic, std::optional<unsigned short>
m_command_thread.reset(new std::thread(&Server::command_thread_func, this));
}
m_mod_manager.enumerate_modules();
m_running->store(true);
m_player_update_thread.reset(new std::thread(&Server::player_update_thread_func, this));
}
Server::~Server() {
@ -90,6 +88,8 @@ Server::~Server() {
void Server::run() {
m_mod_manager.run_modules();
m_running->store(true);
m_player_update_thread.reset(new std::thread(&Server::player_update_thread_func, this));
polygun::network::NetworkPacket packet;
while(m_running->load()) {
bool handled = false;