Commit graph

603 commits

Author SHA1 Message Date
Edgar 7fbcaa6d36
start document system.h with doxygen 2022-02-18 11:35:46 +01:00
Jupeyy 4330ff83cf Add exception handling for Windows 2022-02-18 11:35:06 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
ChillerDrgon 064ba50230 Add secure_random_uninit 2022-02-14 12:06:31 +01:00
Robert Müller 082e26d5ba Reduce system API calls when listing directory contents 2022-02-04 16:30:12 +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
def 31f3c841ed Lower chance of losing written files by syncing them to disk on close
I'm wondering if this helps. Overhead exists, but is not that much (on
my system): 333 ms for initialization instead of 311 ms

If we only want to do this for files written to, then we need to keep
track of how the file was opened.
2022-02-01 02:32:53 +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
bors[bot] 155a922d47
Merge #4628 #4639
4628: Disable or fix some spammy new clang-tidy 13 warnings r=heinrich5991 a=def-

```
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
```
<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] 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)


4639: Fix SendStartWarning() to only warn every 3 seconds r=heinrich5991 a=def-

Thanks for Skeith for report

<!-- What is the motivation for the changes of this pull request -->

## 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: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-26 13:17:54 +00:00
Dennis Felsing 7903b40066 Quiet clang-tidy on macOS 2022-01-23 19:04:01 +01:00
Dennis Felsing c79320ed71 Improve macos performance
by declaring all threads as QoS class interactive
2022-01-23 18:23:09 +01:00
def 3f7befdd8b Add some further readability checks, mostly redundancy
/media/ddnet/src/engine/server/databases/sqlite.cpp:232:55: warning: the address of ‘char* sqlite3_expanded_sql(sqlite3_stmt*)’ will never be NULL [-Waddress]
  232 |         if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
2022-01-22 17:22:01 +01:00
def bc78ba57b9 Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
Robert Müller 2f17fa9b39 close find handle in fs_file_time on windows 2022-01-18 22:42:08 +01:00
Zwelf dcabb07707 Fix uninitialized count variable and naming convention 2022-01-09 22:51:55 +01:00
Robert Müller 0726703937 fix undefined behavior in byte packing functions, add tests 2021-12-31 13:18:41 +01:00
bors[bot] 768a007eed
Merge #4429 #4517
4429: Pr sql fail fast r=heinrich5991 a=Zwelf

Remaining changes for #4424. Improving sql write times during shutdown and slow mysql responses/timeouts. I still want to test this change, especially for the last commit. Might have time for testing this evening. Thoughts and feedback on this patchset welcome.

## Checklist

- [ ] Tested the change ingame
   - [x] in mysql mod
   - [ ] in sqlite3 mode
- [ ] 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)


4517: Rename EXPLODING BULLET to BULLET r=heinrich5991 a=def-

As suggested by Yuzu

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] 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: Zwelf <zwelf@strct.cc>
Co-authored-by: def <dennis@felsin9.de>
2021-12-27 23:11:09 +00:00
Zwelf d8258fcda9 Add semaphore getvalue functionality 2021-12-25 10:53:26 +01:00
def 440baa17be Support building universal binaries with discord
For now only x86-64 is supported by discord sdk, arm64 we ship without
discord sdk. So players can choose if they want more performance without
discord integration, or less performance with discord integration.
2021-12-20 16:07:00 +01:00
heinrich5991 58533cddef Fix string functions not to truncate in the middle of a UTF-8 character
This makes `str_utf8_copy` obsolete.
2021-12-20 02:34:02 +01:00
heinrich5991 27f18824d6 Fix str_utf8_forward to use the same logic as str_utf8_decode 2021-12-20 02:17:10 +01:00
heinrich5991 ae9944550c Add a function to fix UTF-8 truncation at the end of a string
This can be used after truncating at byte boundaries.
2021-12-20 02:05:07 +01:00
def ffc532a302 Add open_file, works on macOS, safer 2021-12-19 23:22:04 +01:00
bors[bot] 79e5703e21
Merge #3638
3638: Revert "Let's not crash the client and server on dbg_assert" r=def- a=heinrich5991

This reverts commit a6e144e.

## Checklist

- [ ] 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>
2021-12-19 18:45:38 +00:00
heinrich5991 49c861372a Add a flag to skip a UTF-8 BOM when opening files for reading
https://en.wikipedia.org/w/index.php?title=Byte_order_mark&oldid=1059783325#UTF-8

