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

231 Commits

Author SHA1 Message Date
Laserlicht
8edf77afcc basic handicap support 2024-07-25 00:28:01 +02:00
Ivan Savenko
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
Ivan Savenko
696cce7f7f
Merge pull request #4253 from smanolloff/random-port
Bind VCMI server to a random TCP port
2024-07-16 12:25:29 +03:00
Simeon Manolov
9d73b50979
Bind server to a randomly assigned port 2024-07-12 01:06:36 +03:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
Laserlicht
539ffb3810
fix campaign highscore sum 2024-06-23 15:40:46 +02:00
Ivan Savenko
b8beb4fb13 Fixes for various minor issues detected by Sonar Cloud 2024-06-01 11:48:30 +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
da9d82b697
Merge pull request #3973 from vcmi/master
Merge master -> beta
2024-05-14 16:59:10 +03:00
Ivan Savenko
22d51bd473 Fix freeze on closing game window while in game 2024-05-14 12:32:22 +00:00
Ivan Savenko
f8e4e41c39 Fix possible thread race on server shutdown:
- Main thread shutting down server from player request
- Network thread shutting down server due to server shutting down
network
2024-05-13 16:00:19 +00:00
Ivan Savenko
d295784f6e Shutdown server immediately without leaving hanging server in main menu 2024-05-13 15:43:05 +00:00
Ivan Savenko
93038b791e Fix connection termination handling 2024-05-13 14:09:59 +00:00
Ivan Savenko
a74d9791a1 Remove indirect calls to CSH from server handler itself 2024-05-11 13:19:07 +00:00
Ivan Savenko
46f2b8b2d7 Attempt to fix weird crash on game start 2024-05-11 13:19:07 +00:00
Ivan Savenko
e89e5d2127 Rename for clarity 2024-04-07 21:22:33 +03:00
Ivan Savenko
0a296add0c apply SonarCloud suggestions 2024-04-07 21:21:48 +03:00
Ivan Savenko
80acd7e77c Simplified and fixed server restart procedure:
- Replaced several assertions with runtime_error's to detect them in
release builds
- Removed multiple dispatchMainThread calls in server shutdown code to
simplify debugging and code flow
- Moved handling of gameplay shutdown and score calculation from
PlayerInterface to ServerHandler (not perfect, but better than before)
2024-04-07 14:19:57 +03:00
Ivan Savenko
829b754091 Implemented matches history in lobby 2024-03-27 13:10:55 +02:00
Ivan Savenko
4ed961fb96 Partially unified handling of pregame and in-game chats 2024-03-27 13:10:55 +02:00
Tomasz Zieliński
e7af9d5607 Code review fixes, Sonarcloud fixes 2024-03-04 21:23:17 +01:00
Tomasz Zieliński
f650072da1 Remove useless code 2024-03-01 11:46:01 +01:00
Tomasz Zieliński
5f95955535 Store and load last difficulty setting 2024-03-01 10:57:48 +01:00
Ivan Savenko
fe918de2df Remove invalid assertion 2024-02-19 00:36:21 +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
Ivan Savenko
7c34d48258 Minor fixes and corrections to network-related code. No functionality
changes.
2024-02-12 18:57:20 +02:00
Ivan Savenko
74f9b03516 Fix crash on closing client while server is active 2024-02-12 16:36:13 +02:00
Ivan Savenko
0fc0ad238b Fixes for server shutdown logic, implemented connection aborting for
local server
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
38ba42ef7a Rename 'c' to 'logicConnection' 2024-02-11 16:26:27 +02:00
Ivan Savenko
f2ecd4cf11 Merge branch 'develop' into 'lobby' 2024-02-11 16:13:13 +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
1a144fc516 Some progress on private rooms support 2024-02-10 19:02:25 +02:00
Ivan Savenko
d4bedd8d8d Fixed handling of match server crash 2024-02-04 19:58:09 +02:00
Ivan Savenko
7dee24edae Cleanup 2024-02-03 23:30:16 +02:00
Ivan Savenko
1b6ac1052a Properly lock UI mutex on accessing GUI state from network thread 2024-02-03 22:24:32 +02: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
Ivan Savenko
29c0989849 Use std::byte to manage network data 2024-02-02 02:02:09 +02:00
Ivan Savenko
c12558bf8a Simplified code 2024-02-02 01:26:53 +02:00
Ivan Savenko
c5c46a7c9a Implemented connecting to server via proxy 2024-01-30 21:31:41 +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
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
cc7fc4a2c6 Fix headless mode 2024-01-20 22:55:27 +02: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