MCPcopy Create free account
hub / github.com/diasurgical/DevilutionX / InitSingle

Function InitSingle

Source/multi.cpp:444–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444bool InitSingle(GameData *gameData)
445{
446 Players.resize(1);
447
448 if (!SNetInitializeProvider(SELCONN_LOOPBACK, gameData)) {
449 return false;
450 }
451
452 int unused = 0;
453 GameData gameInitInfo = sgGameInitInfo;
454 gameInitInfo.swapLE();
455 if (!SNetCreateGame("local", "local", reinterpret_cast<char *>(&gameInitInfo), sizeof(gameInitInfo), &unused)) {
456 app_fatal(StrCat("SNetCreateGame1:\n", SDL_GetError()));
457 }
458
459 MyPlayerId = 0;
460 MyPlayer = &Players[MyPlayerId];
461 InspectPlayer = MyPlayer;
462 gbIsMultiplayer = false;
463
464 pfile_read_player_from_save(gSaveNumber, *MyPlayer);
465
466 return true;
467}
468
469bool InitMulti(GameData *gameData)
470{

Callers 1

NetInitFunction · 0.85

Calls 6

SNetInitializeProviderFunction · 0.85
SNetCreateGameFunction · 0.85
app_fatalFunction · 0.85
StrCatFunction · 0.85
swapLEMethod · 0.80

Tested by

no test coverage detected