MCPcopy Create free account
hub / github.com/crownengine/crown / process_request

Method process_request

src/device/save_game.cpp:450–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448
449 ///
450 void process_request(Request &rr)
451 {
452 CE_ENSURE(!rr.done.load());
453 rr.progress.store(0.0f);
454 rr.error.store(SaveError::SUCCESS);
455
456#if CROWN_PLATFORM_EMSCRIPTEN
457 if (!html5_spin_until(html5_save_game_ready))
458 return;
459
460 if (!html5_save_game_ok()) {
461 rr.progress.store(1.0f);
462 rr.error.store(SaveError::IO_ERROR);
463 rr.done.store(true);
464 return;
465 }
466#endif
467
468 s32 result = rr.type == SaveGame::Request::LOAD
469 ? read_request(rr)
470 : write_request(rr)
471 ;
472
473#if CROWN_PLATFORM_EMSCRIPTEN
474 if (result == SaveError::SUCCESS && rr.type == SaveGame::Request::SAVE) {
475 html5_save_game_flush();
476 if (!html5_spin_until([]{ return !html5_save_game_syncing(); }))
477 return;
478
479 if (!html5_save_game_flush_ok())
480 result = SaveError::IO_ERROR;
481 }
482#endif
483
484 rr.progress.store(1.0f);
485 rr.error.store(result);
486 rr.done.store(true);
487 }
488
489 ///
490 s32 run()

Callers

nothing calls this directly

Calls 6

html5_save_game_okFunction · 0.85
html5_save_game_flushFunction · 0.85
html5_save_game_syncingFunction · 0.85
html5_save_game_flush_okFunction · 0.85
loadMethod · 0.45
storeMethod · 0.45

Tested by

no test coverage detected