mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-17 00:07:41 +02:00
Fix client build
* use regular overloaded methods for client serialization. (serialize template not needed if connection.h already included and save/load code is different)
This commit is contained in:
@ -493,11 +493,10 @@ void CClient::newGame( CConnection *con, StartInfo *si )
|
||||
// }
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void CClient::serialize( Handler &h, const int version )
|
||||
void CClient::serialize(COSer & h, const int version)
|
||||
{
|
||||
h & hotSeat;
|
||||
if(h.saving)
|
||||
assert(h.saving);
|
||||
h & hotSeat;
|
||||
{
|
||||
ui8 players = playerint.size();
|
||||
h & players;
|
||||
@ -507,11 +506,15 @@ void CClient::serialize( Handler &h, const int version )
|
||||
LOG_TRACE_PARAMS(logGlobal, "Saving player %s interface", i->first);
|
||||
assert(i->first == i->second->playerID);
|
||||
h & i->first & i->second->dllName & i->second->human;
|
||||
i->second->saveGame(dynamic_cast<COSer & >(h), version);
|
||||
//evil cast that i still like better than sfinae-magic. If I had a "static if"...
|
||||
i->second->saveGame(h, version);
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
void CClient::serialize(CISer & h, const int version)
|
||||
{
|
||||
assert(!h.saving);
|
||||
h & hotSeat;
|
||||
{
|
||||
ui8 players = 0; //fix for uninitialized warning
|
||||
h & players;
|
||||
@ -551,7 +554,7 @@ void CClient::serialize( Handler &h, const int version )
|
||||
nInt->playerID = pid;
|
||||
|
||||
installNewPlayerInterface(nInt, pid);
|
||||
nInt->loadGame(dynamic_cast<CISer & >(h), version); //another evil cast, check above
|
||||
nInt->loadGame(h, version); //another evil cast, check above
|
||||
}
|
||||
|
||||
if(!vstd::contains(battleints, PlayerColor::NEUTRAL))
|
||||
@ -559,11 +562,10 @@ void CClient::serialize( Handler &h, const int version )
|
||||
}
|
||||
}
|
||||
|
||||
template <typename Handler>
|
||||
void CClient::serialize( Handler &h, const int version, const std::set<PlayerColor>& playerIDs)
|
||||
void CClient::serialize(COSer & h, const int version, const std::set<PlayerColor> & playerIDs)
|
||||
{
|
||||
assert(h.saving);
|
||||
h & hotSeat;
|
||||
if(h.saving)
|
||||
{
|
||||
ui8 players = playerint.size();
|
||||
h & players;
|
||||
@ -573,11 +575,15 @@ void CClient::serialize( Handler &h, const int version, const std::set<PlayerCol
|
||||
LOG_TRACE_PARAMS(logGlobal, "Saving player %s interface", i->first);
|
||||
assert(i->first == i->second->playerID);
|
||||
h & i->first & i->second->dllName & i->second->human;
|
||||
i->second->saveGame(dynamic_cast<COSer & >(h), version);
|
||||
//evil cast that i still like better than sfinae-magic. If I had a "static if"...
|
||||
i->second->saveGame(h, version);
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
|
||||
void CClient::serialize(CISer & h, const int version, const std::set<PlayerColor> & playerIDs)
|
||||
{
|
||||
assert(!h.saving);
|
||||
h & hotSeat;
|
||||
{
|
||||
ui8 players = 0; //fix for uninitialized warning
|
||||
h & players;
|
||||
@ -620,7 +626,7 @@ void CClient::serialize( Handler &h, const int version, const std::set<PlayerCol
|
||||
if(playerIDs.count(pid))
|
||||
installNewPlayerInterface(nInt, pid);
|
||||
|
||||
nInt->loadGame(dynamic_cast<CISer & >(h), version); //another evil cast, check above
|
||||
nInt->loadGame(h, version);
|
||||
}
|
||||
|
||||
if(playerIDs.count(PlayerColor::NEUTRAL))
|
||||
@ -901,8 +907,6 @@ std::string CClient::aiNameForPlayer(const PlayerSettings &ps, bool battleAI)
|
||||
return goodAI;
|
||||
}
|
||||
|
||||
template void CClient::serialize(CISer & h, const int version);
|
||||
template void CClient::serialize(COSer & h, const int version);
|
||||
|
||||
void CServerHandler::startServer()
|
||||
{
|
||||
|
Reference in New Issue
Block a user