1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00
Commit Graph

5592 Commits

Author SHA1 Message Date
Laserlicht
3d57437e52
move logic to tick 2024-01-26 20:13:02 +01:00
Laserlicht
c426382687
Apply suggestions from code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-01-26 20:09:17 +01:00
Ivan Savenko
eaca128c99 Code cleanup 2024-01-26 19:15:57 +02:00
Ivan Savenko
322c5faf63 Merge remote-tracking branch 'vcmi/develop' into lobby 2024-01-26 16:52:23 +02:00
Ivan Savenko
388ca6e776 Added list of active accounts and rooms to UI. Added room creation logic 2024-01-26 16:32:36 +02:00
Ivan Savenko
4d0c0f10a9
Merge pull request #3530 from Laserlicht/tavern
Invite hero
2024-01-26 13:12:55 +02:00
Laserlicht
28c6385211
fix 2024-01-26 11:17:38 +01:00
Laserlicht
7f58333ef9
quick combat vs ai 2024-01-25 23:44:41 +01:00
Laserlicht
c2c86ec278
fix 2024-01-25 21:11:42 +01:00
Laserlicht
3b9372c51c
Code review 2024-01-25 20:49:59 +01:00
Laserlicht
e434d5c0b7
Apply suggestions from code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-01-25 20:35:30 +01:00
Ivan Savenko
891d25a634
Merge pull request #3552 from Laserlicht/video_button
video button
2024-01-25 16:31:24 +02:00
Ivan Savenko
2a193effcc Merge branch 'master' into 'develop' 2024-01-25 16:23:13 +02:00
Laserlicht
e3acb92863
codestyle 2024-01-24 20:32:39 +01:00
Ivan Savenko
2f5bf64340 Do not crash on attempt to load campaign with unsupported maps 2024-01-24 13:44:22 +02:00
Laserlicht
8870547d02
simplyfied 2024-01-24 01:23:35 +01:00
Laserlicht
e59078320c
format fix 2024-01-24 01:22:34 +01:00
Laserlicht
134eaa1583
sync subtitle 2024-01-24 01:17:23 +01:00
Laserlicht
56db0e06cf
fix render artefacts remaining after video playback 2024-01-24 00:04:56 +01:00
Laserlicht
0df4f9bda5
video button 2024-01-23 23:45:31 +01:00
Ivan Savenko
ea439ad175 Dispatch text input SDL calls in main thread on all platforms 2024-01-22 22:19:52 +02:00
Laserlicht
7d1553bc29
fix build 2024-01-22 20:56:35 +01:00
Ivan Savenko
6a42494b12 Merge CKeyboardFocusListener and IFocusListener into CFocusable 2024-01-22 21:48:03 +02:00
Laserlicht
9b2908d464
Apply suggestions from code review
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-01-22 20:19:49 +01:00
Ivan Savenko
284273379e
Merge pull request #3536 from IvanSavenko/serialization_refactor
Refactoring of serialization versioning handling
2024-01-22 19:49:24 +02:00
Laserlicht
0a4b5dbe10
code review 2024-01-21 18:12:46 +01:00
Andrii Danylchenko
33f8f6dc53
Merge pull request #3409 from vcmi/fix-headless
Fix headless
2024-01-21 14:51:10 +02:00
Ivan Savenko
d8a96066c6
Merge pull request #3533 from Laserlicht/battle_text
fix battle text position
2024-01-21 10:10:26 +02:00
Ivan Savenko
9e62eb28c5 Fix merge 2024-01-21 00:53:22 +02:00
Ivan Savenko
fc4ae3bd8c Merge remote-tracking branch 'vcmi/develop' into lobby 2024-01-20 23:01:49 +02:00
Andrii Danylchenko
0c1664dbe7 NKAI: various AI fixes after tests in headless 2024-01-20 22:55:30 +02:00
Andrii Danylchenko
cc7fc4a2c6 Fix headless mode 2024-01-20 22:55:27 +02: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
6b760089a4
Merge pull request #3473 from IvanSavenko/const_lib
[1.5] Remove non-const global variables from library
2024-01-20 19:22:46 +02:00
Laserlicht
883ea23495
moved to gameconfig 2024-01-20 17:54:15 +01:00
Ivan Savenko
9920783628 Avoid crash on invalid H3 data 2024-01-20 18:50:59 +02:00
Ivan Savenko
24d25730ad Changed checks for null with checks for hasValue 2024-01-20 16:41:10 +02:00
Laserlicht
3084cb2e46 fix battle text position
fix space
2024-01-20 14:35:21 +01:00
Laserlicht
d6172a9c4c
disable buttons while loading (not changable) 2024-01-20 13:42:37 +01:00
Laserlicht
a0098eb065 Gui for hero invite 2024-01-20 12:54:06 +01:00
Laserlicht
4813179abb
Invite hero setting 2024-01-20 01:24:34 +01:00
Laserlicht
346beea49c
invite hero backend 2024-01-20 01:09:55 +01:00
Laserlicht
1fb2a026ec
enable doubleclick 2024-01-19 23:31:21 +01:00
Ivan Savenko
baa73f5433 Code cleanup 2024-01-20 00:26:25 +02:00
Ivan Savenko
709905b1a0 Simplified networking API 2024-01-19 23:52:28 +02:00
Ivan Savenko
80e960bc8e Finalized new TCP networking API 2024-01-19 23:52:28 +02:00
Ivan Savenko
476a05fed3 Formatting 2024-01-19 23:52:28 +02:00
Ivan Savenko
ffa58152ac Client-side support for hosting game server via lobby 2024-01-19 23:49:59 +02:00
Ivan Savenko
47f72af556 Client-side update, adapted and fixed login and chat 2024-01-19 23:49:59 +02:00
Ivan Savenko
461bca73f3 Minor cleanup - move reinterpret_cast to jsonNode 2024-01-19 23:49:59 +02:00
Ivan Savenko
55b504792e Implemented basic version of login window and persistent connection on
client
2024-01-19 23:49:59 +02:00
Ivan Savenko
78833a1015 Split LobbyWindow file into one file per class 2024-01-19 23:49:59 +02:00
Ivan Savenko
20a38d8514 Renamed new LobbyXXX classes to GlobaLobbyXXX 2024-01-19 23:49:59 +02:00
Ivan Savenko
78b7d9e726 Replaced open port check with server crash check 2024-01-19 23:49:59 +02:00
Ivan Savenko
0196707083 Fix UUID initialization on client 2024-01-19 23:49:59 +02:00
Ivan Savenko
2396c14114 Fixed logic for reconnection attempts to local server. Cleanup.
Added distinct fields in config for local and remote connection.
Removed code for restoring last session since it does not works as
intended and often triggers after crash
2024-01-19 23:49:59 +02:00
Ivan Savenko
a3639e77b1 Fixed handling of connection failure on client 2024-01-19 23:49:59 +02:00
Ivan Savenko
a50cdbda0c Added timer functionality to NetworkServer
Might not be related to networking strictly speaking, but useful to have
functionality for network thread
2024-01-19 23:49:59 +02:00
Ivan Savenko
5694777a96 Simplified connection logic 2024-01-19 23:49:59 +02:00
Ivan Savenko
8ea69e457a Simplified applying of lobby packs 2024-01-19 23:49:59 +02:00
Ivan Savenko
22f0ca67c6 Fix connection to game lobby & map load 2024-01-19 23:49:59 +02:00
Ivan Savenko
0a1153e1c6 Switch client-server communication to new API 2024-01-19 23:49:59 +02:00
Ivan Savenko
de5227142b Implemented message receiving / broadcasting 2024-01-19 23:49:59 +02:00
Ivan Savenko
07fb313765 Implemented loading of latest messages on joining chat 2024-01-19 23:49:59 +02:00
Ivan Savenko
f10b6df989 Implemented messages sending and storing in database 2024-01-19 23:49:59 +02:00
Ivan Savenko
dff9cf39c0 Implemented connection handling 2024-01-19 23:49:59 +02:00
Ivan Savenko
c2c43602ea Initial version of global lobby server available in client 2024-01-19 23:49:59 +02:00
Ivan Savenko
d04241b10a Code cleanup 2024-01-19 23:02:00 +02:00
Ivan Savenko
1f7e53a609 Code style fixes 2024-01-19 21:21:23 +02:00
Ivan Savenko
6e629a6a5f split getBonusLocalFirst into two distinct method:
- const method getFirstBonus that returns single matching bonusToString
- non-const method getLocalBonus that returns bonus from current node
2024-01-19 13:56:06 +02:00
Ivan Savenko
496c13b34a Stabilization 2024-01-19 13:56:06 +02:00
Ivan Savenko
9af7c63a26 Fix build 2024-01-19 13:56:05 +02:00
Ivan Savenko
ea1f05d15a Stabilization 2024-01-19 13:55:22 +02:00
Ivan Savenko
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00
Ivan Savenko
a15366f5a5 Make IObjectInterface::cb non-static 2024-01-19 13:55:21 +02:00
Ivan Savenko
2c4cad7d9c Slight simplification of bonus system node class 2024-01-19 13:54:49 +02:00
Ivan Savenko
d5c4478816 Remove most of non-const access to VLC entities 2024-01-19 13:54:49 +02:00
Ivan Savenko
bd5682ecc3 Merge remote-tracking branch 'vcmi/master' into develop 2024-01-19 13:49:54 +02:00
Ivan Savenko
b2527c3775 Do not attempt to answer non-existing query 2024-01-18 22:21:07 +02:00
Ivan Savenko
3e8f110482
Merge pull request #3515 from SoundSSGood/backpack-statusbar
Backpack statusbar
2024-01-18 16:05:42 +02:00
Ivan Savenko
b698b6e79d
Merge pull request #3512 from Alexander-Wilms/use-auto-with-template-factory-functions-for-smart-pointers
Use auto with template factory functions for smart pointers
2024-01-18 16:05:05 +02:00
Ivan Savenko
9025744cc5
Merge pull request #3510 from Alexander-Wilms/remove-semicolons-from-macros
Remove trailing semicolons from more macros
2024-01-18 16:03:55 +02:00
SoundSSGood
a753319ad0 backpack window statusbar 2024-01-18 15:55:54 +02:00
Laserlicht
a1f4fcb78a
hide adventuremap 2024-01-18 00:47:18 +01:00
Alexander Wilms
b364f707cd Fix issues introduced by automated replacement of redundant types 2024-01-17 20:12:57 +00:00
Alexander Wilms
7a1cee1a60 Fix error: 'auto' not allowed in non-static struct member 2024-01-17 14:49:28 +00:00
Alexander Wilms
73019c204d Replace redundant types with auto for the lvalues of template factory functions for smart pointers
grep -r --include \*.h --include \*.cpp "= std::" * | grep -v auto | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return" | grep -v double | grep -v si64 | grep -v si32 | grep -v ui32 | grep \< | grep -v float | tr -d '\t' | grep -v assert > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = ":".join(line.split(":")[1:]).strip()

        print()
        print(path)
        print(original_code)
        prefix = "auto "
        if original_code.startswith("static"):
            static = True
        else:
            static = False

        cpp_type = " ".join(original_code.split("=")[0].strip().split(" ")[0:-1])
        print(cpp_type)

        if static:
            new_code = "static auto "+ " ".join(original_code.split(" ")[2:])
        else:
            new_code = "auto "+ " ".join(original_code.split(" ")[1:])
        print(new_code)

        if True:
            with open(path, "r") as f:
                filedata = f.read()

            filedata = filedata.replace(original_code, new_code)

            with open(path, "w") as f:
                f.write(filedata)
