MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / startServer

Method startServer

source/ODApplication.cpp:68–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void 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
97void ODApplication::startClient()
98{

Callers

nothing calls this directly

Calls 3

initializeFunction · 0.85
waitEndGameMethod · 0.80
stopServerMethod · 0.45

Tested by

no test coverage detected