mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Removed useless CPack::type field.
* it was an ancient network protocol artifact
This commit is contained in:
parent
ebb88f4133
commit
dc39fb2d14
@ -30,11 +30,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
template <ui16 N> bool isType(CPack *pack)
|
||||
{
|
||||
return pack->getType() == N;
|
||||
}
|
||||
|
||||
bool CCallback::teleportHero(const CGHeroInstance *who, const CGTownInstance *where)
|
||||
{
|
||||
CastleTeleportHero pack(who->id, where->id, 1);
|
||||
|
@ -673,8 +673,7 @@ void CClient::handlePack( CPack * pack )
|
||||
}
|
||||
else
|
||||
{
|
||||
logNetwork->error("Message cannot be applied, cannot find applier! type %d - %s",
|
||||
pack->type, typeList.getTypeInfo(pack)->name());
|
||||
logNetwork->error("Message %s cannot be applied, cannot find applier!", typeList.getTypeInfo(pack)->name());
|
||||
}
|
||||
delete pack;
|
||||
}
|
||||
|
@ -467,26 +467,6 @@ void SetHeroesInTown::applyCl(CClient *cl)
|
||||
}
|
||||
}
|
||||
|
||||
// void SetHeroArtifacts::applyCl(CClient *cl)
|
||||
// {
|
||||
// // CGHeroInstance *h = GS(cl)->getHero(hid);
|
||||
// // CGameInterface *player = (vstd::contains(cl->playerint,h->tempOwner) ? cl->playerint[h->tempOwner] : nullptr);
|
||||
// // if(!player)
|
||||
// // return;
|
||||
//
|
||||
// //h->recreateArtBonuses();
|
||||
// //player->heroArtifactSetChanged(h);
|
||||
//
|
||||
// // for(Bonus bonus : gained)
|
||||
// // {
|
||||
// // player->heroBonusChanged(h,bonus,true);
|
||||
// // }
|
||||
// // for(Bonus bonus : lost)
|
||||
// // {
|
||||
// // player->heroBonusChanged(h,bonus,false);
|
||||
// // }
|
||||
// }
|
||||
|
||||
void HeroRecruited::applyCl(CClient *cl)
|
||||
{
|
||||
CGHeroInstance *h = GS(cl)->map->heroesOnMap.back();
|
||||
|
442
lib/NetPacks.h
442
lib/NetPacks.h
File diff suppressed because it is too large
Load Diff
@ -24,18 +24,16 @@ struct ArtSlotInfo;
|
||||
|
||||
struct DLL_LINKAGE CPack
|
||||
{
|
||||
ui16 type;
|
||||
|
||||
CPack() {};
|
||||
virtual ~CPack() {};
|
||||
ui16 getType() const { return type; }
|
||||
|
||||
template <typename Handler> void serialize(Handler &h, const int version)
|
||||
{
|
||||
logNetwork->errorStream() << "CPack serialized... this should not happen!";
|
||||
assert(false && "CPack serialized");
|
||||
}
|
||||
void applyGs(CGameState *gs) { }
|
||||
virtual std::string toString() const { return boost::str(boost::format("{CPack: type '%d'}") % type); }
|
||||
virtual std::string toString() const { return boost::str(boost::format("{CPack: type '%s'}") % typeid(this).name()); }
|
||||
};
|
||||
|
||||
std::ostream & operator<<(std::ostream & out, const CPack * pack);
|
||||
|
@ -63,7 +63,6 @@ DLL_LINKAGE void SetSecSkill::applyGs(CGameState *gs)
|
||||
hero->setSecSkillLevel(which, val, abs);
|
||||
}
|
||||
|
||||
|
||||
DLL_LINKAGE SelectMap::SelectMap(const CMapInfo &src)
|
||||
{
|
||||
mapInfo = &src;
|
||||
@ -237,6 +236,7 @@ DLL_LINKAGE void FoWChange::applyGs(CGameState *gs)
|
||||
team->fogOfWarMap[t.x][t.y][t.z] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
DLL_LINKAGE void SetAvailableHeroes::applyGs(CGameState *gs)
|
||||
{
|
||||
PlayerState *p = gs->getPlayer(player);
|
||||
@ -1300,7 +1300,7 @@ DLL_LINKAGE void BattleTriggerEffect::applyGs(CGameState *gs)
|
||||
st->state.insert(EBattleStackState::FEAR);
|
||||
break;
|
||||
default:
|
||||
logNetwork->warnStream() << "Unrecognized trigger effect type "<< type;
|
||||
logNetwork->warnStream() << "Unrecognized trigger effect type "<< effect;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1687,7 +1687,6 @@ DLL_LINKAGE void ObstaclesRemoved::applyGs(CGameState *gs)
|
||||
|
||||
DLL_LINKAGE CatapultAttack::CatapultAttack()
|
||||
{
|
||||
type = 3015;
|
||||
}
|
||||
|
||||
DLL_LINKAGE CatapultAttack::~CatapultAttack()
|
||||
|
@ -233,12 +233,10 @@ void registerTypesClientPacks1(Serializer &s)
|
||||
s.template registerType<CPackForClient, ChangeFormation>();
|
||||
s.template registerType<CPackForClient, RemoveObject>();
|
||||
s.template registerType<CPackForClient, TryMoveHero>();
|
||||
//s.template registerType<CPackForClient, SetGarrisons>();
|
||||
s.template registerType<CPackForClient, NewStructures>();
|
||||
s.template registerType<CPackForClient, RazeStructures>();
|
||||
s.template registerType<CPackForClient, SetAvailableCreatures>();
|
||||
s.template registerType<CPackForClient, SetHeroesInTown>();
|
||||
//s.template registerType<CPackForClient, SetHeroArtifacts>();
|
||||
s.template registerType<CPackForClient, HeroRecruited>();
|
||||
s.template registerType<CPackForClient, GiveHero>();
|
||||
s.template registerType<CPackForClient, NewTurn>();
|
||||
|
@ -26,7 +26,6 @@ struct BattleAttack;
|
||||
struct BattleStackAttacked;
|
||||
struct CPack;
|
||||
struct Query;
|
||||
struct SetGarrisons;
|
||||
struct SetResource;
|
||||
struct SetResources;
|
||||
struct NewStructures;
|
||||
|
Loading…
Reference in New Issue
Block a user