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

6507 Commits

Author SHA1 Message Date
Ivan Savenko
18bbccd167 Unify formatting 2024-02-26 12:55:49 +02:00
Ivan Savenko
2632ab04f5 Partial support for json5 2024-02-26 12:55:49 +02:00
Ivan Savenko
41493d6f67 Implemented 'strict' json support 2024-02-26 12:55:49 +02:00
Ivan Savenko
d1c274f93f Replaced vector of strings with simple bool for flag 2024-02-26 12:55:49 +02:00
Ivan Savenko
922966dcf8 Renamed JsonNode::meta to more logical modScope. Member is now private 2024-02-26 12:55:49 +02:00
Ivan Savenko
e73516b7d1 Simplified template magic in JsonNode 2024-02-26 12:55:49 +02:00
Ivan Savenko
08a27663f9 Reworked JsonNode constructors to more logical form 2024-02-26 12:55:49 +02:00
Ivan Savenko
54796c7c56 Rename toJson to toString/toCompactString for consistency 2024-02-26 12:55:49 +02:00
Ivan Savenko
a2b8eaf7fb Do not escape '/' when writing json 2024-02-26 12:55:49 +02:00
Ivan Savenko
25146bfa93 Replace custom class with string_view 2024-02-26 12:55:49 +02:00
Ivan Savenko
ca9a16e30e Partially updated schema validation to draft v6 2024-02-26 12:55:49 +02:00
Ivan Savenko
bc9e961252 Better checks for incoming data 2024-02-25 20:05:52 +02:00
Ivan Savenko
6901945b6e Fix possible thread race on sending packet from two threads 2024-02-25 20:05:28 +02:00
Ivan Savenko
7b6b64894c
Merge pull request #3624 from IvanSavenko/fix_crash
Fix crash on using heal in SPELL_AFTER_ATTACK bonus
2024-02-25 15:01:32 +02:00
Ivan Savenko
7c843ff0f7
Merge pull request #3627 from IvanSavenko/random_town_names
Town names randomization fix
2024-02-25 15:01:22 +02:00
Tomasz Zieliński
af0207470d - Increased minimal obstacle density on surface
- Decreased minimal obstacle density in the underground
2024-02-25 12:25:23 +01:00
Tomasz Zieliński
2e8801084d Clean up RMG logs 2024-02-25 11:40:01 +01:00
Ivan Savenko
c513dc1bc7 Fix code style & formatting 2024-02-19 15:59:55 +02:00
Ivan Savenko
779625415f Guard against concurrent writes on same asio::socket instance 2024-02-19 13:47:06 +02:00
Ivan Savenko
f620a07389 Add protocol validation 2024-02-19 13:46:07 +02:00
Ivan Savenko
81e44711a2 Remove no longer needed workaround 2024-02-19 13:45:50 +02:00
Ivan Savenko
fc252bb9eb Random town names are now guaranteed to be unique on the map 2024-02-19 00:36:08 +02:00
Ivan Savenko
10b35ceecb Replaced assertions with exceptions for invalid input in RNG 2024-02-19 00:35:21 +02:00
Ivan Savenko
c0dc1040c2 Fixes crash on attempt to dynamic_cast AbilityCaster to Unit 2024-02-18 20:06:07 +02:00
Alexander Wilms
2ea78a5883 Fix float comparisons
Replace this "==" with a more tolerant comparison operation.
Floating point numbers should not be tested for equality cpp:S1244
2024-02-14 23:30:29 +01:00
Ivan Savenko
110ef5f66e
Merge pull request #3614 from IvanSavenko/sonarcloud_fixes_2
Sonarcloud fixes 2
2024-02-14 16:44:58 +02:00
Ivan Savenko
3740f8b02f Moved bonus parsing to a new file 2024-02-14 15:48:06 +02:00
Ivan Savenko
0b7bf56597 Remove old files 2024-02-14 14:02:41 +02:00
Ivan Savenko
c3957c2c2a Moved json files to new directory, split on per-class basis 2024-02-14 13:08:24 +02:00
Ivan Savenko
c23953eac5 Remove custom casts 2024-02-14 12:56:37 +02:00
Ivan Savenko
0d74959a33 Better float comparison 2024-02-14 12:07:07 +02:00
Ivan Savenko
6d6137accc Simplified code 2024-02-14 12:07:07 +02:00
Ivan Savenko
45c971a405 Replace throws() with nothrow 2024-02-14 12:07:07 +02:00
Ivan Savenko
7359b66f99 Do not use floating point equality checks 2024-02-14 12:07:07 +02:00
Ivan Savenko
9ebd194ab1
Merge pull request #3609 from IvanSavenko/single_process
Allow running server as part of client process
2024-02-14 12:06:22 +02:00
Alexander Wilms
678cacbd25 Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../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(":",2)
        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-13 15:21:30 +01:00
