Commit graph

555 commits

Author SHA1 Message Date
yeojingkang 6e9c370eca Added constexpr to math functions 2020-08-20 04:47:09 +08:00
def 539c20a200 Add support for PLATFORM_SUFFIX define
So that we can set it like this:

  CXXFLAGS='-DPLATFORM_SUFFIX="steam"' CPPFLAGS='-DPLATFORM_SUFFIX="steam"' make
2020-08-19 13:41:06 +02:00
def 467778fc56 Satisfy old C standard
system.c:2325:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for(int cursor = 0, pos = 0; pos <= truncation_len && cursor < dst_size && size != cursor; cursor = str_utf8_forward(src, cursor), pos++)
2020-08-10 18:11:51 +02:00
Zwelf 81e5bb924c Move sync_barrier to only used place
to remove `#include <windows.h>` from header file preventing compiling on windows
2020-08-09 18:17:42 +02:00
def e2fde4d730 Fix utf8 handling in str_truncate (fixes #2533)
and rename to str_utf8_truncate since it's only used for utf8 strings
2020-08-02 18:32:42 +02:00
def f4344dc420 Use (u)int64 from system.h instead of (u)int64_t from cstdint
src/game/client/prediction/gameworld.h:62:90: error: ‘int64_t’ has not been declared
   62 |  void CreateExplosion(vec2 Pos, int Owner, int Weapon, bool NoDamage, int ActivatedTeam, int64_t Mask);
      |                                                                                          ^~~~~~~
2020-07-09 13:55:28 +02:00
3edcxzaq1 f30fe2b4b5 fix indentation 2020-06-29 23:07:57 +02:00
3edcxzaq1 1be3b7ead5 Suppress open_link output 2020-06-29 21:34:07 +02:00
heinrich5991 741c3a705e Revert "Fix str_format on mingw"
This reverts commit a9f6d3716c.
2020-06-29 13:48:51 +02:00
def a9f6d3716c Fix str_format on mingw
src/game/server/ddracecommands.cpp:743:39: warning: unknown conversion type character ‘l’ in format [-Wformat=]
  743 |  str_format(aBuf, sizeof(aBuf), "%s-%lld-%s.save", pSelf->Server()->GetMapName(), time_get(), pSelf->Server()->GetAuthName(pResult->m_ClientID));

See https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/
2020-06-22 14:47:40 +02:00
def 70b8bf9497 Open links in background (fixes #2292)
Only tested on Linux
2020-06-20 14:59:36 +02:00
bors[bot] 4edac3143a
Merge #2281
2281: Add Learn button which opens the ddnet wiki in the browser. r=heinrich5991 a=edg-l

![image](https://user-images.githubusercontent.com/15859336/85147350-05f00d00-b24f-11ea-8b6c-f79dbf605747.png)

## **I didn't test it on windows or mac.**

Co-authored-by: Edgar <git@edgarluque.com>
2020-06-20 12:00:45 +00:00
Edgar 07f0239e01
Add Learn button which opens the ddnet wiki in the browser. 2020-06-20 13:56:02 +02:00
Learath 75e96aa5d3 Get rid of more magic constants, adapt to 0.7 2020-06-19 21:48:48 +03:00
Learath d200ef0bb0 Remove ugly hack 2020-06-19 21:42:19 +03:00
Learath 9e2434c65d Better skin colors. Better game message translation 2020-06-19 20:28:55 +03:00
def a951845083 Surprise: void x(); accepts any parameter in C!
Prevents accidentally passing parameters that would then be ignored.

C++ is more reasonable, so nothing to do there.
2020-04-12 20:06:38 +02:00
def 4c00e4533c Fix type of os_is_winxp_or_lower function (fixes #2135) 2020-04-12 10:23:08 +02:00
Learath ce8987cd43 Missing include 2020-02-27 16:56:40 +03:00
Learath f679fbfbc5 Allow editing multiple tile layer props 2020-02-27 16:53:12 +03:00
def 598ec52892 Fix GCC 9.2.0 compilation
src/game/server/ddracechat.cpp:623:39: error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]
2020-02-05 08:22:04 +01:00
heinrich5991 8c4569991d Fix indentation and formatting of str_clean_whitespaces
(cherry picked from commit b9c4086382)
2020-01-19 22:38:08 +01:00
KillaBilla 75d076b3bc changed str_clean_whitespace implementation to pkoerner's one
(cherry picked from commit a9cc1e8de2)
2020-01-19 22:37:57 +01:00
KillaBilla ba1abac52f remove leading and trailing space from server name and forbit the use of multiple spaces
(cherry picked from commit a9cc1e8de2)
2020-01-19 22:28:19 +01:00
Dennis Felsing ba3b436139 Fix Websockets warning 2019-12-30 10:12:16 +01:00
Dennis Felsing a27358806c Revert "Support shotgun_speed 0"
This reverts commit 9d39ca888f.
2019-12-09 14:59:10 +01:00
bors[bot] c31f6303cf
Merge #1977
1977: Support shotgun_speed 0 r=Learath2 a=def-

for mapping stationary bullets

As requested by Im 'corneum.

Co-authored-by: def <dennis@felsin9.de>
2019-12-04 16:48:06 +00:00
Dennis Felsing 37ef24225e Clean up color handling a bit
- SetAlpha should be called WithAlpha and only works for RGBA
- Fix type correctness of color_scale and introduce color_invert
- Nicer hook coll color handling in RenderPlayer
- Use CRTP to have type safe WithAlpha, otherwise this would compile:
  ColorHSLA = WithAlpha(ColorRGBA(1.0f, 1.0f, 1.0f));
2019-12-03 11:32:55 +01:00
def 9d39ca888f Support shotgun_speed 0
for mapping stationary bullets
2019-11-27 18:29:39 +01:00
Learath 37d9e4fa26 Add a saner way to select angles. Close #1916 2019-09-20 23:57:35 +03:00
heinrich5991 c8198cc853 Annotate str_timestamp_format with format arguments 2019-07-14 15:42:16 +02:00
Learath2 1993989067 Fix toggle not working with colors 2019-07-02 14:54:06 +02:00
heinrich5991 b90dd43118 Fix -Wdeprecated-copy from GCC9 2019-06-26 11:53:39 +02:00
Learath db5c17ce71 Avoid implementation-defined behaviour 2019-05-15 18:11:22 +02:00
def e1c9033300 Render news without STL functions (fixes #1693) 2019-05-09 21:54:56 +02:00
Learath b86c457c91 Remember whether a color is lit or not 2019-05-01 23:35:29 +03:00
Learath 5d0a1c8d0a Unlighten colors when sending to server 2019-05-01 22:49:52 +03:00
Learath 05b3df0afa Add the default constructors 2019-04-27 02:07:11 +03:00
Learath 979d58f830 Use colors in CTextRender 2019-04-27 01:34:20 +03:00
Learath 15058330fa Don't inherit from vector, more cleanup 2019-04-27 00:47:34 +03:00
Learath be26789872 Remove unused function 2019-04-26 22:57:40 +03:00
Learath 93d14a1eca Inconvenience for windows 2019-04-26 22:36:49 +03:00
Learath 1b668916f2 Fix the test, fix small bug 2019-04-26 21:01:41 +03:00
Learath 69d78c21b4 Lighten tee colors 2019-04-26 16:38:16 +03:00
Learath 54afd2c5af No iostream 2019-04-26 15:09:12 +03:00
Learath 65a17599e1 Add ColorHSVA, phase out more vec3's 2019-04-26 15:06:32 +03:00
Learath 987b9f69de Only lighten if too dark 2019-04-25 23:29:31 +03:00
Learath 93265dbb9c Please MSVC 2019-04-25 21:09:32 +03:00
Learath f53f09339a Default constructor 2019-04-25 19:59:04 +03:00
Learath e637064a68 Don't store HSL separately 2019-04-25 19:49:27 +03:00
Learath 95a3a69e08 Start phasing out vectors for colors 2019-04-25 18:21:35 +03:00
Learath 0f781df1dd Try handling colors in console 2019-04-25 14:48:53 +03:00
Learath 5e5def314f Add tests 2019-04-24 23:53:38 +03:00
Learath cc36af73be Cleanup colors 2019-04-24 23:53:26 +03:00
trml 0b3f3b03b5 Rewrite of prediction code, with additional prediction 2019-04-21 16:12:20 +02:00
Dennis Felsing 00c87c121a str_num_copy -> str_truncate, as in Vanilla 0.7 2019-04-18 10:25:01 +02:00
Learath 843dc29a88 Names can include quotes :/ 2019-04-16 02:39:22 +02:00
def 94f3d97ddf Remove unmaintained Android code (fixes #1575) 2019-04-10 19:40:50 +02:00
def 0e7a514c7b Fix C90 compatibility on Windows 2019-04-09 21:58:04 +02:00
heinrich5991 e44b1ca986 Use OpenSSL md5 if it is available
Fixes #1582.
2019-04-06 02:56:29 +02:00
def ea6b741eb8 thread_sleep: ignore signal interruption 2019-03-24 23:14:37 +01:00
def d9804f5142 str_format: always return length of written string
Quoting the man page of vsnprintf:

RETURN VALUE
  Upon successful return, these functions  return  the  number  of  characters  printed
  (excluding the null byte used to end output to strings).

  The functions snprintf() and vsnprintf() do not write more than size bytes (including
  the terminating null byte ('\0')).  If the output was truncated due  to  this  limit,
  then  the  return  value  is the number of characters (excluding the terminating null
  byte) which would have been written to the final string  if  enough  space  had  been
  available.  Thus, a return value of size or more means that the output was truncated.
  (See also below under NOTES.)

  If an output error is encountered, a negative value is returned.

[...]

  The glibc implementation of the functions snprintf() and vsnprintf() conforms to  the
  C99  standard,  that  is, behaves as described above, since glibc version 2.1.  Until
  glibc 2.0.6, they would return -1 when the output was truncated.
2019-03-21 13:39:25 +01:00
def 1e4890c499 More error checking in system.c (fixes #1317) 2019-03-19 23:16:29 +01:00
bors[bot] d8e8a21a30 Merge #1469
1469: Don't use strtok. Close #1468 r=heinrich5991 a=Learath2

^

Co-authored-by: Learath <learath2@gmail.com>
2019-03-11 11:56:26 +00:00
Learath 9713f6c2cd Improve interface to function 2019-03-11 14:39:54 +03:00
Learath c4af290df5 Don't use strtok. Close #1468 2019-03-05 12:46:29 +03:00
def deb2494692 Don't suggest to downgrade, clean up versioning (fixes #1440) 2019-03-03 20:31:23 +01:00
Learath a46c31f356 Add a couple tests, fix #1457 2019-02-13 15:14:46 +01:00
Learath 37c67c00ad Style 2019-02-13 15:13:44 +01:00
Learath 867facfffc Forgot str_tokenize is not used now 2019-02-13 15:13:27 +01:00
Dennis Felsing 698a3f1c5a
Merge pull request #1443 from ChillerDragon/AutobanKnownBots
Add autoban depending on client version
2019-02-13 12:04:51 +01:00
Learath 5d99746cc1 Add str_tokenize and str_in_list 2019-02-11 18:40:40 +01:00
def 12fa8a23f5 Fix comment about str_utf8_comp_nocase 2019-02-11 17:11:33 +01:00
12pm 6d3e40760c Fix build 2019-02-10 19:20:08 +01:00
12pm 74992d9bd7 Fix tests 2019-02-10 19:13:55 +01:00
12pm ed55ac6d81 Fix tab autocompletion 2019-02-10 17:43:00 +01:00
Dennis Felsing c16c50fa80
Merge pull request #1424 from ddnet/demo-markers
Demo browser: Show markers (fixes #329)
2019-01-09 08:54:42 +01:00
def faa3cc195d UTF8 nocase compare & use for chat TAB completion
- As suggested by Arseniy Zarche
- Also updated confusables to Unicode 12
2019-01-09 08:31:03 +01:00
def f9d9fee314 Demo browser: Show markers (fixes #329)
- Fetch Headers button
- Display Markers & Length columns
- Display footer info
- Don't rescan directory when not required
- Clean up code a bit
2019-01-09 08:25:03 +01:00
def c8ee27332a recvmmsg ipv6 fix 2018-12-23 22:57:28 +01:00
def 4b92e72763 Prevent copies 2018-12-17 22:15:41 +01:00
def bfa25bac4a cleanup 2018-12-17 20:49:25 +01:00
def 87887b7291 mmsgs fixes 2018-12-17 20:19:57 +01:00
def 6846a6ecad Fixes and stress improvements 2018-12-17 20:05:50 +01:00
def d0a887f688 Unused variable fix 2018-12-17 17:27:36 +01:00
def 4c39539d38 Mac OS fix 2018-12-17 17:19:01 +01:00
Dennis Felsing 9665dd67de Mac OS fix 2018-12-17 15:07:09 +01:00
Dennis Felsing 1ca233988b No bool in old C 2018-12-17 14:53:59 +01:00
Dennis Felsing 1221b1f11c Fix Windows compilation 2018-12-17 14:44:19 +01:00
Dennis Felsing 9febf58f37 New try at recvmmsg with some improvements 2018-12-16 22:59:41 +01:00
Learath 19a458d523 Fix a couple issues 2018-12-08 00:24:57 +01:00
Learath 40d7b03f10 uf, typo 2018-12-08 00:06:54 +01:00
Learath 0c13c8cebb Handle the windows console properly. Fixes #1394 2018-12-07 23:52:33 +01:00
yangfl a1db76cdef Remove extra semicolons 2018-11-18 14:27:48 +08:00
Learath 2e137e6fc7 net_addr_comp_ip -> net_addr_comp_noport 2018-10-08 19:56:51 +03:00
Learath f1867e0403 Grammar fix "then->than" 2018-10-08 19:55:18 +03:00
Learath 1073b72965 Ignore DNSBL on "empty" servers. 2018-10-08 01:59:07 +03:00
Dennis Felsing a21f01eef8 str_copy: Avoid -Wstringop-truncation warning in GCC8 2018-10-04 10:48:49 +02:00
Ryozuki 8e8e46a26a fix windows compilation warning 2018-10-01 19:23:33 +02:00
Dennis Felsing c9f28ce094 Forbid copying classes in threading 2018-08-29 11:32:53 +02:00
Dennis Felsing c29a72eb70 Lock style 2018-08-27 16:36:36 +02:00
heinrich5991 67d36b695d Also use sha256 for the mapbugs stuff 2018-08-19 12:12:11 +02:00
def 18529fa082 Revert "Implement recvmmsg"
This reverts commit de5fe64be5.
2018-07-29 23:07:59 +02:00
def 5d8d900643 Revert recvmmsg 2018-07-29 22:49:34 +02:00
heinrich5991 9fcf5480f8 Return a pointer from str_endswith as well 2018-07-26 14:18:23 +02:00
heinrich5991 746d3d6b1a Add str_startswith and str_endswith
Also add a couple of tests for both.
2018-07-26 14:06:56 +02:00
heinrich5991 57d3a61c3f "termineted" -> "terminated" 2018-07-26 14:06:56 +02:00
Dennis Felsing 876ecc7909 fix 2018-07-26 08:30:00 +02:00
Dennis Felsing 0336b662c5 fix 2018-07-25 16:33:26 +02:00
Dennis Felsing 9f8b962e5d fix 2018-07-25 16:10:33 +02:00
Dennis Felsing de5fe64be5 Implement recvmmsg 2018-07-25 16:06:00 +02:00
yangfl 81a39c229b Fix typo 2018-07-10 17:29:02 +08:00
heinrich5991 925aff21d4 Fix all the header guards and adjust the script a little 2018-07-06 16:11:38 +02:00
Dennis Felsing abb959eef4 Fix C89 compilation "for loop initial declarations"
/ddnet-master/src/base/hash_libtomcrypt.c:45:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for(int i = 0; i != 8; ++i)
2018-06-27 09:43:22 +02:00
heinrich5991 ca8fcc823c Use more secure hash function for map downloads
SHA256 was chosen because it is reasonably standard, the file names
don't explode in length (this rules out SHA512) and it is supported by
basically all versions of OpenSSL (this rules out SHA512/256 and SHA3).

The protocol is changed in a backward compatible way: The supporting
server sends the SHA256 corresponding to the map in the `MAP_DETAILS`
message prior to sending the `MAP_CHANGE` message. The client saves the
SHA256 obtained from the `MAP_DETAILS` message until the next
`MAP_CHANGE` message.

For servers not supporting this protocol, the client falls back to
simply opening maps like in the previous scheme.

Remove the `map_version` tool, it is not being used and would have been
a little bit effort to update.

Use the OpenSSL implementation of SHA256 if it is supported, otherwise
fall back to a public domain one.

Fix #1127.
2018-06-24 17:04:50 +02:00
heinrich5991 1b4a16233d Fix warning about incompatible function pointers
This comes at the cost of one allocation per started thread. This should
be okay because we're about to invoke a syscall anyway.
2018-06-20 22:26:43 +02:00
def 920597d48e Revert "Revert "Don't use aio logging to stdout on Windows""
This reverts commit 26b3be58bf.
2018-04-13 20:04:40 +02:00
heinrich5991 26b3be58bf Revert "Don't use aio logging to stdout on Windows"
This reverts commit 8f291ce528.
2018-04-09 15:02:34 +02:00
heinrich5991 f8277267a0 Remove mem_alloc and mem_free, use standard C functions instead
Replace `mem_free` by `free`, and `mem_alloc` by `malloc` or `calloc`
(the latter one being used to allocate a zeroed array of elements,
sometimes, this makes a call to `mem_zero` superfluous).

This results in having to remove `mem_stats` which previously recorded
the number of allocations and their size that the Teeworlds code did
directly.

Remove OOM handling in `src/game/client/components/binds.cpp`.

Remove needless copying in the CSV code in
`src/game/client/components/statboard.cpp`.
2018-04-09 11:56:39 +02:00
Jupeyy a83a89703e change position of mutex lock 2018-04-05 04:42:03 +02:00
Jupeyy 1208bcc562 Make mem_alloc, mem_free thread safe (fixes #1087) 2018-04-05 04:17:21 +02:00
heinrich5991 6d88a29910 Add LATIN SMALL LETTER L confusable
This makes `LATIN SMALL LETTER L` confusable with `LATIN SMALL LETTER I`
because `CYRILLIC SMALL LETTER PALOCHKA` "ӏ" (mapping to i) wasn't
confusable with `LATIN SMALL LETTER L` "l" (mapping to l) before.

Also add tests for `str_utf8_comp_confusable`.
2018-03-20 21:11:44 +01:00
heinrich5991 5be3e1ca84 Update confusable data to Unicode 11.0.0 2018-03-20 20:54:29 +01:00
bors[bot] c65ffeb4ae Merge #1082
1082: Fix a bug with name bans r=Learath2 a=heinrich5991

Overlong nick names could be used to circumvent name bans.
2018-03-14 02:00:42 +00:00
heinrich5991 d7f6cf2892 Fix some system.c insanity
`str_utf8_isspace` now returns true if the passed code point renders as
a space, instead of when not.

Add `str_utf8_trim_right`, use this function and
`str_utf8_skip_whitespaces` in the server.

Add tests for the three functions
2018-03-14 02:27:15 +01:00
bors[bot] cc6449bcd6 Merge #1055
1055: Keep track of lost frames and update time r=heinrich5991 a=Jupeyy

The problem a friend was occuring was, that on a fresh Windows install settings like cl_refresh_rate are set to 480.
Since the render calls take longer time than no render calls, it happened that client was sleeping on one update cycle and then took to long in another, where it called the render functions, leeding to less FPS than the cl_refresh_rate. this caused mouse lags and rarely frame drops.

another thing is, that select on Windows is non microsecond accurate, or just often returns too early, which caused that the refresh rate is much too high, or even ignored, (probably windows can only sleep on milliseconds, or again, is extremly inaccurate).

Another things on windows is that time_freq might be a "very odd" number ^^
i mean like on unix it's one microsecond (1,000,000 = 1s), but on windows the time_freq depends on the CPU leading to inaccurate calculation of the sleep time and render time.
This wasn't insanly huge issue, but probably skipped a few microseconds here and there.

This fix should stabilize the frames. I'd like to hear your opinion on this tho.
2018-03-13 19:41:38 +00:00
Jupeyy 3858a930a9 merge mac and linux impl into one 2018-03-12 17:10:11 +01:00
Jupeyy 72c38bca0c devide by the time_freq 2018-03-12 16:41:02 +01:00
Jupeyy c6a9aadbb0 add missing return statement 2018-03-12 16:21:21 +01:00
Jupeyy e0b8ecabe4 move time fetch to time_get_impl 2018-03-12 16:12:06 +01:00
Jupeyy 5e1bee2760 clean up a bit to and descripe it better 2018-03-12 15:10:49 +01:00
heinrich5991 31a3e8d4c0 Add possibility to ban players by name
This uses the Unicode confusable data together with judging how close
two strings are by using the Levenshtein distance.

Adds the commands `name_ban`, `name_unban` and `name_bans`. Kicks
players who join using a banned name and doesn't allow ingame players to
change their names to the banned ones.
2018-03-09 20:30:27 +01:00
yangfl 1620fc9b0f Fix typo 2018-02-07 16:10:40 +08:00
heinrich5991 8f291ce528 Don't use aio logging to stdout on Windows
This should fix #964.
2018-01-13 20:43:41 +01:00
heinrich5991 a5ab0faee7 Simplify aio stuff a little
This hopefully gets rid of the uninitialized writes CI and I sometimes
see.

Fixes #914.
2018-01-13 19:17:33 +01:00
bors[bot] c15f52bf5f Merge #957
957: Add manual locking to `ASYNCIO` for transacted writes r=Learath2 a=heinrich5991

Previously, e. g. it was possible that newlines are separated from the
printed line in `logger_file`.
2018-01-02 15:31:09 +00:00
heinrich5991 eb31a52b83 Add very basic test for Unix sockets 2017-12-20 16:56:44 +01:00
heinrich5991 1a236dbefc Send connection information to external server 2017-12-20 16:56:34 +01:00
heinrich5991 8d47638a29 Add manual locking to ASYNCIO for transacted writes
Previously, e. g. it was possible that newlines are separated from the
printed line in `logger_file`.
2017-11-27 01:04:55 +01:00
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
Ryozuki f472b02b17 fix little typo 2017-09-25 14:25:23 +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 cd3038315b Forgot the include 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
heinrich5991 33315452c3 Merge branch 'master' into leak_fix 2017-07-31 20:42:32 +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
HMH 04e2946efc mem_free is safe on null pointers 2017-07-28 15:42:32 +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
def 46cedf3a8c Compiler warnings 2017-07-09 10:27:58 +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
heinrich5991 5ae37e6c72 Add protocol extension with UUIDs
This system can easily be extended by independent authors without
collisions, something the old system with plain increasing integers did
not allow.

Do this by utilizing the previously unused message code `NETMSG_NULL`
which has a value of 0.

This works for engine and game messages, snapshot items and events.
2017-05-25 00:52:43 +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 1d81d56850 Introduce new, vanilla-compatible server info protocol
This means that we have a reliable and fast way to query for extended info,
while also not wasting network bandwidth.

The protocol is designed to be extensible, there's four bytes space for
encoding more request types (currently zeroed), and there's one string in each
response packet and one string for each player available (currently the empty
string).

The protocol itself has no problems with more than 64 players, although the
current client implementation will drop the player info after the 64th player,
because it uses a static array for storage.

Also fixes #130, the player list is just sorted each time new player info
arrives.
2017-03-29 12:56:13 +02:00
heinrich5991 f7dde1e061 Partially revert #681
The refactoring can cause a gameplay change, laws of associativity like
`x * (1 / z) == (x * 1) / z` don't hold for floating point numbers.
2017-03-16 10:19:08 +01:00
Ryozuki d0c317d7c7 Fix a typo and refactor the normalize function 2017-03-16 07:55:49 +01: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
def 49127a251a Initialize int to fix compiler warning 2016-11-19 01:42:20 +01:00
heinrich5991 ba8f2feb8b Improve performance of str_utf8_skeleton
Break out of the loop early if possible.
2016-11-07 21:42:19 +01: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