mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Significant changes to saving system. Now both client and server store their lib part.
Desync detection upon loading. Fixed many desyncs. (more remain) Monsters won't have creature count 0 even if that is set as creature properties.
This commit is contained in:
@ -781,12 +781,32 @@ void SaveGame::applyCl(CClient *cl)
|
||||
try
|
||||
{
|
||||
CSaveFile save(CResourceHandler::get()->getResourceName(ResourceID(info.getStem(), EResType::CLIENT_SAVEGAME)));
|
||||
cl->saveCommonState(save);
|
||||
save << *cl;
|
||||
}
|
||||
catch(std::exception &e)
|
||||
{
|
||||
tlog1 << "Failed to save game:" << e.what() << std::endl;
|
||||
}
|
||||
|
||||
// try
|
||||
// {
|
||||
// auto clientPart = CResourceHandler::get()->getResourceName(ResourceID(info.getStem(), EResType::CLIENT_SAVEGAME));
|
||||
// auto libPart = CResourceHandler::get()->getResourceName(ResourceID(info.getStem(), EResType::LIB_SAVEGAME));
|
||||
// CLoadIntegrityValidator checker(clientPart, libPart);
|
||||
//
|
||||
// CMapHeader mh;
|
||||
// StartInfo *si;
|
||||
// LibClasses *lib;
|
||||
// CGameState *game;
|
||||
//
|
||||
// checker.checkMagicBytes(SAVEGAME_MAGIC);
|
||||
// checker >> mh >> si >> lib >> game;
|
||||
// }
|
||||
// catch(...)
|
||||
// {
|
||||
// tlog1 << "Desync!!!\n";
|
||||
// }
|
||||
}
|
||||
|
||||
void PlayerMessage::applyCl(CClient *cl)
|
||||
|
Reference in New Issue
Block a user