1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Merged server savegame and (broken and unused) client savegame files

This commit is contained in:
Ivan Savenko
2023-07-09 15:30:47 +03:00
parent fa4a0004b2
commit 8750aa2c5b
12 changed files with 11 additions and 65 deletions

View File

@@ -856,26 +856,6 @@ void ApplyClientNetPackVisitor::visitYourTurn(YourTurn & pack)
callOnlyThatInterface(cl, pack.player, &CGameInterface::yourTurn);
}
void ApplyClientNetPackVisitor::visitSaveGameClient(SaveGameClient & pack)
{
const auto stem = FileInfo::GetPathStem(pack.fname);
if(!CResourceHandler::get("local")->createResource(stem.to_string() + ".vcgm1"))
{
logNetwork->error("Failed to create resource %s", stem.to_string() + ".vcgm1");
return;
}
try
{
CSaveFile save(*CResourceHandler::get()->getResourceName(ResourceID(stem.to_string(), EResType::CLIENT_SAVEGAME)));
save << cl;
}
catch(std::exception &e)
{
logNetwork->error("Failed to save game:%s", e.what());
}
}
void ApplyClientNetPackVisitor::visitPlayerMessageClient(PlayerMessageClient & pack)
{
logNetwork->debug("pack.player %s sends a message: %s", pack.player.getStr(), pack.text);