MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / launchGameFromCmdLineOptions

Function launchGameFromCmdLineOptions

src/OpenLoco/src/OpenLoco.cpp:236–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234 }
235
236 static bool launchGameFromCmdLineOptions()
237 {
238 const auto& cmdLineOptions = getCommandLineOptions();
239 try
240 {
241 if (cmdLineOptions.action == CommandLineAction::host)
242 {
243 Network::openServer();
244 return loadFile(cmdLineOptions.path);
245 }
246 else if (cmdLineOptions.action == CommandLineAction::join)
247 {
248 if (cmdLineOptions.port)
249 {
250 return Network::joinServer(cmdLineOptions.address, *cmdLineOptions.port);
251 }
252 else
253 {
254 return Network::joinServer(cmdLineOptions.address);
255 }
256 }
257 else if (!cmdLineOptions.path.empty())
258 {
259 return loadFile(cmdLineOptions.path);
260 }
261 }
262 catch (const std::exception& e)
263 {
264 Logging::error("Unable to load park: {}", e.what());
265 }
266 return false;
267 }
268
269 void sub_431695(uint16_t var_F253A0)
270 {

Callers 1

tickFunction · 0.85

Calls 6

openServerFunction · 0.85
loadFileFunction · 0.85
joinServerFunction · 0.85
errorFunction · 0.85
whatMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected