Commit graph

204 commits

Author SHA1 Message Date
Robert Müller 727b147268 Move src/game/bezier.cpp/h to src/base/bezier.cpp/h
As those functions are not game specific per se, they can be part of base instead.

Closes #3334.
2022-09-24 20:53:59 +02:00
heinrich5991 47d06bd0ca Fix receiving IPv6 packets after IPv4 ones on Linux
Previously, the socket addresses were truncated as the `msg_namelen`
field is both input **and** output: After receiving an IPv4 packet, the
socket address field would be too short for an IPv6 address.
2022-09-20 01:06:56 +02:00
Dennis Felsing a67e30647e Add sv_sql_bindaddr (fixes #5830) 2022-09-13 17:09:53 +02:00
heinrich5991 acb0ce8a1e Unify string test naming 2022-09-11 23:40:32 +02:00
heinrich5991 911835f940 Add str_has_cc to check for control characters in strings 2022-09-11 23:39:16 +02:00
bors[bot] a3001f3bd1
Merge #5205
5205: Allow multiple addresses per server in the serverbrowser r=def- a=heinrich5991

Support is incomplete for `leak_ip_address_to_all_servers` (will only
ping the first address of each server) and for the `leak_ip` setting
(which will also only ping the first address of each server).

Fixes #5158.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-07-10 23:31:21 +00:00
Robert Müller bf686342df Fix performance-unnecessary-value-param 2022-07-10 21:42:57 +02:00
Robert Müller 99d1fb726c Fix modernize-loop-convert in tests 2022-07-10 21:42:57 +02:00
Robert Müller ad0ca6090a Fix modernize-use-bool-literals 2022-07-10 21:00:40 +02:00
heinrich5991 a9bf09f769 Move websocket address handling out of the client 2022-07-10 16:53:12 +02:00
heinrich5991 6600024f24 Allow multiple addresses per server in the serverbrowser
Support is incomplete for `leak_ip_address_to_all_servers` (will only
ping the first address of each server) and for the `leak_ip` setting
(which will also only ping the first address of each server).
2022-07-10 16:52:07 +02:00
Chairn a69dc599a9 Huge variable naming format
Fix pointer and pointer array variable naming

Huge renaming to match our rules

Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)[^a]\w+\[
            (?!(return|delete)\b)\b\w+ (?!(m_|ms_|g_|gs_|s_))[^a]\w+\[

Further format static variables

Format almost all pointer names accordingly

Used regex: (?!(return)\b)\b\w+
\*(?!(m_p|p|s_p|m_ap|s_ap|g_p|g_ap|ap|gs_ap|ms_ap|gs_p|ms_p))\w+\b[^:\(p]

clang-format

Fix CI fail

Fix misnamed non pointer as pointer and non array as array

Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)p\w+\b
            (?!return\b)\b\w+ (ms_|m_|g_|gs_|s_)a\w+\b[^\[]

clang-format

Revert to SCREAMING_SNAKE_CASE and reinstate dead code
2022-07-08 18:01:29 +02:00
c0d3d3v 498c2dbbcf
Renamed some time checkpoint related variables.
Init some of the time checkpoint variables explicitly
2022-07-06 15:13:55 +02:00
Chairn c9345e7d32 More vector naming format 2022-06-15 19:37:37 +02:00
heinrich5991 b3a3604c36 Remove namespace tw
It didn't have a clear role, it just acted as a distinguisher between
two functions with the same name.

Rename `tw::time_get` to `time_get_nanoseconds` and delete the old
`time_get_nanoseconds`. Move `CCmdlineFix` and the typed
`net_socket_read_wait` function to the global namespace.
2022-06-13 18:07:29 +02:00
bors[bot] 47b9bccd38
Merge #5391
5391: Format vector variables names (fixes #5209) r=Jupeyy a=Chairn


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-06-12 05:24:56 +00:00
def b8e83674eb /cptime fix 2022-06-12 00:55:11 +02:00
Chairn 14f7f2e041 Remaining formatting and fix github code scanning 2022-06-11 22:03:23 +02:00
Dennis Felsing 1e94d1fa79 Remove sv_checkpoint_save 2022-06-08 21:10:40 +02:00
Dennis Felsing 7686dcc921 Add /timecp command to get another players time checkpoints
Useful to compare your performance against another player. Currently can
only be done by renaming yourself to the player's name
2022-06-08 21:10:36 +02:00
Dennis Felsing a2cd441d1c Get best Time Checkpoints back if map has one
Even if you made a better finish without time cps before. Can happen now
that we add Time CPs to existing maps:
https://docs.google.com/spreadsheets/d/1yMMBLSbS2cOSYsbIMkDZpMLaV6k930mXj5yVZF0Uuaw/edit#gid=0
2022-06-08 15:37:50 +02:00
Robert Müller e6bd84d4fd Extract CCmdlineFix to call cmdline_fix and cmdline_free automatically 2022-06-06 12:46:58 +02:00
Robert Müller a3a594b2d8 Remove unused include from test 2022-05-29 13:10:49 +02:00
Robert Müller c6e195a399 Use std::vector<CNameBan> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller bea74f3d4f Remove base/tl/sorted_array.h 2022-05-27 00:03:13 +02:00
Zwelf 86f57289c6 Record player switch in teehistorian 2022-05-21 21:37:17 +02:00
Zwelf b99d8dc259 Always apply last sent input
Makes teehistorian during spawn more reproduceable.
Currently during respawn the first applied input doesn't get recorded.
Always appliying the last sent input fixes this.
2022-05-21 21:34:30 +02:00
Zwelf 5e4722e8ba Bump teehistorian minor version due to different input handling 2022-05-21 21:34:30 +02:00
Dennis Felsing 402cccf8f2 Add override in code behind CONF_DISCORD, disable clang-tidy check 2022-05-18 01:19:35 +02:00
bors[bot] a041ff8aed
Merge #5069
5069: Some HTTP fixes factored out of the HTTP masterserver PR r=def- a=heinrich5991

CC #5064

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-05-15 22:20:11 +00:00
Zwelf 7ada897478 Enhance teehistorian test output a bit
Looks cleaner now, e.g. for TeamPractice:

```
[ RUN      ] TeeHistorian.TeamPractice
pOutput = {
	0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81, 0xd1, 0x34
	0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3, 0xbc, 0x02
	0x17, 0x01, 0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x01, 0x01, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x17, 0x00, 0x40
}
[       OK ] TeeHistorian.TeamPractice (0 ms)
```
2022-05-13 23:36:05 +02:00
heinrich5991 52d0dc8b5b Add functions to encode/decode base64 2022-05-13 09:00:48 +02:00
Zwelf 30f67573f4 Output corresponding array to EXPECTED in teehistorian test cases 2022-05-12 16:21:13 +02:00
heinrich5991 fa4bcd5ec0 Unify logging infrastructure between IConsole and dbg_msg
This makes the "black console window" less important on Windows (or
anywhere else, for that matter), lets you see logs from other threads in
the f1 console, and removes the distinction between `IConsole::Print`
and `dbg_msg`.
2022-04-29 15:21:26 +02:00
Dennis Felsing 843acf6a5a Use std::size instead of sizeof(a) / sizeof(a[0]) 2022-03-30 18:55:04 +02:00
srdante cb5fab5958 Fix tests 2022-03-28 20:27:14 -03:00
Chairn 5fe3e9af85 clang-format 2022-03-24 17:59:49 +01:00
Chairn 6086893fa6 Renamed all shadowing/shadowed variables 2022-03-24 17:59:49 +01:00
ChillerDragon 99b0eb2819 Add str_startswith_nocase and str_endswith_nocase 2022-03-13 11:42:45 +01:00
Robert Müller 66d64ec3fd Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
ChillerDrgon 064ba50230 Add secure_random_uninit 2022-02-14 12:06:31 +01:00
Zwelf 3ea55dcc0e Record player_ready event in teehistorian 2022-02-07 23:31:46 +01:00
heinrich5991 4d90119f25 Don't flush all files, some improvements to io_sync
- Empty buffers using `io_flush` before calling the OS function for
  syncing the file to disk.
- Fix error return of `io_sync` on Windows.
- Don't indiscriminately flush all files on close.
- Add a test that `io_sync` can return without error.
2022-02-01 02:33:18 +01:00
heinrich5991 7a6f5a8af4 Add a function for getting a handle to the current executable file 2022-01-31 21:31:26 +01:00
heinrich5991 67508adff1 Add function to get the OS version 2022-01-31 03:15:19 +01:00
heinrich5991 810787a905 Fix Serverbrowser.PingCache test on Windows 2022-01-31 03:15:19 +01:00
Dennis Felsing f346e445bd Fix timestamp in record_maps in test (fixes #4631) 2022-01-24 20:58:14 -03:00
Robert Müller 0726703937 fix undefined behavior in byte packing functions, add tests 2021-12-31 13:18:41 +01:00
Robert Müller 07a8d21224 fix argument order in test, use constant 2021-12-27 23:41:52 +01:00
Robert Müller 2ffd0ddae2 fix invalid left shift in CVariableInt::Unpack, add tests 2021-12-27 18:00:15 +01:00