Ivan Savenko
763e18d202 Fix symlink target - use absolute path 2024-02-12 16:35:18 +02:00
Ivan Savenko
4c70abbeb5 Reduced usage of global variables - removed or made const / constexpr 2024-02-12 13:49:45 +02:00
Ivan Savenko
6e399eb21a Make some non-const static variables const or constexpr 2024-02-12 13:22:54 +02:00
Ivan Savenko
6db405167d Clarified some (im)possible null dereferences 2024-02-12 13:05:30 +02:00
Ivan Savenko
392c360f88 Replaced some usages of void * with more clear CPack * 2024-02-12 12:53:10 +02:00
Ivan Savenko
b796ed8626 Fix undefined behavior 2024-02-12 12:33:09 +02:00
Ivan Savenko
c03196257f Fix "identical expressions on both sides of comparison" 2024-02-12 12:32:35 +02:00
Ivan Savenko
c577ea3e8d Fix potentially uninitialized values 2024-02-12 12:31:27 +02:00
Ivan Savenko
a909d7ddde Removed cmake_modules/VCMI_lib macro, use it directly in place 2024-02-11 20:38:24 +02:00
Ivan Savenko
19ccef7131 Fix build 2024-02-11 19:54:30 +02:00
Ivan Savenko
cded8b1999 Show human-readable thread name in log 2024-02-11 17:55:02 +02:00
Ivan Savenko
f08c9f4d59 Renamed ENABLE_STATIC_AI_LIBS option to match its actual effect 2024-02-11 17:55:02 +02:00
Ivan Savenko
0d263c5571 Implemented option to run server as a thread with shared VLC 2024-02-11 17:55:02 +02:00
Ivan Savenko
c2286e5126 Server now consists from library and separate executable projects 2024-02-11 17:55:02 +02:00
Ivan Savenko
ef8eb330d6
Merge branch 'develop' into random_template_description 2024-02-11 17:54:18 +02:00
Ivan Savenko
f1a8e78f0b
Merge pull request #3596 from vcmi/fixes_for_water
Fixes for RMG water
2024-02-11 17:53:46 +02:00
Ivan Savenko
7790acae3a Fix save compatiblity with 1.4 2024-02-11 17:31:30 +02:00
Ivan Savenko
f2ecd4cf11 Merge branch 'develop' into 'lobby' 2024-02-11 16:13:13 +02:00
Ivan Savenko
ad602573ff
Merge pull request #3600 from dydzio0614/sod-fly
Fix SoD fly mechanics
2024-02-11 12:26:20 +02:00
Alexander Wilms
54b44aa5e8 Re-add virtual that was accidentally removed 2024-02-10 20:46:23 +01: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
Dydzio
4e927d6417 Fix missing gold component in "join for money" dialog 2024-02-07 21:57:25 +01:00
Dydzio
fd9810adf4 Working SoD version of fly 2024-02-07 19:27:02 +01:00
Ivan Savenko
18f9d29fd2 Fix typo 2024-02-07 00:15:20 +02:00
Ivan Savenko
9730b24214 Fix typo 2024-02-06 16:36:57 +02:00
Ivan Savenko
fd17133da3 Fix editor build 2024-02-06 00:40:26 +02:00
Ivan Savenko
1cecaf2bf5 Skip unresolved identifier from list of allowed heroes/artifacts in vmap 2024-02-05 22:26:53 +02:00
Ivan Savenko
a18f9d1e8d Added workaround for references to old 'torosar ' ID 2024-02-05 21:56:06 +02:00
Ivan Savenko
9e09fe08e1 Fixed duplicated hero check - was used too early, before hero type is
loaded
2024-02-05 21:55:48 +02:00
Ivan Savenko
87059be67b Added range checks to values read from h3m.
Fixes reading of morale/luck values (-3..3) as unsigned leading to
overflow.
2024-02-05 21:27:55 +02:00
Ivan Savenko
4af4d1a75e Remove excessive logging 2024-02-05 21:11:00 +02:00
Ivan Savenko
342e6daebd Fix copy-paste error 2024-02-05 21:07:50 +02:00
Ivan Savenko
9e5e7d95c3 Workaround for broken save compatibility 2024-02-05 18:46:48 +02:00
Ivan Savenko
b3c5882e11 Workaround for broken save compatibility 2024-02-04 21:22:51 +02:00
Ivan Savenko
d4bedd8d8d Fixed handling of match server crash 2024-02-04 19:58:09 +02:00
Tomasz Zieliński
af3c6450a7 Update comments 2024-02-04 08:56:45 +01:00
Tomasz Zieliński
7ce3553a6d Fix race condition when placing object at teh shore 2024-02-04 08:56:21 +01:00
Tomasz Zieliński
6528124c1e Do not fill water zone with obstacles 2024-02-04 08:55:51 +01:00
Ivan Savenko
7dee24edae Cleanup 2024-02-03 23:30:16 +02:00
Dydzio
365fedc7e8 Merge branch 'develop' into sod-fly 2024-02-03 20:40:32 +01:00
Ivan Savenko
80fc2bb695 Merge remote-tracking branch 'vcmi/develop' into lobby 2024-02-03 21:11:34 +02:00
DjWarmonger
c09d577a24
Merge pull request #3590 from vcmi/penrose_tiling
Positive opionions, no issues found.
2024-02-03 20:00:46 +01:00
Ivan Savenko
bd4c7e3ac0 Added LobbyPrepareStartGame pack to replace old workarounds 2024-02-03 19:57:23 +02:00
Ivan Savenko
2c2bec791c Fixes and cleanup of game client network shutdown and restart 2024-02-03 19:27:04 +02:00
Tomasz Zieliński
b7df6064cd Add random map description and display it in RMG menu 2024-02-03 16:23:56 +01:00
Tomasz Zieliński
e6f0afd586 Tweaking parameters, cleanup 2024-02-02 15:50:33 +01:00
Ivan Savenko
f97ffd8e9a Better handling of disconnects, code cleanup 2024-02-02 15:32:06 +02:00
Tomasz Zieliński
178f960533 First working version 2024-02-02 14:27:32 +01:00
Ivan Savenko
03fcfe3392 Use std::byte in serializer 2024-02-02 13:09:12 +02:00
Tomasz Zieliński
9f7c986621 First version that compiles successfully 2024-02-02 10:37:08 +01:00
Ivan Savenko
29c0989849 Use std::byte to manage network data 2024-02-02 02:02:09 +02:00
Ivan Savenko
58ee72f684
Merge pull request #3588 from IvanSavenko/fix_regressions
Fix regressions
2024-02-01 22:27:52 +02:00
Ivan Savenko
7247038458
Merge pull request #3574 from SoundSSGood/altar-fixes
Artifacts altar related fixes
2024-02-01 22:27:41 +02:00
Ivan Savenko
b25d4d76a7 Fix Grail digging success message 2024-02-01 18:22:11 +02:00
Ivan Savenko
e66a982c96 Fix backpack availability check in Grail digging 2024-02-01 18:21:54 +02:00
SoundSSGood
a42b60feb9 suggested changes 2024-02-01 13:28:08 +02:00
Ivan Savenko
290cc1510b Added text container with map translations to campaign state
Fixes missing translations for heroes names customized on maps after
their transfer to next scenario
2024-01-31 20:01:24 +02:00
Ivan Savenko
5c5fb523a4 Implemented transfer of artifacts held by non-transferred heroes 2024-01-31 19:32:59 +02:00
Ivan Savenko
6d0803dab6 Fixed decompression of slayer.h3c from french version from gog.com 2024-01-31 16:41:42 +02:00
Ivan Savenko
049c352511 Added loss condition "lose part of Angelic Alliance" to Yog campaign 2024-01-31 12:52:16 +02:00
Ivan Savenko
709d05205d Yog will now receive Angelic Alliance in his campaign 2024-01-31 12:42:02 +02:00
Ivan Savenko
2e4895766a Implemented tracking of objects destroyed by players 2024-01-31 01:37:33 +02:00
Ivan Savenko
ccea7fc1fb Yog will now only get Attack or Defence on leveling up 2024-01-31 00:18:10 +02:00
Ivan Savenko
a9866bb5c6 Added RandomGeneratorUtil::nextItemWeighted convenience method 2024-01-31 00:17:40 +02:00
Ivan Savenko
7992144763 Gem class is now Sorceress 2024-01-30 23:34:27 +02:00
Ivan Savenko
3abc26e789 Moved checks for campaign heroes to CGHeroInstance class 2024-01-30 23:33:58 +02:00
Ivan Savenko
c5c46a7c9a Implemented connecting to server via proxy 2024-01-30 21:31:41 +02:00
Tomasz Zieliński
c5aa31f46a First sketch 2024-01-30 18:04:15 +01:00
SoundSSGood
c6ca6ad835 sacrifice routine 2024-01-27 23:01:57 +02:00
SoundSSGood
652f009181 arts altar - arts holder 2024-01-27 15:28:21 +02: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
Ivan Savenko
2a193effcc Merge branch 'master' into 'develop' 2024-01-25 16:23:13 +02:00
Tomasz Zieliński
a2e0742ffb Fix invalid logic which made AI not attack guards 2024-01-24 13:45:05 +02:00
Ivan Savenko
702fc8077d Fix possible crash on invalid spell 2024-01-24 13:43:35 +02:00
Tomasz Zieliński
dbf53d78ba Fix invalid logic which made AI not attack guards 2024-01-24 06:20:46 +01:00
Tomasz Zieliński
5836e390f1 Do not place zone guards adjacent to 3rd zone 2024-01-23 13:45:35 +02:00
Ivan Savenko
b51e58cddc
Merge pull request #3544 from vcmi/fix_leaky_connections
Do not place zone guards adjacent to 3rd zone
2024-01-23 13:39:11 +02:00
Ivan Savenko
f83a004b54 Added workaround to prevent multithreaded access to bonus system in RMG 2024-01-23 00:49:18 +02: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
Tomasz Zieliński
b3adb9e554 Do not place zone guards adjacent to 3rd zone 2024-01-22 09:27:30 +01:00
Laserlicht
0a4b5dbe10
code review 2024-01-21 18:12:46 +01:00
Ivan Savenko
9f3655c41b Minor code cleanup 2024-01-20 23:26:04 +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
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
8e8d42bfa2 Try to simplify / cleanup code to localize crash 2024-01-20 18:40:03 +02:00
Ivan Savenko
912262e826 Avoid crash on invalid artifact in bank config 2024-01-20 18:17:23 +02:00
Ivan Savenko
24d25730ad Changed checks for null with checks for hasValue 2024-01-20 16:41:10 +02:00
Ivan Savenko
31b04780c9 Added hasValue method to identifiers 2024-01-20 16:40:51 +02: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
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
47f72af556 Client-side update, adapted and fixed login and chat 2024-01-19 23:49:59 +02:00
Ivan Savenko
4271fb3c95 Extension of lobby server functionality
Support for:
- listing of active players
- listing of active rooms
- joining and leaving rooms
- placeholder support for multiple chat rooms
- proxy connections
- invites into private rooms

(only lobby server side for now, client and match server need work)
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
78b7d9e726 Replaced open port check with server crash check 2024-01-19 23:49:59 +02:00
Ivan Savenko
aa7ecea683 Switch turn timers handling to boost asio timer 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
c9765a52ff Do not accept connections into ongoing game 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