Commit Graph
1417 Commits
Author SHA1 Message Date
AlexVinS 0e57825679 Fixed CID 1197463 2016-11-25 21:17:24 +03:00
AlexVinS e7a0bd690a Fixed CID 1197453 2016-11-25 17:39:06 +03:00
AlexVinS dc39fb2d14 Removed useless CPack::type field.
* it was an ancient network protocol artifact
2016-11-18 17:45:59 +03:00
DjWarmongerandGitHub 9db3bfcbf2 Merge pull request #212 from vcmi/refactoring/serialization2
Apparently it works - both new and old saves load at least.
2016-11-01 17:25:39 +01:00
Ivan Savenko 256f43f467 Fixes zero-initialized fileVersion member in deserializer 2016-10-29 19:52:19 +03:00
Vadim Markovtsev 24793e115c Fix formatting 2016-10-29 13:45:08 +02:00
Vadim Markovtsev dccc25268c Fix the initial creature spells at battle start
Before: built-in spells appear on first move of the creature
After: all built-in spells appear before the first move but after tactics

Example: Air Shield for experienced skeletons
2016-10-28 23:37:45 +02:00
Ivan SavenkoandArseniy Shestakov 5b76c3f4eb Rebase of codebase changes for refactored serializer
Some of newer fixes not yet merged there and save compatibility a bit off.
2016-10-27 18:12:20 +03:00
Arseniy Shestakov 15b4774076 Logging: always print version of client and server in the begining 2016-10-27 17:14:20 +03:00
Arseniy Shestakov cb3d6a24e7 Cmake: cleanup for commit hash in build version
Since it's available in lib we don't need to include it everywhere.
2016-10-27 17:01:29 +03:00
Vadim Markovtsev da1c9cf249 Fix rebuilding everything on HEAD change 2016-10-23 16:56:53 +02:00
Vadim Markovtsev d0beb27197 Add git commit hash into the version string 2016-10-23 15:45:47 +02:00
Vadim Markovtsev 6fe5f2a7f6 Fix segfault / assertion failure during battle
The cause of the assertion failure at BattleStackAttacked::applyGs "at"
was shooting and casting some spell in handleAttackBeforeCasting() and
eventually killing the whole stack. Fix: filter dead stacks in the end of
handleAttackBeforeCasting().
2016-10-12 19:11:12 +02:00
Vadim Markovtsev 76ac9991ed Format code 2016-10-12 17:22:35 +02:00
Vadim Markovtsev 34cf92cb9b Change logging style 2016-10-03 20:32:01 +02:00
Vadim Markovtsev eac5aab396 Survive client<->server ABI mismatch 2016-10-02 22:45:00 +02:00
AlexVinS 723734fd04 Fixed commander always dies. 2016-10-02 17:15:25 +03:00
Arseniy Shestakov 7b7958c548 Cheat codes: add option to apply cheats on different players
All suitable codes can now be used with "ai", "all" color or with object ID:
vcminahar all - will apply cheat to all heroes of all players
vcminahar ai - will apply cheat  to all heroes of AI players
vcminahar blue - will apply it to all heroes of blue player
vcminahar 553 - will apply cheat to hero with instance id of 553 if it's exist
Cheats without options work as before.
2016-10-02 16:21:46 +03:00
AlexVinS cd5c0b3297 Style tweaks. 2016-10-02 15:22:55 +03:00
AlexVinS 23b7a803b6 cleanup 2016-10-01 20:07:36 +03:00
AlexVinS a1ff409080 Tweak
* handle BIND_EFFECT by bonus type
2016-10-01 08:04:39 +03:00
AlexVinS 72461c5c2e Fixed http://bugs.vcmi.eu/view.php?id=2268 2016-09-29 23:14:22 +03:00
AlexVinS 9097ffbd8a Handle HYPNOTIZE effect in case of FEAR and ENCHANTED effects 2016-09-29 22:26:28 +03:00
AlexVinS 83b3c700dd Handle HYPNOTIZE effect in case of mana drain 2016-09-29 21:47:41 +03:00
Vadim Markovtsev 2c1dddde33 Fix memory problems with BonusList
Bonus * -> std::shared_ptr<Bonus>

This cures the following problems:

1) Memory corruption at exit. Some Bonus-es were deleted twice (mods?).
2) Memory leaks. Some Bonuses were not deleted.
3) Reduce the number of "Orphaned child" messages.

