Emscripten powershell build script updated to properly terminate on errors. Add in proper throws when an invalid response is given from the server. Add in function response callbacks to all server request functions.
This commit is contained in:
@@ -58,7 +58,19 @@ void Menu::InitializeMainMenuWindow(){
|
||||
})END;
|
||||
mainMenuWindow->ADD("Load Game Button",MenuComponent)({{12,36},{72,24}},"Load Game",[](MenuFuncData data){
|
||||
SaveFile::UpdateSaveGameData();
|
||||
Menu::OpenMenu(LOAD_GAME);
|
||||
#ifdef __EMSCRIPTEN__
|
||||
SaveFile::Server_GetLoadInfo([](std::string_view response){
|
||||
if(response!="ERR"){
|
||||
std::ofstream file("save_file_path"_S+"metadata.dat");
|
||||
file<<response;
|
||||
Menu::OpenMenu(LOAD_GAME);
|
||||
}else{
|
||||
std::cout<<"WARNING! Failed to retrieve load game information from the server!"<<std::endl;
|
||||
}
|
||||
});
|
||||
#else
|
||||
Menu::OpenMenu(LOAD_GAME);
|
||||
#endif
|
||||
return true;
|
||||
})END;
|
||||
mainMenuWindow->ADD("Quit Game Button",MenuComponent)({{12,68},{72,24}},"Quit Game",[](MenuFuncData data){
|
||||
|
||||
Reference in New Issue
Block a user