| 66 | } |
| 67 | |
| 68 | void ODApplication::startServer() |
| 69 | { |
| 70 | ResourceManager& resMgr = ResourceManager::getSingleton(); |
| 71 | |
| 72 | OD_LOG_INF("Initializing"); |
| 73 | |
| 74 | Random::initialize(); |
| 75 | ConfigManager configManager(resMgr.getConfigPath(), "", resMgr.getSoundPath()); |
| 76 | OD_LOG_INF("Launching server"); |
| 77 | |
| 78 | const std::string& creator = resMgr.getServerModeCreator(); |
| 79 | |
| 80 | ODServer server; |
| 81 | if(!server.startServer(creator, resMgr.getServerModeLevel(), ServerMode::ModeGameMultiPlayer, !creator.empty())) |
| 82 | { |
| 83 | OD_LOG_ERR("Could not start server !!!"); |
| 84 | return; |
| 85 | } |
| 86 | |
| 87 | if(!server.waitEndGame()) |
| 88 | { |
| 89 | OD_LOG_ERR("Could not wait for end of game !!!"); |
| 90 | return; |
| 91 | } |
| 92 | |
| 93 | OD_LOG_INF("Stopping server..."); |
| 94 | server.stopServer(); |
| 95 | } |
| 96 | |
| 97 | void ODApplication::startClient() |
| 98 | { |
nothing calls this directly
no test coverage detected