Commit graph

461 commits

Author SHA1 Message Date
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
bors[bot] 40a36c2dfc
Merge #3377 #3487
3377: Add Thread Safety Analysis r=heinrich5991 a=def-

https://clang.llvm.org/docs/ThreadSafetyAnalysis.html

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


3487: Fix centisecs rounding in str_time_float r=heinrich5991 a=def-

<!-- 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: def <dennis@felsin9.de>
2021-01-10 15:00:19 +00:00
def b5440d7d5a Implement network statistics for recvmmsg 2021-01-09 11:48:05 +01:00
def 7fa331a5e9 Fix centisecs rounding in str_time_float 2021-01-08 11:22:21 +01:00
def 59f1c2cbe6 Add New Year season theme by mind and use for 2 days
Map reduces my FPS from 60 to 45, mind can't optimize it further.

I'd release this as 15.2.5 in 1-2 days ideally with no other new changes in.
2020-12-28 17:45:04 +01:00
def e592afc98c Add Thread Safety Analysis
and annotate some code: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
2020-12-23 18:13:21 +01:00
Edgar 105b049497
Rename lock and semaphore classes to match current naming 2020-11-29 18:12:58 +01:00
Jupeyy f83d528f5d Fix vector constructor impl & remove useless operator 2020-11-20 12:14:33 +01:00
def d99f1b9340 Allow utf8 ban reasons (fixes #3329) 2020-11-18 14:42:12 +01:00
def 7e0cbb5b09 Fix sizeof differently 2020-11-07 19:57:25 +01:00
def bf8ae71b7d Fix and NOLINT bugprone-sizeof-expression 2020-11-05 08:25:34 +01:00
def 1877943ceb Fix bugprone-signed-char-misuse with tolower 2020-11-05 08:25:27 +01:00
bors[bot] a03df3a4d1
Merge #3141
3141: More hours (fixes #3140) r=heinrich5991 a=def-

Will also look into #3140 and fix here.

Co-authored-by: def <dennis@felsin9.de>
2020-10-26 12:00:13 +00:00
Dennis Felsing 23c005144b consistent formatting for dbg_msg
no capital letters, no spaces
2020-10-26 10:04:03 +01:00
def 4f44472e59 Add non-space blanks: Hangul Filler characters
Taken from https://en.wikipedia.org/wiki/Whitespace_character#Non-space_blanks

Had to Hangul Jungseong Filler to that Wiki article as it was missing.
2020-10-25 10:17:56 +01:00
def 8dfcd67fe6 Add str_time/str_time_float
Handles centisecs < 0

Uses int64, otherwise we're limited to ~260 days
2020-10-18 23:44:47 +02:00
Jupeyy 3aef2ebfe0 Make closest_point_on_line safer
Does not change behaviour, all NaNs resulted in false checks
2020-10-17 20:22:13 +02:00
def 87b06d307f Fix clang-analyzer-core.UndefinedBinaryOperatorResult
/media/ddnet/src/game/client/animstate.cpp:54:27: warning: The left operand of '*' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
        pSeq->m_X += pAdded->m_X * Amount;
                                 ^
2020-10-14 15:45:47 +02:00
def 5c1b8cd221 Fix clang-analyzer-deadcode.DeadStores
/media/ddnet/src/game/client/components/statboard.cpp:288:3: warning: Value stored to 'tw' is never read [clang-analyzer-deadcode.DeadStores]
2020-10-14 15:45:47 +02:00
def 469888e156 array: Don't allocate size 0
/media/ddnet/src/game/editor/auto_map.h:30:9: warning: Use of zero-allocated memory [clang-analyzer-cplusplus.NewDelete]
        struct CIndexRule
               ^
2020-10-14 14:54:33 +02:00
def 476ac6951f Fix memory leak in lock_create
/media/ddnet/src/base/system.c:805:3: warning: Potential leak of memory pointed to by 'lock' [clang-analyzer-unix.Malloc]
2020-10-14 14:54:33 +02:00
Jupeyy 9e8cbfea5d Optimize uuid lookup 2020-10-11 08:39:29 +02:00
Jupeyy 52911e4302 Use std::sort instead of bubble_sort 2020-10-08 08:00:01 +02:00
def 3be8a592e5 Run clang-format
Purely automatic change. In case of conflict with this change, apply the
other change and rerun the formatting to restore it:

$ python scripts/fix_style.py
2020-09-26 21:50:15 +02:00
def 0bac9f0de8 Manual preparation for cleaner clang-format
Also include what you use explicitly
2020-09-26 21:41:01 +02:00
Jupeyy 8235df7752 Add menu background map 2020-09-23 23:38:28 +02:00
Learath bbdcb7035d Style 2020-09-22 15:47:21 +03:00
Learath 586043fc64 Use fixed point conversion consistently 2020-09-22 15:29:16 +03:00
清歌 7ab35dc55e fix localhost lookup problem when ws enable 2020-09-18 23:02:25 +08:00
清歌 059a2a0a35 fix websockets behavior in net_socket_read_wait 2020-09-18 21:28:17 +08:00
def 9717d032ff Don't call atexit in forked process 2020-09-17 22:19:13 +02:00
QingGo b64a0ef4c6 make client able to connect ws server with ws:// 2020-09-13 09:59:10 +08:00
def 277040fc7c shell_execute: handle some failures 2020-09-11 09:47:19 +02:00
def f7b37eaf6a clang-format fixes 2020-09-10 20:16:09 +02:00
def 0f051def21 Fix cbSize for Windows 2020-09-10 20:13:01 +02:00
def 90f3199d98 Implement opening server on Windows (reading autoexec_server.log not working yet) 2020-09-10 20:13:01 +02:00
def 2cdc7d0faf Adapt 0.7 start menu
- Working Local Server button (needs fixing for Windows)
- Highlight buttons if server is running, new news is out and editor has
  unsaved changes
2020-09-10 20:13:01 +02:00
bors[bot] cbc272fd5d
Merge #2758 #2769 #2772
2758: Remove the rudimentary fuzzing since no one uses it anyway r=heinrich5991 a=def-



2769: Update front.png by Soreu r=heinrich5991 a=def-



2772: Dont predict camera position on spectator changed r=heinrich5991 a=BannZay

No reason to predict camera position in case when we just changed spectator.
But tbh I have not found a big reason to predict it at all.

Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Andrii <bannzay3@gmail.com>
2020-09-06 23:25:16 +00:00
bors[bot] e3cfb23f28
Merge #2742 #2745
2742: Add str_utf8_copy that trim broken utf8 sequence at the end. r=heinrich5991 a=TsFreddie

Currently this replaces `str_copy` text input and clipboard paste in chat. Many places may need the same treatments, like steam names.

![image](https://user-images.githubusercontent.com/3797859/92263741-08b8e080-eed5-11ea-84a5-b7f070ded260.png)

Test string:
abcd今天是个好日子心想的事儿都能成今天是个好日子打开了家门咱迎春风今天是个好日子心想的事儿都能成今天是个好日子打开了家门咱迎春风今天是个好日子心想的事儿都能成今天是个好日子打

2745: Update mapres by mind r=heinrich5991 a=def-

Adapted from 0.7 for new renderer. Not sure if this makes sense :D

Co-authored-by: TsFreddie <tsfreddiewang@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2020-09-06 23:12:04 +00:00
TsFreddie 6b053936c7 str_utf8_copy using str_utf8_truncate 2020-09-06 20:58:26 +01:00
TsFreddie badc49cac7 Revert "Revert & use "str_utf8_truncate" instead"
This reverts commit b045a3d6ee.
2020-09-06 20:54:57 +01:00
Jupeyy aed4293040 Prevent NULL pointer in mem_copy (fixes #2753) 2020-09-06 18:32:56 +02:00
def b7da058b76 Remove the rudimentary fuzzing since no one uses it anyway 2020-09-05 23:50:31 +02:00