This allows to read text files created by Windows users transparently,
even if they contain a UTF-8 BOM.
2021-12-17 22:07:01 +01:00
Robert Müller f20443b694 fix command line arguments with unicode on windows
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-06 19:48:25 +01:00
Robert Müller 06a1d28a7f remove redundant *count >= max_count check 2021-11-28 11:00:49 +01:00
Robert Müller 7578386538 add empty lines to method documentation 2021-11-25 20:01:29 +01:00
Robert Müller 2ada540988 update str_utf8_stats documentation 2021-11-25 19:54:50 +01:00
Robert Müller 0253b6e25c refactor str_utf8_stats 2021-11-25 19:54:32 +01:00
Robert Müller 84ecbdb9d0 add str_utf8_stats to base system 2021-11-24 23:24:46 +01:00
Robert Müller e37ff4db65 remove unused fs_getmtime in favor of fs_file_time 2021-11-21 11:14:18 +01:00
Robert Müller 4bb5dbc84a do fs_is_dir smarter 2021-11-21 11:14:11 +01:00
Robert Müller b96fc7479e use str_format, improve code format 2021-11-21 10:41:57 +01:00
Robert Müller e1df7669f0 fix incorrect/inconsistent buffer sizes 2021-11-21 10:34:11 +01:00
Robert Müller c9dfbb6f45 fix unicode winsock error messages 2021-11-20 16:37:03 +01:00
Robert Müller 00606d1e2a fix open_link with unicode on windows 2021-11-20 13:36:05 +01:00
Robert Müller 30c65dedad add UNICODE defines on windows, misc. unicode fixes 2021-11-20 12:39:52 +01:00
bors[bot] cdfc521132
Merge #4340 #4350
4340: Add functions for packing/unpacking int/unsigned using char arrays r=heinrich5991 a=Robyt3

Add `uint_to_bytes_be` and `bytes_be_to_uint` functions from upstream and use them where applicable to reduce duplicate code.

## 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)


4350: Fix map_extract r=heinrich5991 a=def-

Reported by cheeser0613

<!-- What is the motivation for the changes of this pull request -->