2024-01-17 12:50:00 +00:00
Ivan Savenko
e849e4170a
Merge pull request #3486 from Alexander-Wilms/replace-redundant-types-with-auto
Replace redundant types with `auto`
2024-01-17 13:31:05 +02:00
Alexander Wilms
1b85abb508 Use auto instead of redundant type in initializations using new
grep -r --include \*.h --include \*.cpp "=" * | grep -v "auto\|int\|char\|bool\|float|\double\|for\|if\|googletest\|fuzzylite\|size_t\|using\|return\|{\|}\|= \"\|= tr(\|virtual\|void" | grep -Po ".*[^ ]+ [^ ]+ [^ ]*[ ]*=.*;" | grep -v "float\|nullptr" | grep "new" | grep -v "AI/FuzzyLite" | grep \( | grep "= new" > redundant_types.txt

import re

with open("redundant_types.txt") as f:
    for line in f:
        line = line.strip()
        path = line.split(":", 1)[0]
        original_code = line.split(":")[1].strip()
        if "new " in original_code:

            cpp_type = original_code.split(" ")[0]
            if original_code.count(cpp_type) == 2:
                print()
                print(path)
                print(original_code)
                new_code = "auto "+" ".join(original_code.split(" ")[1:])
                print(new_code)

                with open(path, "r") as f:
                    filedata = f.read()

                filedata = filedata.replace(original_code, new_code)

                with open(path, "w") as f:
                    f.write(filedata)
2024-01-16 21:40:53 +00:00
Alexander Wilms
ccac73fb69 Remove trailing semicolons from more macros 2024-01-16 19:46:21 +00:00
Alexander Wilms
cca08e29da Remove duplicate semicolons 2024-01-16 19:02:39 +00:00
Ivan Savenko
6270c81c1a Add logging to trace crash 2024-01-16 15:21:49 +02:00
Ivan Savenko
b9f4c557fa Fix cursor on visiting sea objects from land 2024-01-16 00:12: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
a582cb554e
Merge pull request #3500 from IvanSavenko/fix_dendroid_bind
[1.4.3] Fix handling of Dendroid's Bind ability
2024-01-15 12:02:06 +02:00
Ivan Savenko
b4a1a755a4
Merge pull request #3498 from IvanSavenko/simturns_pathfinder
[1.4.3] Fixes for simultaneous turns
2024-01-15 12:00:54 +02:00
Ivan Savenko
0d0d3d8c80 Renamed speed -> getMovementRange, remove misleading default parameter 2024-01-14 17:14:36 +02:00
Ivan Savenko
d3a1cdb97a
Merge pull request #3485 from Laserlicht/fix_selection
fix buggy multiplayer selection
2024-01-14 14:23:32 +02:00
Ivan Savenko
b453b9d6d0 Fix UI lock on ending turn while simturns are active 2024-01-13 23:38:43 +02:00
Laserlicht
e25c8c21e0
fix buggy multiplayer selection 2024-01-13 21:51:56 +01:00
Ivan Savenko
fc163898d9 Fixed delayed updates in timer editing, limited to 24 hours at most 2024-01-13 22:31:26 +02:00
Laserlicht
2d511ecf1c
console fix 2024-01-13 18:59:59 +01:00
Ivan Savenko
f6e0f46040
Merge pull request #3467 from dydzio0614/hota-fixes
Fix HotA creature abilities (add bonuses allowing implementing them)
2024-01-12 21:55:18 +02:00
Ivan Savenko
7cf738b20e
Merge pull request #3462 from Laserlicht/trim_text
limit textboxes
2024-01-12 21:53:30 +02:00
Ivan Savenko
019a4151b9
Merge pull request #3258 from SoundSSGood/trade-panels
Market rework
2024-01-12 21:53:13 +02:00
SoundSSGood
4df7de36c1 fixed regression 2024-01-11 14:51:42 +02:00
SoundSSGood
b840cf3650 suggested changes 2024-01-11 12:46:32 +02:00
M
815fa26fb3 Change nix rounding, revert assert comment 2024-01-10 22:18:53 +01:00
Ivan Savenko
d6224eef5b
Merge pull request #3457 from Laserlicht/queue
make queue interactable
2024-01-10 15:51:13 +02:00
Alexander Wilms
781328f282 Convert C-style casts to the more verbose C++ style 2024-01-10 00:30:35 +00:00
Alexander Wilms
5e9f98b15c Resolve intentionality issues 2024-01-10 00:23:24 +00:00
Alexander Wilms
f3277b7953 Define each identifier in a dedicated statement 2024-01-10 00:22:23 +00:00
SoundSSGood
fdf60b2151 moved to widgets/markets 2024-01-09 20:21:09 +02:00
Ivan Savenko
eae3d806db
Merge pull request #3460 from Laserlicht/changedate_sort
add sort for changedate
2024-01-09 12:43:01 +02:00
Ivan Savenko
0d47c01de7
Merge pull request #3458 from Laserlicht/sel_window_bonus
correct starting bonus in selection windows
2024-01-09 12:41:55 +02:00
SoundSSGood
d0ca63d2c9 subclasses for market composition 2024-01-08 16:24:47 +02:00
SoundSSGood
50a5c72d1b Creatures trade panel 2024-01-08 16:24:47 +02:00
SoundSSGood
791ee78cc4 players trade panel 2024-01-08 16:24:47 +02:00
SoundSSGood
f043c417a1 Artifacts trade panel 2024-01-08 16:24:47 +02:00
SoundSSGood
b246e24811 reworking slot selection 2024-01-08 16:24:47 +02:00
SoundSSGood
6c828d1be9 Resources trade panel 2024-01-08 16:24:47 +02:00
Ivan Savenko
6641418218
Merge pull request #3452 from IvanSavenko/glibc_assertions
Enable & fix glibc assertions
2024-01-08 11:08:37 +02:00
Laserlicht
056dccda30
different max width 2024-01-08 00:08:05 +01:00
Laserlicht
24d4816a36
trim text 2024-01-07 23:42:48 +01:00
Dydzio
d309a00025 Extra fix: fix amount position in battle creature labels 2024-01-07 21:45:39 +01:00
Ivan Savenko
ae79c5e953
Merge pull request #3397 from Laserlicht/cheat_allow
option for disabling cheats
2024-01-07 21:42:02 +02:00
Laserlicht
8b262e49a6
add sort for changedate 2024-01-07 20:17:44 +01:00
Dydzio
bb925e4cb0 First version of sea witch / sorceress ability 2024-01-07 19:27:32 +01:00
Laserlicht
7a6722bc45
fix spell hover 2024-01-07 18:12:17 +01:00
Laserlicht
8f2f5344a9
correct starting bonus in selection windows 2024-01-07 17:25:33 +01:00
Laserlicht
f4bff876d5
make queue interactable 2024-01-07 16:38:37 +01:00
Laserlicht
c635ca562e
fix campaign completion 2024-01-07 14:36:07 +01:00
Ivan Savenko
a2f603ac02 Fixed some cases of illegal access to std::array::operator[] 2024-01-07 12:45:02 +02:00
Ivan Savenko
9cf5c6a6c1
Merge pull request #3438 from IvanSavenko/select_renderer
Select sdl renderer in Launcher
2024-01-06 13:06:50 +02:00
Ivan Savenko
cf47fbb729
Merge pull request #3435 from IvanSavenko/bugfixing
[1.4.3] Bugfixing
2024-01-06 13:06:07 +02:00
Ivan Savenko
3383221f0b Show error message on failure to create renderer 2024-01-05 21:46:44 +02:00
Ivan Savenko
fd85d93a00 Fixed video playback framerate for intro videos 2024-01-05 14:37:33 +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
Ivan Savenko
8037d575ad Fix crash on attempt to access not visible tile 2024-01-04 23:54:06 +02:00
Ivan Savenko
63a2ed7cf8 Replace vector[] with range-checking vector.at() 2024-01-04 23:52:57 +02:00
Ivan Savenko
ef5686634d Removed no longer used code 2024-01-04 23:48:58 +02:00
Ivan Savenko
121ef77440
Merge pull request #3416 from Laserlicht/video_campaign_fix
video position for campaigns
2024-01-03 12:32:40 +02:00
Joakim Thorén
100664e019 Fix compilation error where gcc 12.1.0 (MinGW) errors with "writing 1 byte into a region of size 0" 2024-01-02 01:43:49 +01:00
Laserlicht
63ee20de6c
video campaign fix 2024-01-01 15:25:42 +01:00
Laserlicht
9066dbcbd4
spellbook fix pages 2024-01-01 14:57:55 +01:00
Laserlicht
cb9c4bbaf0 unlimited replay option 2023-12-28 20:48:19 +01:00
Laserlicht
a3e27b859e extra option tab 2023-12-28 19:41:01 +01:00
Laserlicht
f577f4cf6b
bugfix: enable first, then set text 2023-12-28 17:17:01 +01:00
Ivan Savenko
a9005da01e
Merge pull request #3366 from Laserlicht/battle_informations
Battle stacks informations
2023-12-28 12:39:26 +02:00
Laserlicht
c471b626a2
code review 2023-12-27 15:26:08 +01:00