MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xSGAsyncStatus

Function xSGAsyncStatus

src/SB/Core/x/xsavegame.cpp:638–692  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638en_XSGASYNC_STATUS xSGAsyncStatus(st_XSAVEGAME_DATA* xsgdata, S32 block, en_XSG_WHYFAIL* whyFail,
639 char* errmsg)
640{
641 en_XSGASYNC_STATUS xstat = XSG_ASTAT_NOOP;
642 en_ASYNC_OPERR whyerr = ISG_OPERR_NONE;
643
644 if (errmsg != NULL)
645 {
646 errmsg[0] = '\0';
647 }
648
649 en_ASYNC_OPSTAT istat = iSGPollStatus(xsgdata->isgsess, 0, block);
650 switch (istat)
651 {
652 case ISG_OPSTAT_FAILURE:
653 xstat = XSG_ASTAT_FAILED;
654 whyerr = iSGOpError(xsgdata->isgsess, errmsg);
655 break;
656 case ISG_OPSTAT_INPROG:
657 xstat = XSG_ASTAT_INPROG;
658 break;
659 case ISG_OPSTAT_SUCCESS:
660 xstat = XSG_ASTAT_SUCCESS;
661 break;
662 }
663
664 if (whyFail != NULL && whyerr != ISG_OPERR_NONE)
665 {
666 en_XSG_WHYFAIL con = XSG_WHYERR_NONE;
667
668 switch (whyerr)
669 {
670 case ISG_OPERR_NONE:
671 break;
672 case ISG_OPERR_NOCARD:
673 con = XSG_WHYERR_NOCARD;
674 break;
675 case ISG_OPERR_NOROOM:
676 case ISG_OPERR_SVNOSPACE:
677 con = XSG_WHYERR_NOROOM;
678 break;
679 case ISG_OPERR_DAMAGE:
680 con = XSG_WHYERR_DAMAGE;
681 break;
682 case ISG_OPERR_SVWRITE:
683 con = XSG_WHYERR_CARDYANKED;
684 break;
685 default:
686 con = XSG_WHYERR_OTHER;
687 break;
688 }
689 *whyFail = con;
690 }
691 return xstat;
692}
693
694S32 xSG_cb_leader_svinfo(void*, st_XSAVEGAME_DATA*, S32* cur_space, S32* max_fullgame)
695{

Callers 3

zSaveLoad_DoAutoSaveFunction · 0.50
zSaveLoad_SaveGameFunction · 0.50
zSaveLoad_LoadGameFunction · 0.50

Calls 2

iSGOpErrorFunction · 0.85
iSGPollStatusFunction · 0.50

Tested by

no test coverage detected