Gleb Mazovetskiy
31c28e719a
Avoid `strnlen`
...
`strnlen` is not available on some platforms, such as macOS 10.4.
1 year ago
Gleb Mazovetskiy
6180d3dd3d
Reduce map lookups in dvlnet
2 years ago
qndel
24f108f193
fix many typos ( #7322 )
2 years ago
Gleb Mazovetskiy
730c26a856
Migrate maps to unordered maps
2 years ago
Gleb Mazovetskiy
e9c29fa806
Switch to ankerl::unordered_dense
2 years ago
Gleb Mazovetskiy
35e93366f6
Replace uses of deprecated u8path
2 years ago
Gleb Mazovetskiy
637b51c103
Fix a few more warnings
...
The pure attribute on `StaticVector#empty` is needed so that
it can be used in `DVL_ASSUME` without a warning about side-effects in
assume.
2 years ago
staphen
78eb3c7fe9
Parse TCP host using hostname:port format
2 years ago
obligaron
b0f0da5537
Fix remaining MSVC warnings in network code
2 years ago
obligaron
ccaf8d1dac
Use uint8_t in msg/multi/sync and fix MSVC warnings ( #6856 )
...
* Fix MSVC warnings in msg.cpp
* Move TBuffer to multi.cpp
* Fix MSVC warnings in multi.cpp
* SNet* change databytes to size_t
* msg/muli/sync: Change playerId to uint8_t
2 years ago
Gleb Mazovetskiy
e5c7f0f174
Only enable exceptions for builds with ZeroTier ( #6824 )
...
Co-authored-by: staphen <staphen@gmail.com>
2 years ago
staphen
73777b276a
Ignore invalid PT_DISCONNECT packets instead of crashing
2 years ago
staphen
2e958ee546
Avoid sending PT_DISCONNECT packet to dropped player
2 years ago
staphen
a23119ae1c
Get rid of protocol_exception
2 years ago
Anders Jenbo
9c6902b2c4
Fix missing return value in tcp_server::send()
2 years ago
staphen
ed7b8e794f
Fix missing return value in tcp_server::StartSend()
2 years ago
staphen
9d34cb2795
Remove frame queue exceptions from the network layer
3 years ago
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