staphen
13b5fb82fa
Build ASIO without exceptions
3 years ago
Gleb Mazovetskiy
a7a2b92421
tcp_client: Fix `SDL_SetError` call
...
Can't pass `std::string_view` for the `%s` placeholder.
3 years ago
staphen
98c0e8f2da
Don't use inheritance with tl::expected
3 years ago
staphen
bb83d527d2
Change server_exception from dvlnet_exception to PacketError
3 years ago
staphen
d4b33685a2
Prefer ASIO functions that take error codes
3 years ago
Gleb Mazovetskiy
040c4fe82f
Generalize support for Windows without wchar APIs
...
Replaces `NXDK` ifdefs that relate to the lack of wchar APIs
with the more general `DEVILUTIONX_WINDOWS_NO_WCHAR` ifdefs.
This should make it much easier to port to Windows 98.
3 years ago
Gleb Mazovetskiy
4d0341afb5
net: Replace `packet_exception` with `tl::expected`
...
The network code still has ways to go to get rid of exceptions,
this is but a small first step.
Co-authored-by: Stephen C. Wills <staphen@gmail.com>
3 years ago
Gleb Mazovetskiy
78af369e6e
net: Remove template parameter for cdwrap
...
1. There is no reason for cdwrap to be templated, it can simply store
the factory function reference instead.
2. Marks overriden virtual functions as `override` instead of `virtual`.
3 years ago
Gleb Mazovetskiy
cf925d1edc
Replace tuples with structs
...
Structs are more readable because the fields have names.
3 years ago
Gleb Mazovetskiy
43dbd8cb57
Bump libfmt
...
Hopefully we'll be able to get rid of the custom nxdk fork soon.
3 years ago
Anders Jenbo
1616318bb1
Bump version to 1.5.1
3 years ago
Gleb Mazovetskiy
5355146d51
Use structured bindings
3 years ago
Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
14540164a7
Remove utils/stdcompat/optional.hpp
3 years ago
staphen
663c33475b
Introduce function to determine if ZT comms channel to peer is relayed
3 years ago
Gleb Mazovetskiy
8101e2c0ba
Add `c_any_of` and friends
...
Adds handy helpers for performing algorithms on the entire container.
They're prefixed with `c_` for container.
This naming convention is identical to some popular C++ libraries, such
as Abseil.
3 years ago
Eric Robinson
074a1f2e0c
Rename: Loopback -> Offline ( #6300 )
3 years ago
staphen
874ccdb69a
Fix TCP join crash when entering password for public game
3 years ago
Anders Jenbo
343db308fc
Bump version to 1.5.1-dev
3 years ago
Anders Jenbo
0438be6cf3
Bump version to 1.5.0
3 years ago
Gleb Mazovetskiy
5bf0b8bc96
Add more missing <cstdint> includes
...
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
3 years ago
Gleb Mazovetskiy
4fa3732526
Add missing <cstdint> includes
...
Done with the following script:
```ruby
Dir["Source/**/*.{h,c,cc,cpp,hpp}"].each do |path|
v = File.read(path)
next if !v.include?("uint32_t") || v.include?("cstdint")
lines = v.lines
line_num = if lines[2].start_with?(" *")
lines.index { |l| l.start_with?(" */") } + 3
else
3
end
lines.insert(line_num, "#include <cstdint>\n")
File.write(path, lines.join(""))
end
```
then fixed-up manually
3 years ago
staphen
f30c42c3a8
Use symlinks to work around lack of Unicode support for paths in ZeroTier
3 years ago
Gleb Mazovetskiy
1a1a282d9a
Use C FILE instead of C++ streams throughout
...
Reduces binary size by ~2 KiB and may improve compatibility with oddball
systems (e.g. PS2).
3 years ago
staphen
076da2aefe
Relax latency requirements for online games
3 years ago
Anders Jenbo
1a633c5627
Reject games info of unexpected size ( #5646 )
3 years ago
Anders Jenbo
872456ae5d
Use size_t for a select few pnum variables
4 years ago
Gleb Mazovetskiy
188dc79f6e
Make `Players` a vector
4 years ago
baosen
e68f2b46da
Fix the string PT_ECHO_REPLY. ( #5203 )
4 years ago
Mikołaj Piróg
dda0b96ea5
Remove #defines in player.h and add constexpr where applicable ( #4896 )
...
* Change defines to constexpr int in player.h
* Add const or constexpr to player.h/cpp where applicable
* Update tests with changed names of player constatns
* remove unecessary variable
4 years ago
Anders Jenbo
223fbe8387
Correctly check size of glpMsgTbl
4 years ago
Kalebe Alves
4130c37d17
Enforce override virtual methods
4 years ago
Gleb Mazovetskiy
b7404af9c7
Fix build with NONET and no exceptions
...
Fixes the build with `-fno-rtti` and `-fno-exceptions`.
Building with these flags reduces the binary size by more than 200 KiB.
4 years ago
Gleb Mazovetskiy
779ccaca17
Overhaul translation fetching
...
1. Do not modify the map after loading. Instead, return string views
(guaranteed to be null-terminated) from look up functions and return
the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
Saves a bit of RAM (~50 KiB) and improves lookup performance.
4 years ago
staphen
18bfe39d5b
Reset plr_self after leaving game session
4 years ago
Anders Jenbo
4b8eba1768
Update zerotier_native.h
4 years ago
Anders Jenbo
d42fdd7745
Bump dvl_multicast_addr in preperation for 1.4.0
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
staphen
dcfd057200
Add two-way handshake between ZeroTier peers
4 years ago
staphen
b14fda976f
Fix IsGameHost() function for ZeroTier
4 years ago
Stephen C. Wills
ef1821ce57
Apply sequence number to net turns ( #4122 )
4 years ago
staphen
16f82226eb
[ZeroTier] Send PT_CONNECT to all players when new player joins
4 years ago
staphen
3b3419d519
Treat firstpeer as a recognized source of packets
4 years ago
staphen
e877a8ff0a
Filter out ZeroTier packets that do not come from an expected source
4 years ago
obligaron
1f7b0607a6
public game browsing: show difficulty, speed, players and possible incompatibility
4 years ago
obligaron
79b926c375
Move more options to OptionEntryBase
4 years ago
obligaron
0888546d62
Make DvlNet_SendInfoRequest non blocking
4 years ago
staphen
9b32c8d541
Update libzt to the latest version
4 years ago
ephphatha
0cd7c530bc
Drop connections when a packet with length 0 header is received
...
This prevents malicious connections crashing a game by sending null bytes, but might still allow errors when packets are manually crafted.
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago