| 152 | } |
| 153 | |
| 154 | int initGame() |
| 155 | { |
| 156 | // setup some lists |
| 157 | booksRead.first = NULL; |
| 158 | booksRead.last = NULL; |
| 159 | lobbyChatboxMessages.first = NULL; |
| 160 | lobbyChatboxMessages.last = NULL; |
| 161 | |
| 162 | // steam stuff |
| 163 | #ifdef STEAMWORKS |
| 164 | cpp_SteamServerWrapper_Instantiate(); //TODO: Remove these wrappers. |
| 165 | cpp_SteamServerClientWrapper_Instantiate(); |
| 166 | |
| 167 | cpp_SteamServerClientWrapper_OnP2PSessionRequest = &steam_OnP2PSessionRequest; |
| 168 | //cpp_SteamServerClientWrapper_OnGameOverlayActivated = &steam_OnGameOverlayActivated; |
| 169 | cpp_SteamServerClientWrapper_OnLobbyCreated = &steam_OnLobbyCreated; |
| 170 | cpp_SteamServerClientWrapper_OnGameJoinRequested = &steam_OnGameJoinRequested; |
| 171 | cpp_SteamServerClientWrapper_OnLobbyEntered = &steam_OnLobbyEntered; |
| 172 | cpp_SteamServerClientWrapper_GameServerPingOnServerResponded = &steam_GameServerPingOnServerResponded; |
| 173 | cpp_SteamServerClientWrapper_OnLobbyMatchListCallback = &steam_OnLobbyMatchListCallback; |
| 174 | cpp_SteamServerClientWrapper_OnP2PSessionConnectFail = &steam_OnP2PSessionConnectFail; |
| 175 | cpp_SteamServerClientWrapper_OnLobbyDataUpdate = &steam_OnLobbyDataUpdatedCallback; |
| 176 | #ifdef USE_EOS |
| 177 | cpp_SteamServerClientWrapper_OnRequestEncryptedAppTicket = &steam_OnRequestEncryptedAppTicket; |
| 178 | #endif //USE_EOS |
| 179 | #endif |
| 180 | #ifdef USE_PLAYFAB |
| 181 | playfabUser.init(); |
| 182 | #endif |
| 183 | |
| 184 | initGameControllers(); |
| 185 | |
| 186 | // another loading screen! |
| 187 | updateLoadingScreen(90); |
| 188 | doLoadingScreen(); |
| 189 | |
| 190 | // load item types |
| 191 | initGameDatafiles(false); |
| 192 | |
| 193 | std::atomic_bool loading_done {false}; |
| 194 | auto loading_task = std::async(std::launch::async, [&loading_done](){ |
| 195 | updateLoadingScreen(92); |
| 196 | initGameDatafilesAsync(false); |
| 197 | #ifdef NINTENDO |
| 198 | const auto playerMaleNames = BASE_DATA_DIR + std::string("/") + PLAYERNAMES_MALE_FILE; |
| 199 | const auto playerFemaleNames = BASE_DATA_DIR + std::string("/") + PLAYERNAMES_FEMALE_FILE; |
| 200 | const auto npcMaleNames = BASE_DATA_DIR + std::string("/") + NPCNAMES_MALE_FILE; |
| 201 | const auto npcFemaleNames = BASE_DATA_DIR + std::string("/") + NPCNAMES_FEMALE_FILE; |
| 202 | randomPlayerNamesMale = getLinesFromDataFile(playerMaleNames); |
| 203 | randomPlayerNamesFemale = getLinesFromDataFile(playerFemaleNames); |
| 204 | randomNPCNamesMale = getLinesFromDataFile(npcMaleNames); |
| 205 | randomNPCNamesFemale = getLinesFromDataFile(npcFemaleNames); |
| 206 | #endif // NINTENDO |
| 207 | |
| 208 | updateLoadingScreen(94); |
| 209 | |
| 210 | //#ifdef NINTENDO_DEBUG |
| 211 | //enabledDLCPack1 = true; |
no test coverage detected