1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

66 Commits

Author SHA1 Message Date
4d57a8ed36 Prefer to pass CGameState as reference instead of pointer 2025-04-27 14:57:31 +03:00
f9989d9152 Cleanup serializer/deserializer code 2025-04-27 14:57:31 +03:00
d1d2cf4189 Fix crashes on game start, gamestate now derives from GameCallbackHolder 2025-04-27 14:57:31 +03:00
4ed13409c2 Remove serialization of raw pointers from serialization 2025-04-27 14:57:31 +03:00
8ec3e5210a Remove no longer needed support for gamestate vectors serialization 2025-04-27 14:57:31 +03:00
63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
0efa39ec79 Fix pack name in logs 2025-02-06 14:21:32 +00:00
c1c552d394 Replaced some of pointers to CPack's with references 2024-10-07 14:59:14 +00:00
48c92711f2 Fixed deserialization of new artifacts (and possibly some other objects)
Was broken in my previous PR, since pointer graph serialization was
enabled by default, leading to deserializationFix triggering on netpack
apply.

Cleaned up / clarified code
2024-07-29 18:19:15 +00:00
31738e8f90 Always track already serialized pointers to avoid infinite recursion on
sending complex objects
2024-07-20 18:29:41 +00:00
e5dba942ac Clear buffer (if any). Avoids false-positives with memcheck if buffer
contains old data
2024-06-12 18:13:21 +00:00
888149c6f6 Implemented simple versioning system for multiplayer 2024-05-29 20:08:32 +00:00
bc9e961252 Better checks for incoming data 2024-02-25 20:05:52 +02:00
6901945b6e Fix possible thread race on sending packet from two threads 2024-02-25 20:05:28 +02:00
bd4c7e3ac0 Added LobbyPrepareStartGame pack to replace old workarounds 2024-02-03 19:57:23 +02:00
2c2bec791c Fixes and cleanup of game client network shutdown and restart 2024-02-03 19:27:04 +02:00
03fcfe3392 Use std::byte in serializer 2024-02-02 13:09:12 +02:00
29c0989849 Use std::byte to manage network data 2024-02-02 02:02:09 +02:00
322c5faf63 Merge remote-tracking branch 'vcmi/develop' into lobby 2024-01-26 16:52:23 +02:00
388ca6e776 Added list of active accounts and rooms to UI. Added room creation logic 2024-01-26 16:32:36 +02:00
fc4ae3bd8c Merge remote-tracking branch 'vcmi/develop' into lobby 2024-01-20 23:01:49 +02:00
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
80e960bc8e Finalized new TCP networking API 2024-01-19 23:52:28 +02:00
22f0ca67c6 Fix connection to game lobby & map load 2024-01-19 23:49:59 +02:00
0a1153e1c6 Switch client-server communication to new API 2024-01-19 23:49:59 +02:00
60ffb81b33 Replaced remaining placeholder code with callbacks 2024-01-19 13:55:22 +02:00
84d9078bd9 Throw exception instead of failing with SIGSEGV 2023-12-17 19:44:45 +02:00
a1f4748bbc Fix socket shutdown 2023-12-03 19:44:58 +02:00
5d16f035d7 Workaround for crash on winning the game 2023-11-27 14:09:08 +02:00
a6f37b7cd7 Fixed few more memory leaks in client 2023-11-13 16:27:15 +02:00
5c810df36f Reorganized types registration code 2023-11-11 00:39:08 +02:00
7f72f7a82c Cleanup server connection code a bit 2023-07-30 20:15:32 +03:00
85262cf4f5 Moved CGameState files into a separate directory 2023-06-26 17:15:59 +03:00
acac42291e Remove excessive CMap.h includes 2023-05-31 23:18:38 +03:00
ea1d177c9b Fixed false error messages on game startup 2023-03-31 01:28:56 +03:00
8661496f6c vcmi: modernize lib/serializer 2023-02-12 21:23:00 +03:00
a954cc08fb Made intermediate class to hide some implementation details from header. 2022-12-27 12:55:31 +02:00
c271f9187f Connection buffered read cpack. 2022-12-26 21:49:53 +02:00
cb13064a62 Socket buffered write. Write full cpack at once 2022-12-26 20:17:53 +02:00
35e1b86683 remove no longer needed adjustments 2022-09-24 15:55:24 +03:00
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
dde9a5d5d2 todo updates 2022-09-24 15:55:17 +03:00
2e18299897 make server a static lib, run it in a separate thread
issues to solve:
- dynamic_cast error 2: One or more of the following type_info's has hidden visibility or is defined in more than one translation unit. They should all have public visibility. 13CPackForLobby, 20LobbyClientConnected, 20LobbyClientConnected.
- error setting socket option: set_option: No buffer space available
2022-09-24 15:55:16 +03:00
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
224ea28433 Fix various memory errors related to server and connections.
* keep connection when restarting scenario
* wrong double free in Connection
* multiple use after free when stopping server
* double free of StartInfo
2018-05-01 00:04:20 +03:00
f5d8e5b0cc Move Boost Asio compatibility code to Global.h. Fix by @dydzio06143 2018-04-05 19:35:08 +07:00
74e5c5bf05 CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
83c6ffbda0 Reflect changes in boost::asio released in Boost 1.66. (#428)
The service template parameters are disabled by default for now.
Use BOOST_ASIO_ENABLE_OLD_SERVICES macro to enable the old interface.
2018-03-11 21:02:20 +08:00