diff --git a/AI/GeniusAI/genius.vcproj b/AI/GeniusAI/genius.vcproj index b9b4bae9e..4757eb8f9 100644 --- a/AI/GeniusAI/genius.vcproj +++ b/AI/GeniusAI/genius.vcproj @@ -49,6 +49,7 @@ UsePrecompiledHeader="0" WarningLevel="4" DebugInformationFormat="4" + DisableSpecificWarnings="4512" /> animLengths; - std::map increments; int maxLen = 0; for(size_t g=0; gsetType(5); //death - animLen = creAnims[attackedInfos[g].ID]->framesInGroup(5); } else { creAnims[attackedInfos[g].ID]->setType(3); //getting hit - animLen = creAnims[attackedInfos[g].ID]->framesInGroup(3); - } - animLengths.insert(std::make_pair(attackedInfos[g].ID, animLen)); - increments.insert(std::make_pair(attackedInfos[g].ID, 0)); - if(animLen > maxLen) - { - maxLen = animLen; } } //main showing loop @@ -1201,18 +1190,17 @@ void CBattleInterface::stacksAreAttacked(std::vectormainFPSmng); for(size_t g=0; gonLastFrameInGroup()) { creAnims[attackedInfos[g].ID]->incrementFrame(); - ++(increments[attackedInfos[g].ID]); } - if(increments[attackedInfos[g].ID]>=animLengths[attackedInfos[g].ID] && creAnims[attackedInfos[g].ID]->getType() == 3) + if(creAnims[attackedInfos[g].ID]->onLastFrameInGroup() && creAnims[attackedInfos[g].ID]->getType() == 3) creAnims[attackedInfos[g].ID]->setType(2); } bool isAnotherOne = false; //if true, there is a stack whose hit/death anim must be continued for(size_t g=0; gonLastFrameInGroup()) { isAnotherOne = true; break; @@ -2245,9 +2233,12 @@ void CBattleHero::show(SDL_Surface *to) { SDL_Rect posb = pos; CSDL_Ext::blit8bppAlphaTo24bpp(dh->ourImages[i].bitmap, NULL, to, &posb); - if(phase != 4 || image != 4) + if(phase != 4 || nextPhase != -1 || image < 4) { - ++image; + if(flagAnimCount%2==0) + { + ++image; + } if(dh->ourImages[(i+1)%dh->ourImages.size()].groupNumber!=phase) //back to appropriate frame { image = 0; @@ -2256,6 +2247,7 @@ void CBattleHero::show(SDL_Surface *to) if(phase == 4 && nextPhase != -1 && image == 7) { phase = nextPhase; + nextPhase = -1; image = 0; } break; @@ -2281,14 +2273,13 @@ void CBattleHero::setPhase(int newPhase) } else { - ++image; nextPhase = newPhase; } } void CBattleHero::clickLeft(boost::logic::tribool down) { - if(!down && myHero && myHero->getArt(17)) + if(!down && myHero) if(myHero->getArt(17)) //if both conditions are satisfied; for certain reason myHero->getArt(17) has been checked once even though myHero was NULL { for(int it=0; it #include #include + +#include "lib/RegisterTypes.h" boost::rand48 ran; @@ -30,6 +33,38 @@ boost::rand48 ran; #undef max #endif +class CBaseForGSApply +{ +public: + virtual void applyOnGS(CGameState *gs, void *pack) const =0; +}; +template class CApplyOnGS : public CBaseForGSApply +{ +public: + void applyOnGS(CGameState *gs, void *pack) const + { + T *ptr = static_cast(pack); + ptr->applyGs(gs); + } +}; + +class CGSApplier +{ +public: + std::map apps; + + CGSApplier() + { + registerTypes2(*this); + } + template void registerType(const T * t=NULL) + { + ui16 ID = typeList.registerType(&typeid(T)); + apps[ID] = new CApplyOnGS; + } + +} applier; + std::string DLL_EXPORT toString(MetaString &ms) { std::string ret; @@ -1434,6 +1469,11 @@ int CGameState::canBuildStructure( const CGTownInstance *t, int ID ) return ret; } +void CGameState::apply(CPack *pack) +{ + applier.apps[typeList.getTypeID(pack)]->applyOnGS(this,pack); +} + int BattleInfo::calculateDmg(const CStack* attacker, const CStack* defender, const CGHeroInstance * attackerHero, const CGHeroInstance * defendingHero, bool shooting) { int attackerAttackBonus = attacker->creature->attack + (attackerHero ? attackerHero->getPrimSkillLevel(0) : 0); diff --git a/CGameState.h b/CGameState.h index cc06a2fb2..a75aa1325 100644 --- a/CGameState.h +++ b/CGameState.h @@ -35,6 +35,7 @@ class CMapHandler; class CPathfinder; struct SetObjectProperty; struct MetaString; +struct CPack; std::string DLL_EXPORT toString(MetaString &ms); @@ -228,6 +229,7 @@ public: void randomizeObject(CGObjectInstance *cur); std::pair pickObject(CGObjectInstance *obj); int pickHero(int owner); + void apply(CPack *pack); CGHeroInstance *getHero(int objid); CGTownInstance *getTown(int objid); bool battleMoveCreatureStack(int ID, int dest); diff --git a/CMT.cpp b/CMT.cpp index d9c79127d..998e2cef6 100644 --- a/CMT.cpp +++ b/CMT.cpp @@ -27,7 +27,6 @@ #include "CAdvmapInterface.h" #include "hch/CBuildingHandler.h" #include "hch/CVideoHandler.h" -#include "hch/CAbilityHandler.h" #include "hch/CHeroHandler.h" #include "hch/CCreatureHandler.h" #include "hch/CSpellHandler.h" @@ -123,10 +122,6 @@ int main(int argc, char** argv) cgi->curh->initCursor(); cgi->curh->show(); tlog0<<"\tScreen handler: "<loadAbilities(); - cgi->abilh = abilh; - tlog0<<"\tAbility handler: "<pathf = new CPathfinder(); tlog0<<"\tPathfinder: "< > frameGroups; //groups of frames; [groupID] -> vector of frame IDs in group public: + std::map > frameGroups; //groups of frames; [groupID] -> vector of frame IDs in group int type; //type of animation being displayed (-1 - whole animation, >0 - specified part [default: -1]) int fullWidth, fullHeight; //read-only, please! CCreatureAnimation(std::string name); //c-tor @@ -50,6 +50,7 @@ public: int nextFrameMiddle(SDL_Surface * dest, int x, int y, bool attacker, unsigned char animCount, bool IncrementFrame = true, bool yellowBorder = false, bool blueBorder = false, SDL_Rect * destRect = NULL); //0 - success, any other - error //print next void incrementFrame(); int getFrame() const; + bool onLastFrameInGroup(); bool once; void playOnce(int type); //plays once given stage of animation, then resets to 2 diff --git a/client/Client.cpp b/client/Client.cpp index 40ceac3cf..64fa66b0b 100644 --- a/client/Client.cpp +++ b/client/Client.cpp @@ -25,9 +25,51 @@ #include #include #include + +#undef DLL_EXPORT +#define DLL_EXPORT +#include "../lib/RegisterTypes.h" extern std::string NAME; namespace intpr = boost::interprocess; +class CBaseForCLApply +{ +public: + virtual void applyOnClAfter(CClient *cl, void *pack) const =0; + virtual void applyOnClBefore(CClient *cl, void *pack) const =0; +}; +template class CApplyOnCL : public CBaseForCLApply +{ +public: + void applyOnClAfter(CClient *cl, void *pack) const + { + T *ptr = static_cast(pack); + ptr->applyCl(cl); + } + void applyOnClBefore(CClient *cl, void *pack) const + { + T *ptr = static_cast(pack); + ptr->applyFirstCl(cl); + } +}; + +class CCLApplier +{ +public: + std::map apps; + + CCLApplier() + { + registerTypes2(*this); + } + template void registerType(const T * t=NULL) + { + ui16 ID = typeList.registerType(&typeid(T)); + apps[ID] = new CApplyOnCL; + } + +} applier; + void CClient::init() { IObjectInterface::cb = this; @@ -53,38 +95,6 @@ CClient::~CClient(void) { delete shared; } -void CClient::process(int what) -{ - switch (what) - { - case 107: - { - ShowInInfobox sii; - *serv >> sii; - SComponent sc(sii.c); - sc.description = toString(sii.text); - if(playerint[sii.player]->human) - static_cast(playerint[sii.player])->showComp(sc); - break; - } - case 513: - { - ui8 color; - std::string message; - *serv >> color >> message; - tlog4 << "Player "<<(int)color<<" sends a message: " << message << std::endl; - break; - } - case 9999: - break; - default: - { - std::ostringstream ex; - ex << "Not supported server message (type=" << what <<")"; - throw ex.str(); - } - } -} void CClient::waitForMoveAndSend(int color) { try @@ -97,14 +107,18 @@ void CClient::waitForMoveAndSend(int color) } void CClient::run() { + CPack *pack; try { - ui16 typ; - while(1) - { - *serv >> typ; - process(typ); - } + *serv >> pack; + CBaseForCLApply *apply = applier.apps[typeList.getTypeID(pack)]; + + apply->applyOnClBefore(this,pack); + gs->apply(pack); + apply->applyOnClAfter(this,pack); + + delete pack; + pack = NULL; } HANDLE_EXCEPTION } diff --git a/client/Client.h b/client/Client.h index edf632342..0d4c70f2b 100644 --- a/client/Client.h +++ b/client/Client.h @@ -59,7 +59,6 @@ public: void newGame(CConnection *con, StartInfo *si); //con - connection to server void save(const std::string & fname); void load(const std::string & fname); - void process(int what); void run(); ////////////////////////////////////////////////////////////////////////// //from IGameCallback diff --git a/client/VCMI_client.vcproj b/client/VCMI_client.vcproj index c4be0bda1..6dc362fab 100644 --- a/client/VCMI_client.vcproj +++ b/client/VCMI_client.vcproj @@ -274,10 +274,6 @@ RelativePath="..\AdventureMapButton.cpp" > - - @@ -400,10 +396,6 @@ RelativePath="..\AI_Base.h" > - - diff --git a/hch/CObjectHandler.cpp b/hch/CObjectHandler.cpp index 9d2a11f24..02ec670a8 100644 --- a/hch/CObjectHandler.cpp +++ b/hch/CObjectHandler.cpp @@ -290,7 +290,7 @@ int3 CGHeroInstance::getPosition(bool h3m) const //h3m=true - returns position o } int CGHeroInstance::getSightDistance() const //returns sight distance of this hero { - return 6 + getSecSkillLevel(3); //default + scouting + return 5 + getSecSkillLevel(3); //default + scouting } si32 CGHeroInstance::manaLimit() const @@ -302,7 +302,7 @@ si32 CGHeroInstance::manaLimit() const case 2: modifier+=0.5; break; case 3: modifier+=1.0; break; } - return 10*getPrimSkillLevel(3)*modifier; + return si32(10*getPrimSkillLevel(3)*modifier); } //void CGHeroInstance::setPosition(int3 Pos, bool h3m) //as above, but sets position //{ @@ -334,19 +334,20 @@ int CGHeroInstance::maxMovePoints(bool onLand) const if (ret>2000) ret=2000; + double bonus = 0; if(onLand) { //logistics: switch(getSecSkillLevel(2)) { case 1: - ret *= 1.1f; + bonus = 0.1; break; case 2: - ret *= 1.2f; + bonus = 0.2; break; case 3: - ret *= 1.3f; + bonus = 0.3; break; } } @@ -356,17 +357,17 @@ int CGHeroInstance::maxMovePoints(bool onLand) const switch(getSecSkillLevel(2)) { case 1: - ret *= 1.5f; + bonus = 0.5; break; case 2: - ret *= 2.0f; + bonus = 1.0; break; case 3: - ret *= 2.5f; + bonus = 1.5; break; } } - return ret; + return int(ret + ret*bonus); } ui32 CGHeroInstance::getArtAtPos(ui16 pos) const { diff --git a/lib/Connection.cpp b/lib/Connection.cpp index b0895969f..7d0468ba6 100644 --- a/lib/Connection.cpp +++ b/lib/Connection.cpp @@ -7,6 +7,7 @@ using namespace boost; using namespace boost::asio::ip; +template DLL_EXPORT void registerTypes(Serializer &s); //defined elsewhere and explicitly instantiated for used serializers CTypeList typeList; diff --git a/lib/Connection.h b/lib/Connection.h index 346ea0462..d731e6f5d 100644 --- a/lib/Connection.h +++ b/lib/Connection.h @@ -53,8 +53,6 @@ enum SerializationLvl Serializable }; - template DLL_EXPORT void registerTypes(Serializer &s); //defined in .cpp and explicitly instantiated for used serializers - class DLL_EXPORT CTypeList { std::map types; diff --git a/lib/IGameCallback.h b/lib/IGameCallback.h index 1e4424a9d..ddcc2c880 100644 --- a/lib/IGameCallback.h +++ b/lib/IGameCallback.h @@ -66,6 +66,6 @@ public: virtual void giveHero(int id, int player)=0; virtual void changeObjPos(int objid, int3 newPos, ui8 flags)=0; - friend class CPackForClient; + friend struct CPackForClient; }; #endif // __IGAMECALLBACK_H__ \ No newline at end of file diff --git a/lib/NetPacks.h b/lib/NetPacks.h index 7acace6b1..ffa28636a 100644 --- a/lib/NetPacks.h +++ b/lib/NetPacks.h @@ -16,15 +16,27 @@ struct CPack CPack(){}; ~CPack(){}; ui16 getType() const{return type;} + template void serialize(Handler &h, const int version) + { + } }; struct CPackForClient : public CPack { CGameState* GS(CClient *cl); - //virtual void applyFirstCl(CClient *cl){}; //called before applying to gs - //virtual void applyGs(CGameState *gs){}; - //virtual void applyCl(CClient *cl){}; //called after applying to gs + void applyFirstCl(CClient *cl)//called before applying to gs + { + tlog1 << "CPackForClient::applyFirstCl - We should not be here!\n"; + }; + DLL_EXPORT void applyGs(CGameState *gs) + { + tlog1 << "CPackForClient::applyGs - We should not be here!\n"; + }; + void applyCl(CClient *cl)//called after applying to gs + { + tlog1 << "CPackForClient::applyCl - We should not be here!\n"; + }; }; struct Query : public CPackForClient @@ -72,8 +84,10 @@ struct SystemMessage : public CPackForClient //95 void applyCl(CClient *cl); std::string text; + template void serialize(Handler &h, const int version) { + h & text; } }; @@ -81,11 +95,13 @@ struct YourTurn : public CPackForClient //100 { YourTurn(){type = 100;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 player; + template void serialize(Handler &h, const int version) { + h & player; } }; @@ -93,7 +109,7 @@ struct SetResource : public CPackForClient //102 { SetResource(){type = 102;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 player, resid; si32 val; @@ -107,7 +123,7 @@ struct SetResources : public CPackForClient //104 { SetResources(){res.resize(RESOURCE_QUANTITY);type = 104;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 player; std::vector res; //res[resid] => res amount @@ -122,7 +138,7 @@ struct SetPrimSkill : public CPackForClient //105 { SetPrimSkill(){type = 105;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 abs; //0 - changes by value; 1 - sets to value si32 id; @@ -137,7 +153,7 @@ struct SetSecSkill : public CPackForClient //106 { SetSecSkill(){type = 106;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 abs; //0 - changes by value; 1 - sets to value si32 id; @@ -152,7 +168,7 @@ struct HeroVisitCastle : public CPackForClient //108 { HeroVisitCastle(){flags=0;type = 108;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 flags; //1 - start, 2 - garrison ui32 tid, hid; @@ -174,7 +190,7 @@ struct ChangeSpells : public CPackForClient //109 { ChangeSpells(){type = 109;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 learn; //1 - gives spell, 0 - takes ui32 hid; @@ -190,7 +206,7 @@ struct SetMana : public CPackForClient //110 { SetMana(){type = 110;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 hid, val; @@ -204,7 +220,7 @@ struct SetMovePoints : public CPackForClient //111 { SetMovePoints(){type = 111;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 hid, val; @@ -217,7 +233,7 @@ struct FoWChange : public CPackForClient //112 { FoWChange(){type = 112;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); std::set tiles; ui8 player, mode; //mode==0 - hide, mode==1 - reveal @@ -231,7 +247,7 @@ struct SetAvailableHeroes : public CPackForClient //113 { SetAvailableHeroes(){type = 113;flags=0;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 player; si32 hid1, hid2; @@ -246,7 +262,7 @@ struct GiveBonus : public CPackForClient //115 { GiveBonus(){type = 115;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 hid; HeroBonus bonus; @@ -263,7 +279,7 @@ struct ChangeObjPos : public CPackForClient //116 ChangeObjPos(){type = 116;}; void applyFirstCl(CClient *cl); void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 objid; int3 nPos; @@ -281,7 +297,7 @@ struct RemoveObject : public CPackForClient //500 RemoveObject(si32 ID){id = ID;type = 500;}; void applyFirstCl(CClient *cl); void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 id; @@ -311,7 +327,7 @@ struct SetGarrisons : public CPackForClient //502 { SetGarrisons(){type = 502;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); std::map garrs; @@ -324,7 +340,7 @@ struct NewStructures : public CPackForClient //504 { NewStructures(){type = 504;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 tid; std::set bid; @@ -339,7 +355,7 @@ struct SetAvailableCreatures : public CPackForClient //506 { SetAvailableCreatures(){type = 506;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 tid; std::map creatures; @@ -353,7 +369,7 @@ struct SetHeroesInTown : public CPackForClient //508 { SetHeroesInTown(){type = 508;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 tid, visiting, garrison; //id of town, visiting hero, hero in garrison @@ -366,7 +382,7 @@ struct SetHeroArtifacts : public CPackForClient //509 { SetHeroArtifacts(){type = 509;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 hid; std::vector artifacts; //hero's artifacts from bag @@ -378,10 +394,24 @@ struct SetHeroArtifacts : public CPackForClient //509 } }; +struct PlayerMessage : public CPackForClient //513 +{ + PlayerMessage(){type = 513;}; + void applyCl(CClient *cl); + + ui8 player; + std::string text; + + template void serialize(Handler &h, const int version) + { + h & text & player; + } +}; + struct SetSelection : public CPackForClient //514 { SetSelection(){type = 514;}; - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui8 player; ui32 id; @@ -396,7 +426,7 @@ struct HeroRecruited : public CPackForClient //515 { HeroRecruited(){type = 515;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 hid, tid; //subID of hero int3 tile; @@ -413,7 +443,7 @@ struct GiveHero : public CPackForClient //516 GiveHero(){type = 516;}; void applyFirstCl(CClient *cl); void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 id; //object id ui8 player; @@ -426,7 +456,7 @@ struct GiveHero : public CPackForClient //516 struct NewTurn : public CPackForClient //101 { - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); struct Hero { @@ -483,7 +513,7 @@ struct InfoWindow : public CPackForClient //103 - displays simple info window struct SetObjectProperty : public CPackForClient//1001 { - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 id; ui8 what; //1 - owner; 2 - blockvis; 3 - first stack count; 4 - visitors; 5 - visited; 6 - ID (if 34 then also def is replaced) @@ -499,7 +529,7 @@ struct SetObjectProperty : public CPackForClient//1001 struct SetHoverName : public CPackForClient//1002 { - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 id; MetaString name; @@ -514,7 +544,7 @@ struct SetHoverName : public CPackForClient//1002 struct HeroLevelUp : public Query//2000 { void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 heroid; ui8 primskill, level; @@ -565,7 +595,7 @@ struct BattleStart : public CPackForClient//3000 { BattleStart(){type = 3000;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); BattleInfo * info; @@ -579,7 +609,7 @@ struct BattleNextRound : public CPackForClient//3001 { BattleNextRound(){type = 3001;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); si32 round; @@ -592,7 +622,7 @@ struct BattleSetActiveStack : public CPackForClient//3002 { BattleSetActiveStack(){type = 3002;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 stack; @@ -638,7 +668,7 @@ struct BattleStackAttacked : public CPackForClient//3005 { BattleStackAttacked(){flags = 0; type = 3005;}; void applyCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); ui32 stackAttacked; ui32 newAmount, newHP, killedAmount, damageAmount; @@ -667,7 +697,7 @@ struct BattleAttack : public CPackForClient//3006 { BattleAttack(){flags = 0; type = 3006;}; void applyFirstCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); void applyCl(CClient *cl); BattleStackAttacked bsa; @@ -697,7 +727,7 @@ struct StartAction : public CPackForClient//3007 StartAction(){type = 3007;}; StartAction(const BattleAction &act){ba = act; type = 3007;}; void applyFirstCl(CClient *cl); - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); BattleAction ba; template void serialize(Handler &h, const int version) @@ -710,6 +740,7 @@ struct EndAction : public CPackForClient//3008 { EndAction(){type = 3008;}; void applyCl(CClient *cl); + template void serialize(Handler &h, const int version) { } @@ -718,7 +749,7 @@ struct EndAction : public CPackForClient//3008 struct SpellCasted : public CPackForClient//3009 { SpellCasted(){type = 3009;}; - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); void applyCl(CClient *cl); ui8 side; //which hero casted spell: 0 - attacker, 1 - defender @@ -734,7 +765,7 @@ struct SpellCasted : public CPackForClient//3009 struct SetStackEffect : public CPackForClient //3010 { SetStackEffect(){type = 3010;}; - void applyGs(CGameState *gs); + DLL_EXPORT void applyGs(CGameState *gs); void applyCl(CClient *cl); ui32 stack; @@ -752,6 +783,7 @@ struct ShowInInfobox : public CPackForClient //107 Component c; MetaString text; + void applyCl(CClient *cl); template void serialize(Handler &h, const int version) { h & player & c & text; diff --git a/lib/VCMI_lib.vcproj b/lib/VCMI_lib.vcproj index a3d6397ea..521109a10 100644 --- a/lib/VCMI_lib.vcproj +++ b/lib/VCMI_lib.vcproj @@ -322,6 +322,10 @@ RelativePath="..\map.cpp" > + + @@ -420,6 +424,10 @@ RelativePath=".\NetPacks.h" > + +