1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-05-13 22:06:58 +02:00

238 Commits

Author SHA1 Message Date
Ivan Savenko
1f15a7faa4 Fix build 2025-05-12 22:07:10 +03:00
Ivan Savenko
2c17c2d5b7 Rework CCallback <-> CClient interaction
- callback is now part of lib instead of weird class that is shared by
client and AI while being part of client
- callback interacts with client class via minimal interface class
- removed no longer used unlockGsWhileWaiting field
2025-05-12 22:07:10 +03:00
Ivan Savenko
35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
Ivan Savenko
4b30336d03 Fix issues detected by Sonar 2025-05-11 19:50:57 +03:00
Ivan Savenko
0e2ea99283 Implemented option to emulate H3 seer hut full-army quest bug 2025-05-07 19:16:58 +03:00
Ivan Savenko
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
Ivan Savenko
912c2eae94 Fix regressions 2025-04-27 14:57:31 +03:00
Ivan Savenko
6d65641a43 Gamestate is now passed as shared pointer 2025-04-27 14:57:30 +03:00
SoundSSGood
4609a83fc1 ArtInfoWindow on client. Lib side 2025-04-05 18:02:04 +02:00
Ivan Savenko
2b286378e8 Remove logic for banks in 1.5 format 2025-03-19 08:02:39 +00:00
Ivan Savenko
219eea86ff Better handling of AI shutdown 2025-03-02 14:33:11 +00:00
Ivan Savenko
948abfb04c AI now uses std::thread, added custom thread interruption logic 2025-03-02 14:33:11 +00:00
Ivan Savenko
844dfb1604 Removed usage of boost::thread from vcmi, except for AI 2025-03-02 14:33:11 +00:00
Laserlicht
7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
Ivan Savenko
32391dc7a9 Pathfinder cache is now stored separately per playerBlocked
- human player will now use pathfinder settings from config (as before)
- nullkiller AI will now use its own, modified settings
- added option to configure NKAI usage of monolith to config
- fixed pathfinder costs not updating on receiving levelup
2025-01-23 15:28:44 +00:00
Ivan Savenko
a8e84c55f6 Fix some of the new warnings from sonarcloud 2024-10-11 10:45:29 +00:00
Ivan Savenko
c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
Ivan Savenko
786f80871e Replace more usages of pointers to packs with references 2024-10-07 14:59:14 +00:00
Ivan Savenko
ee831c06e7 Reduced usage of CPack, replaced with CPackForServer where applicable 2024-10-07 14:59:14 +00:00
Laserlicht
a826b88641
Merge branch 'develop' into spell 2024-10-07 12:55:23 +02:00
Laserlicht
d929bfb9d1 rename; introduce factor 2024-09-28 15:05:13 +02:00
Laserlicht
a9327b3fa3 netpacks 2024-09-27 22:47:22 +02:00
SoundSSGood
b9ae7f1138 CMap put move and remove artifact method 2024-09-23 23:30:38 +03:00
MichalZr6
e13e72d093 Moved code from NetpacksClient.cpp to Client.cpp
Created new function CClient::updatePath that will invalidate paths and update given hero displayed path
2024-09-19 08:43:54 +02:00
Ivan Savenko
39a2c29c97 Removed creatureBank flag from battle, battles now receive BattleLayout
struct that defines how units are placed in combat
2024-09-12 12:11:18 +00:00
Ivan Savenko
6179521364
Merge pull request #4556 from IvanSavenko/town_building_visit
Implemented explicitly visitable town buildings, e.g. hota mana vortex
2024-09-05 17:21:21 +03:00
SoundSSGood
7466d7452d vcmiscrolls 2024-09-05 15:51:45 +03:00
Ivan Savenko
b09d9d501b Pass pointer to actual caller in showBlockingDialog callWith
Fixes activation of all rewardable buildings in town on blocking dialog
answer
2024-09-04 15:14:56 +00:00
Ivan Savenko
ce1e0b8875 Moved NewTurn pack generation to NewTurnProcessor 2024-08-28 13:03:24 +00:00
Ivan Savenko
01396b62b7 Extracted handling of type ID's from serializer into a separate class 2024-08-26 19:48:46 +00:00
Ivan Savenko
232a759db7 Remove type registration from library pack applying 2024-08-26 19:48:46 +00:00
Ivan Savenko
b84af1a6de Significantly simplify packs applying
Apparently our logic for packs applying with types registration is
overcomplicated and by now completely unnecessary - it became redundant
after introduction of visitor pattern.
2024-08-26 19:48:46 +00:00
Ivan Savenko
1c63fefe02 Moved banks randomization to server-side with client netpack 2024-07-16 13:13:39 +00:00
Ivan Savenko
b07408e984 New objects are now created and initialized on server and sent to client 2024-07-16 13:13:39 +00:00
Ivan Savenko
d2839c8e52 Rewardable object randomization is now always server-sided 2024-07-16 13:13:39 +00:00
Ivan Savenko
0d66ddbeec GameState now uses random generator from server. Blocked access to rmg
on client
2024-07-16 13:13:38 +00:00
Ivan Savenko
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
Ivan Savenko
9bfe000724 Added semi-workaround method for network thread shutdown:
Currently closing game while network thread is waiting for something is
very bug-prone, since network thread may resume during shutdown and
access partially destroyed client state.

Now if exit has been requested, the very first step would be semi-
graceful shutdown of network thread (via exception throwing). This may
in theory skip some cleanup in non-RAII code, but since game is shutting
down this does not matters much.

This logic applies to:
- shutting down while network thread is waiting for dialogs
- shuttind down while network thread waiting for animations in combat
2024-05-18 11:04:10 +00:00
Ivan Savenko
8754e0ebb3 Code formatting and cleanup 2024-05-17 17:10:29 +00:00
Ivan Savenko
f3de2cfe1c Removed broken & unused serialization of player interface and AI 2024-05-17 16:35:53 +00:00
Ivan Savenko
8b861fc58f Do not check for guards when teleporting using means other than DD 2024-05-07 20:05:23 +00:00
Ivan Savenko
18ece6dcf6 Remove some usages of server-side translations 2024-04-09 16:13:30 +03:00
SoundSSGood
9f688e6fb7 MoveArtifact, BulkMoveArtifacts PlayerColor player field 2024-03-07 22:28:56 +02:00
Alexander Wilms
522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":")
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-10 20:46:13 +01:00
Ivan Savenko
0c07384293 Refactoring of serialization versioning handling
- Removed 'version' field from serialize() method
- Handler classes - Binary(De)Serializer now have 'version' field
- Serialization versioning now uses named enum

Save compatibility with 1.4.X saves should be intact
2024-01-20 20:34:51 +02:00
Ivan Savenko
c21913f661 Fixed initialization of move points and mana for dismissed heroes 2024-01-15 23:16:48 +02:00
Ivan Savenko
edb2ecd751 Fix possible overflow errors on leveling up beyond int64_t limit
- added separate giveExperience method instead of weird changePrimSkill
- experience is now always used in form of int64_t
- max supported level reduced from 201 to 197 to fit into int64_t
- fixed undefined behavior in experience calculation
2024-01-04 23:57:36 +02:00
SoundSSGood
57e3abc548 ask assemble regression fixed 2023-11-08 21:59:55 +02:00
Ivan Savenko
6b81012f31 Use variant identifier in netpacks where applicable 2023-11-08 14:00:23 +02:00
Alexander Wilms
e4db6f2af8 CClient::removeGUI(): This function should be declared 'const' 2023-10-28 23:05:05 +00:00