Valgrind reports 0 leaked memory now and no invalid reads/writes.
2016-09-29 15:08:00 +02:00
AlexVinS 34b8b2c91b Fixed Berserk spell effect aka Bonus::ATTACKS_NEAREST_CREATURE
* issue http://bugs.vcmi.eu/view.php?id=2513
* fix is not retroactive
2016-09-29 14:11:15 +03:00
AlexVinS 8f18dec5e3 Cleanup 2016-09-29 12:13:06 +03:00
AlexVinS 7874dffa7d fixed http://bugs.vcmi.eu/view.php?id=2282 2016-09-24 10:06:24 +03:00
AlexVinS 62d272f3e5 Cleanup 2016-09-22 21:35:37 +03:00
AlexVinS ea2e336f54 Merge branch 'develop' into SpellsRefactoring8 2016-09-22 16:40:32 +03:00
Arseniy Shestakov 58f90b736b New cheat vcmiungoliant: hide all tiles that out of sight radius 2016-09-20 10:51:57 +03:00
Arseniy Shestakov 75cffa7d0b CGameHandler::arrangeStacks: honour removableUnits of CGGarrison
Now server properly check allowed actions for CGGarrison. Fix issue 2303
Server now allow all stack arrangement as long as troops stay inside garrison.
It's possible to put more troops inside using swap/merge/split, but not take anything out if it.
2016-09-19 03:20:44 +03:00
AlexVinS ef34d21941 Passive cast can be blocked by spell level limit. 2016-09-18 17:21:56 +03:00
AlexVinS dcb0e8a0c1 Tweak 2016-09-18 13:39:02 +03:00
Arseniy Shestakov 1d45d214e5 CGameHandler refactoring: when possible only use const data
We only change gamestate via netpacks so there is absolutely no reason to use non-const pointers and functions in GH.
2016-09-18 11:53:51 +03:00
AlexVinS d993710f8e Merge branch 'develop' into SpellsRefactoring8 2016-09-17 20:29:44 +03:00
Arseniy Shestakov 7ae4e70134 CGameHandler: fix player id logging 2016-09-17 00:05:10 +03:00
Arseniy Shestakov ea65fb15c2 CVCMIServer: do not crash if port not specified 2016-09-16 20:01:07 +03:00
AlexVinS 505e53c17d Merge remote-tracking branch 'remotes/origin/develop' into SpellsRefactoring8
# Conflicts:
#	client/battle/CBattleInterface.cpp
#	lib/spells/BattleSpellMechanics.cpp
2016-09-12 10:13:40 +03:00
AlexVinS 33d1895d21 Merge branch 'develop' into SpellsRefactoring8 2016-09-11 18:34:18 +03:00
Arseniy Shestakov fe6c0cf89b Use RandomGeneratorUtil::randomShuffle for reproducible gameplay 2016-09-11 00:10:52 +03:00
Arseniy Shestakov c8faca8f39 Refactoring: only use RNGs explicitly to avoid bug prone code in future
Now server-side code should always use CRandomGenerator::getDefault which is serialized in GH.
CGameState::getRandomGenerator should be only used from GS code and CPackForClient-based applyGs.
2016-09-11 00:10:46 +03:00
AlexVinS f8767a6380 cleanup 2016-09-10 09:37:18 +03:00
Arseniy Shestakov 70abae9b51 CGameState::battleGetBattlefieldType: use RNG by ref
For now I not sure about proper place for battleGetBattlefieldType so I left it in GS
2016-09-09 23:16:43 +03:00
Arseniy Shestakov ea63497b19 Move CGameState::setupBattle code to CGameHandler::setupBattle
No reason to keep this code in GS.
2016-09-09 23:16:43 +03:00
Arseniy Shestakov 53502e84e3 Add PrepareHeroLevelUp netpack to keep secondary skills RNG in sync 2016-09-09 23:16:43 +03:00
Arseniy Shestakov ca819b3cda CGHeroInstance::nextPrimarySkill: don't use GS RNG directly
Code used from both GS and CGameHandler.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov c8bcb14d34 CCallbackBase: add CRandomGenerator to all callbacks
This is easiest way to make server RNG available to CBattleInfoCallback.

Now server, client and gamestate have own RNG instance.
Only server and gamestate RNGs are serialized.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov 85f49bc968 CGHeroInstance::initArmy: don't use GS RNG. Get RNG through a ref
This function used by both server-side and gamestate so it's must use appropriate random source.
2016-09-09 23:16:42 +03:00
Arseniy Shestakov 2ba3b20928 Multiple changes to RNG usage to both client and server
Server should never use RNG from CGameState directly.
Instead server get's own RNG that's state is secret for client.
2016-09-09 23:16:42 +03:00