## 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
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] 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: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: def <dennis@felsin9.de>
2021-11-15 19:33:45 +00:00
Robert Müller c4e2dc5c5f make opening files for reading on windows case insensitive 2021-11-13 23:16:20 +01:00
Robert Müller 12699aa3e4 add functions for packing/unpacking int/unsigned using char arrays 2021-11-09 22:19:32 +01:00
def 724fbffaf0 Use uint64_t for network stats (fixes #4309)
Doesn't overflow so quickly, if it overflows has deterministic behavior
at least.
2021-11-06 23:32:54 +01:00
Robert Müller 385481462e fix fs_chdir with unicode on windows 2021-11-04 21:35:46 +01:00
Robert Müller 83d8e2bf7f fix fs_getcwd with unicode on windows 2021-11-04 21:22:17 +01:00
Robert Müller 3df3feb024 fix fs_makedir and fs_storage_path with unicode on windows 2021-11-04 21:20:36 +01:00
Jupeyy 66947b70b7 Fix detect.h 2021-10-16 21:16:47 +02:00
Edgar 8810531065
remove missused volatile 2021-10-15 12:15:39 +02:00
Jupeyy ce9a962030 Rename VERSION to VERSION.txt 2021-10-06 16:13:36 +02:00
bors[bot] b2efcb8ba4
Merge #4196
4196: Fix fs_removedir and fs_remove with unicode on windows r=Jupeyy a=Robyt3

Fixes `fs_removedir` and `fs_remove` to work with unicode names on Windows.

## 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: Robert Müller <robert.mueller@uni-siegen.de>
2021-10-04 19:08:42 +00:00
Robert Müller 2791f1e127 fix fs_removedir and fs_remove with unicode on windows 2021-10-04 20:11:50 +02:00
def 8270266bcf Try to fix unicode race demos (fixes #4192)
by making fs_rename work on Windows with Unicode chars
2021-10-04 17:50:12 +02:00
Jupeyy 7f5ca0ffe1 Small graphic refactoring 2021-09-14 00:21:17 +02:00
Panagiotis Vasilopoulos cc49273cb4
Fixed typo
TO BE SQUASHED LATER
2021-09-13 20:12:21 +02:00
Panagiotis Vasilopoulos 3b1c074842
Further fixes for Haiku
- Haiku is Unix-like, but it still doesn't use libnotify.
- Haiku comes with its own sets of definitions for certain long variables.
  There's still a problem revolving around the variables, but I removed a
  duplicate, conflicting definition on the Haiku platform.
- Changed some definition-related logic in detect.h, because the gcc compiler
  in Haiku (version 8.3.0) complained about duplicate definitions. I chose to
  use 'unknown' rather than an empty string on one occasion.
- Changed size of m_aLastSoundPlayed[CHAT_NUM] in
  `src/game/client/components/chat.cpp` due to an undocumented/undiscovered bug
  in Haiku.
2021-09-13 15:29:32 +02:00
heinrich5991 406bb85873 Fix dbg_* comments to reflect reality
They also work in release mode.
2021-09-13 12:58:18 +02:00
heinrich5991 deb4917563 Revert "Let's not crash the client and server on dbg_assert"
This reverts commit a6e144ea72.
2021-09-13 12:57:53 +02:00
bors[bot] 121173b5d6
Merge #4111
4111: Fix filesystem/IO with unicode filenames on windows r=def- a=Robyt3

It was previously not possible to load a map or really any file with a filename containing unicode, e.g. german umlauts.

Now all filenames are converted from multibyte to widechar on windows, and the correct functions and structs (with the `W` suffix) are used consistently.

Some changes are made to synchronize ddnet's implementation with upstream (once https://github.com/teeworlds/teeworlds/pull/2936 has been merged there):
- The unused and not working `IOFLAG_RANDOM` is removed (on upstream ddnet's `IOFLAG_APPEND` is added instead).
- The `fs_listdir_info` function is renamed to `fs_listdir_fileinfo` and now using the parameter object `CFsFileInfo` that contains the filename, modified date and creation date, making it easier to add more properties in the future. `FS_LISTDIR_INFO_CALLBACK` is renamed to `FS_LISTDIR_CALLBACK_FILEINFO`.

## 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: Robert Müller <robert.mueller@uni-siegen.de>
2021-08-30 09:02:24 +00:00
BloodWod b9d660dd95 Add colors for dbg_msg console 2021-08-28 04:42:42 +05:00
Jupeyy b216b6744a Add Android build scripts 2021-08-24 12:18:20 +02:00
Robert Müller 2171373e3c fix code format 2021-08-23 15:29:31 +02:00
Robert Müller c89cdc6806 add fs_file_time 2021-08-23 13:29:33 +02:00
Robert Müller 355466e0bf fix fs_is_dir with unicode on windows 2021-08-23 12:57:31 +02:00
Robert Müller f6954c8001 fix io_open with unicode on windows 2021-08-23 12:56:23 +02:00
Robert Müller 4a375242c5 fix fs_listdir and fs_listdir_fileinfo with unicode on windows 2021-08-23 12:49:15 +02:00
Robert Müller 75662b6c1a remove unused and not implemented IOFLAG_RANDOM, add assert 2021-08-23 12:30:12 +02:00
Jupeyy c7580b374c Remove Windows XP code 2021-08-23 12:05:01 +02:00
Alexander Akulich ed8955e60f math: Rename frandom() to random_float() to match with random_int()
(cherry picked from commit 5e4c7b66c5)
2021-08-03 14:29:52 +02:00
heinrich5991 1f68e11445 Mark the inverted exclamation mark as confusable with i
They look pretty much the same in our font, but for some reason, the
inverted exclamation mark doesn't have confusables.
2021-07-27 02:43:04 +02:00
heinrich5991 707e13ff7a Update confusables_data.h to Unicode 13.0.0 2021-07-27 02:41:55 +02:00
Vlad 01822cada8
EOF x2 2021-07-26 01:30:01 +03:00
Vlad e78ba96f3b
EOF 2021-07-26 01:23:10 +03:00
Vlad 28c34bd101
Stop accepting invalid ipv4's 2021-07-26 01:13:05 +03:00
Jupeyy 69aa97fe9e Remove (void) parameter of functions 2021-06-24 17:19:17 +02:00
Jupeyy a663799188 uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
Jupeyy 3e1d4ad0b3 Use chrono 2021-06-24 17:19:17 +02:00
Jupeyy 9dfea5511a Use cpp 2021-06-24 17:19:17 +02:00
ChillerDragon 8a4f4fc6c9 Use str_length 2021-06-05 16:46:01 +02:00
heinrich5991 fb27b83d79 Add function to remove directories
Add tests. Unify behavior of `fs_remove` across operating systems to
only remove files, not directories. Previously on Linux, it would also
delete directories.
2021-05-14 01:00:41 +02:00
heinrich5991 782c826381 Add secure_rand_below function
It works by masking the numbers and the using rejection sampling to
ensure a uniform generation.
2021-05-12 17:02:02 +02:00
Jupeyy f99f062d0a Only sort friends, if you got any 2021-05-06 14:45:34 +02:00
bors[bot] 97ab2c6c01
Merge #3798
3798: Add GLES support r=def- a=Jupeyy

I know i *****ed up, that i didnt move the files in a different commit, but when i noticed it was already too late.
Its mostly disabling stuff that GLES doesn't support. Global LOD bias or glOrtho for examlpe.

~***Strong note***:
This will move ALL linux implementation to GLES instead of GL, since GLES is supported by X11 and wayland, we probably want some testing for this.
This also means, that the default for Linux gets GLES 3.0 which is equivalent to OpenGL 3.3, not OpenGL 3.0!!!~

~If you wonder "why":
Gles just works differently to OGL, it knows about all functions that exists, and e.g. doesn't require GLEW at all, but that also means, that GLES does NOT work while we use OGL, because GLEW would kill GLES.~
GLEW in EGL mode works fine with wayland, just requires X11 to use EGL too(SDL_VIDEO_X11_FORCE_EGL)

_Additionally, for GLES only, only 3.0 and 1.0 context are supported._(doesn't matter anymore for linux)

probably fixes:
~not_really_fixes  #3797~
fixes #2885

And would also allow android support, if i ever get these build scripts upto date, or smby is interested into fixing them for me :D

## 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: Jupeyy <jupjopjap@gmail.com>
2021-05-06 09:50:26 +00:00
heinrich5991 b2a54dc7f8 Compress IPv6 string representations according to RFC5952
https://tools.ietf.org/html/rfc5952#section-4

Also add some tests.
2021-05-05 18:22:52 +02:00
Jupeyy b8f96ce500 Allow GLES3 coexists with OpenGL on Linux 2021-05-02 04:39:02 +02:00
Jupeyy ecc5a7af81 Make GLES3 only makros 2021-05-01 21:21:09 +02:00
Jupeyy c0d6ce6d25 Add GLES support 2021-05-01 01:39:37 +02:00
bors[bot] 6572f9e4fe
Merge #3779
3779: Copied Teeworld patches for the Haiku operating system r=def- a=panos

I initiated a port of ddnet and received a lot of help from the IRC in order to do so as seen in #2986. Unfortunately, my efforts went stale after one point. Fortunately, however, @threedeyes released a [set of patches for Teeworlds](2ea72967cd/games-action/teeworlds/patches/teeworlds-0.7.5.patchset). I decided to take down my repository with my own work and attempt to port Gerasim's work, which includes code for setting the directories that ddnet should use the same way one would do so in a Mac OS X-system in `src/base/system.c`, which was precisely the part where I got stuck in on my first attempt.

The changes have not been tested thoroughly yet and were the result of methodic copying and pasting.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] 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: Panagiotis Vasilopoulos <hello@alwayslivid.com>
2021-04-17 18:15:34 +00:00
Panagiotis Vasilopoulos 6c02076c05 Copied Teeworld patches for the Haiku operating system
Co-authored-by: Gerasim Troeglazov <3dEyes@gmail.com>
2021-04-17 20:10:56 +02:00
heinrich5991 8d6b62d8f8 Fix parsing an IPv6 address without port
The port in the NETADDR struct was left uninitialized.

Add some tests to ensure behavior.

CC #3774 #3775
2021-04-17 16:05:39 +02:00
def 1d636a4b43 Detect hangul choseong filler character as whitespace (fixes #3752) 2021-04-01 18:32:04 +02:00
def a4bb2f8764 Switch back to using a stable sort
so that for example demos stay sorted the same way when sorting by demo
markers and removing a demo, otherwise they get totally reordered every
time.

as reported by Shyzo
2021-03-15 23:36:25 +01:00
def c92f818a3c Don't leak memory on Windows in logger
Thanks to 拓真 on Discord for report
2021-02-28 23:22:18 +01:00
Vlad a780dd691d Memory leak in system.c
> Here I get a memory leak
> https://github.com/ddnet/ddnet/blob/master/src/base/system.c#L167

Thanks to @kurosio
2021-02-28 23:22:15 +01:00
Alexander Akulich 2790270abf Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
def e985632fae OSX -> macOS
Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that
2021-02-12 13:41:41 +01:00
bors[bot] 0b2c457c37
Merge #3526
3526: Run server in background on Windows (fixes #3525) r=Learath2 a=def-

https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

> Displays a window in its most recent size and position. This value is
> similar to SW_SHOWNORMAL, except that the window is not activated.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [x] Written a unit test if it works standalone, system.c especially
- [x] 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: def <dennis@felsin9.de>
2021-01-21 11:05:35 +00:00
def 8edb561f4e Run server in background on Windows (fixes #3525)
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-showwindow

> Displays the window as a minimized window. This value is similar to
> SW_SHOWMINIMIZED, except the window is not activated.
2021-01-21 10:01:11 +01:00
Alexander Akulich 5d0bb4cf3c Backport vector functions cleanup from the upstream
Keep closest_point_on_line() as-is.

(commit 6b69f94dc8)
2021-01-16 03:20:57 +03:00
BeaR 9f0b0af862 Add angle<->direction conversion functions to vector math (Cleanup)
Keep angle() (ex. GetAngle()) as-is.

(cherry picked from commit 7735557aa5)
2021-01-16 03:20:57 +03:00