Commit graph

213 commits

Author SHA1 Message Date
heinrich5991 f0c647dba5 Change os_compare_version to os_is_winxp_or_lower
This stops leaking OS details in non-`system.c` files.
2017-11-23 03:10:15 +01:00
bors[bot] 5528cde5f6 Merge #869
869: Complete rework of the ghost and race recorder r=Learath2 a=Redix

This PR fixes a lot of issues with the ghost and race recorder, introduces a new ghost file format and implements some pretty useful features.

**A quick overview:**
 - When you cross the start line multiple times, both (ghost and recorder) will only restart if it is a non-solo server
 - If available, both will use the race timer to recognize the start instead of searching for the start line
 - Fastcap support for both
 - The recorder immediately starts when the Tee spawns, so the preparation steps (which are quite important for speedruns) will be included in the demo. If you do not cross the start-line within 20 seconds, it will stop the demo until you really start.
 - Better ghost menu (colors, reloading, deleting and saving ghosts)
 - The ghosts are more resistant against lags (old ones were sometimes completely useless due to small lags)
 - New ghosts files are significantly smaller
 - Cleanup, bugfixes..


**About the new ghost format (version 4/5):**
This format is used by Teerace for over a year now. The code for handling the binary files was moved to the engine. It includes an auto updater which creates a backup of all ghosts and converts them to the new format afterwards. The major differences from the format used by DDNet right now (version 2), are the ability to store multiple types of data, the usage of delta-encoding and a more portable header.

For whatever reason, the ghost stores values for every predicted tick, but without tick information, so lost snapshots can make them unusable. The new code uses the original values from the snapshots including ticks but it can also handle the old ones without. Since hardly any server uses the high bandwidth option this practically reduces the file size.

Like the demo recorder the ghost recorder directly stores the data to a file (every 50 snapshots) instead of writing the whole file at the end of the race. Indeed this can be changed with only a few lines if the old behavior is preferred.

The updater can handle version 2 (DDNet) and 3 (old teerace format, only slightly different from version 2) files. The updating already happens when the files are scanned for generating the list in the menu and not only when you activate them. The change from version 4 to 5 was only needed due to a bug in the implementation, the ghost loader can read both.

Some numbers about the file size: (map: hotrun, both about 30 seconds)

 - Old ghost: 30.4 kB (converted: 10.7 kB)
 - New ghost: 5.4 kB


**One thing about the race recorder:**
The old implementation compared the new file only with the first file it found for the particular map. The new one compares with all related demos and deletes them possibly, so that only the best demo is left. Since DDNet can also store the demos without name, this might also delete demos from other players, that you might have in your directory.
To prevent this I at least check whether the demo contains the player name if `cl_demo_name` is on. 
In my opinion the better solution would be to remove `cl_demo_name` and always use the player name.
2017-10-30 20:27:10 +00:00
ChillerDragon 86f4deef8c fixed boardcast 2017-10-24 13:40:35 +02:00
heinrich5991 b463197348 Add CTestInfo class, add test for create-close-remove process 2017-10-23 00:13:53 +02:00
heinrich5991 c654d82fd2 Fix -Wtypedef-redefinition for struct ASYNCIO
Fixes #912.
2017-10-20 11:24:45 +02:00
heinrich5991 e989ffad78 Rename async_* to aio_* and add test for nondivisible buffer lengths 2017-10-13 02:48:42 +02:00
heinrich5991 8e778cd9ab Address pull request comments 2017-10-13 02:29:18 +02:00
heinrich5991 13f0655cba Don't reset ASYNCIO_CLOSE flag on async_wait 2017-10-12 00:53:12 +02:00
heinrich5991 2fc018aac3 Add asynchronous file output, port dbg_msg()s to that system
Also add tests.
2017-10-10 04:11:14 +02:00
heinrich5991 7de42a1414 Couple of thread fixes 2017-10-10 00:08:24 +02:00
Redix a3a82b6571 Move filename clearing function to base lib 2017-09-28 16:02:01 +02:00
Redix e8d3469465 Fix fs_rename on windows 2017-09-28 16:01:56 +02:00
def fe208fb631 Cleaner logger 2017-08-31 20:07:43 +02:00
def 31ecbc3cf1 Don't skip items when logging 2017-08-31 19:51:58 +02:00
def 705349f2e5 Clean up and fix semaphores and threading 2017-08-31 19:18:07 +02:00
Learath2 cd386488e2 Rename semaphore_* to sphore_*
Previous naming conflicted with Mach kernel definitions.
2017-08-31 19:18:07 +02:00
Learath2 abb9891947 Use the pointer address to ensure uniqueness 2017-08-31 19:18:07 +02:00
Learath2 573b75b1b2 Forgot the / for semaphore name 2017-08-31 19:18:07 +02:00
Learath2 fd17477f06 Enable threaded logging on OSX 2017-08-31 19:18:07 +02:00
Learath2 a8e19205dc Fix conceptual mistakes 2017-08-31 19:18:07 +02:00
Learath2 153c6871c8 Try (ab)using named semaphores on OSX 2017-08-31 19:18:07 +02:00
def 5d8a0ddc1e Add time in console 2017-08-04 22:38:22 +02:00
def d6143cb26f How come no one notices that we're missing the day in our logs?... 2017-07-30 15:40:37 +02:00
def 3eb079bd64 Correct type in printf 2017-07-30 12:43:54 +02:00
def d6deb707c8 no pragmas in functions 2017-07-30 12:35:54 +02:00
Learath2 4622ab4cb6 Merge pull request #814 from heinrich5991/pr_ddnet_fix_cmake_mac
Fix the CMake Mac build
2017-07-30 11:38:12 +02:00
heinrich5991 6247aa0c7f Enable -Wextra and -Wformat=2
Also annotate `dbg_msg`, `str_format` and `str_timestamp_ex` so that the
compiler can determine whether the format strings are correct.

Fix the compiler warnings generated by these extra warnings -- some of
them were security issues.
2017-07-27 20:38:17 +02:00
heinrich5991 ed0949cb2e Remove unused function gui_messagebox
The Mac implementation was causing problems and it wasn't used anywhere.
2017-07-26 11:38:26 +02:00
def 34c8b047ea Oldschool C please 2017-07-22 21:20:15 +02:00
def 53565aa937 fixes 2017-07-09 14:56:57 +02:00
heinrich5991 409bc0e019 Ensure null-termination in str_escape
This also fixes a couple of potential buffer overflows. The affected
code is still buggy (doesn't do the right thing on potential buffer
overflow), but at least it won't result in crashes/out of bound writes
anymore.
2017-07-08 13:06:03 +02:00
def 36d5c8d608 string toggling supports escaped strings; also some code cleanup 2017-07-08 11:03:51 +02:00
def 7a83af4d1b Fix Mac build 2017-06-02 22:10:58 +02:00
def fe89b65368 Stupid C90 2017-06-02 20:31:37 +02:00
def a6e144ea72 Let's not crash the client and server on dbg_assert 2017-06-02 20:12:20 +02:00
def 9b48e902f0 Prevent data race when initializing loggers 2017-06-02 18:47:26 +02:00
Dennis Felsing 63ca2f8749 Show nr of skipped log messages 2017-04-21 10:50:16 +02:00
def d84911618a Don't block when logging queue is full, instead ignore message 2017-04-20 21:25:20 +02:00
heinrich5991 d98abf35db Rename WEBSOCKETS to CONF_WEBSOCKETS 2017-03-07 13:03:37 +01:00
heinrich5991 c201d7959c Enable -Wdeclaration-after-statement for compat with MSVC 2017-03-07 13:02:37 +01:00
heinrich5991 6302e4d7e0 Fix some style issues and a > to >= 2017-03-06 20:11:23 +01:00
Learath2 8c79f28802 Fix a crash on malformed input 2017-03-06 15:18:52 +01:00
Learath2 3c6a21ace2 dbg_assert felt more appropriate 2017-03-06 12:58:49 +01:00
Learath2 939a7f0d3f This time actually add error checking to str_hex_decode 2017-03-06 12:33:29 +01:00
Learath2 ed5824589c Make str_hex_decode a little more friendly 2017-03-04 23:06:07 +03:00
Learath2 b7cbaedea0 New auth system for rcon 2017-03-02 18:16:29 +03:00
heinrich5991 cd3b0ae855 Implement the confusable algorithm from Unicode more closely
See UTS#39 "Unicode Security Mechanisms":
http://www.unicode.org/reports/tr39/

This means that characters with accents or other things around them are
now considered the confusable with the base character.

Fixes #557. Fixes #575.
2016-10-30 13:45:55 +01:00
east 3b8c17d9d6 fixed VS compilation 2016-10-06 13:03:48 +02:00
heinrich5991 89b6d0c3da Fix C89 compilation and a copy&paste mistake 2016-10-03 12:31:11 +02:00
heinrich5991 e950351346 Put the password generation into base 2016-10-01 23:04:16 +02:00