Commit graph

11107 commits

Author SHA1 Message Date
srdante b642f519c1 Fix whisper sending/receiving differentiation 2022-03-29 17:35:50 -03:00
srdante cb5fab5958 Fix tests 2022-03-28 20:27:14 -03:00
srdante b98a137064 Always show /top local records 2022-03-28 20:20:23 -03:00
srdante 3ee8070a46 Fix SQL duplicated top and PlayerTeamTop5 2022-03-28 16:53:35 -03:00
srdante dba7889399 Differentiate team top 5 from player team top 5 2022-03-28 16:51:50 -03:00
bors[bot] 404d9ecb7f
Merge #4900
4900: Super: Don't send sounds to self r=heinrich5991 a=def-

As reported by louis on Discord

<!-- 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>
2022-03-28 18:17:40 +00:00
Dennis Felsing 751a828109 Fix team not started message (fixes #4884)
Thanks to c0d3d3v for noticing
2022-03-28 16:29:23 +02:00
Jupeyy 3bcb49f9d7 Vk only allow asserts after initialization 2022-03-28 11:29:02 +02:00
bors[bot] c9f462b70d
Merge #4901
4901: Fix websocket crash on client connect r=def- a=srdante

Currently when a client tries to connect using websocket it will throw a segmentation fault. This is happening because of the std::string is trying to convert a char array with empty values to string directly.

```
==2305850== Invalid write of size 8
==2305850==    at 0x48401E9: memcpy@GLIBC_2.2.5 (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==2305850==    by 0x1E762D: websocket_callback(lws*, lws_callback_reasons, void*, void*, unsigned long) (in /home/ploi/ddnet/build/DDNet-Server)
==2305850==    by 0x4C7FB98: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C82F61: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C83206: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C9B84B: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C7E0B4: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C7E5C9: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C77EC6: lws_service_fd_tsi (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C9728A: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C974CC: ??? (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==    by 0x4C78114: lws_service (in /usr/lib/x86_64-linux-gnu/libwebsockets.so.15)
==2305850==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
```

<!-- 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
- [ ] 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: srdante <minidantebtc@gmail.com>
2022-03-26 22:19:05 +00:00
srdante 8f8b3e0a34 Convert char array to string 2022-03-26 18:31:32 -03:00
def 46f20754d5 Super: Don't send sounds to self
As reported by louis on Discord
2022-03-26 16:49:46 +01:00
bors[bot] ea852d8f1c
Merge #4852
4852: Fixed some useless double promotion r=def- a=Chairn

Double promotion occurs quite often when an operator is an hidden double, like constants written without the 'f' at the end. We might get a tiny micro improvement. Unfortunately, we can't do anything for all the double promotion occurring in printf like functions as it is the default for both C and C++.

Only this line might change physics:
4d47fcda09 (diff-d76009083687ba43c59dc7bb2c7357457c999c2eb9d913967d598e913c6fd01fR406)

## 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
- [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-03-25 18:29:02 +00:00
Dennis Felsing 939d5436b0 Retry tutorial join after 5 seconds 2022-03-25 17:37:55 +01:00
Dennis Felsing 3ee8d880fe Hacky way to join tutorial from LAN 2022-03-25 17:14:48 +01:00
Dennis Felsing ebd76d9db5 Add tutorial button in main menu
As suggested by cheeser0613
2022-03-25 17:14:47 +01:00
Jupeyy bb1ed45c3d Emscripten support 2022-03-25 12:42:18 +01:00
Dennis Felsing b96b23d9cb Reset practice when loading team (fixes #4894)
I hope this doesn't give a chance to cheat. We also reset practice when
killing a team, so loading can be considered as similar to killing?
2022-03-25 10:09:47 +01:00
bors[bot] e8fc1758a7
Merge #4885 #4889
4885: Add dropdown icon r="def-" a=Jupeyy

![image](https://user-images.githubusercontent.com/6654924/159912581-f382179d-9d66-41f8-8a41-647e4e34edf5.png)

## Checklist

- [x] Tested the change ingame
- [x] 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)


4889: Fix text texture name Texture -> TextureOutline r="def-" a=Jupeyy



## 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>
2022-03-24 21:26:33 +00:00
Chairn 3778e0ff6b Format member variable's name correctly 2022-03-24 19:30:26 +01:00
Chairn b51957f470 Fix storage File shadowing 2022-03-24 17:59:49 +01: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
bors[bot] 309283d551
Merge #4870
4870: Don't render tees or nameplates offscreen r=def- a=sjrc6

It seems difficult to measure the fps from the ingame graph or fps counter so these numbers are from NVidia fps overlay

FPS on full multeasymap server, fullscreen, vulkan renderer
/showall 0 - 4500
/showall 1 - 2100
/showall 1 (after preventing offscreen render) - 4200

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] 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: Tater <Mr.Potatooh@gmail.com>
2022-03-24 14:44:26 +00:00
Tater 5c29456dd8 Improve nameplate boundary and clarify comments 2022-03-24 15:43:58 +01:00
Jupeyy 7c7fe59b9e Fix text texture name Texture -> TextureOutline 2022-03-24 15:11:58 +01:00
bors[bot] b1e88dd9fa
Merge #4872
4872: Support uppercase commands for /r and /w r=Jupeyy a=def-

As reported by  perrodecerro on Discord <!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-03-24 12:15:18 +00:00
Jupeyy 5459895dc0 Add dropdown icon 2022-03-24 13:05:21 +01:00
Chairn e0c6106930 Revert time to double type 2022-03-23 19:34:51 +01:00
Chairn 49dd2b9ced Revert possible physic change 2022-03-23 18:30:18 +01:00
Chairn d4aac67929 Fixed some useless double promotion 2022-03-23 18:22:08 +01:00
Tater abaf216f5c Seperate hook collision line from player rendering 2022-03-22 19:19:44 -05:00
Dennis Felsing 252110a66b Support uppercase commands for /r and /w 2022-03-22 23:39:58 +01:00
Jupeyy afb205cf6f Check pTexName for nullptr, fix wrongly height->width 2022-03-22 20:28:33 +01:00
Tater 54e8b64136 Don't render tees or nameplates offscreen 2022-03-22 11:20:21 -05:00
bors[bot] 43882604e8
Merge #4849
4849: Fix queries for MySQL 8.0 r=def- a=srdante

Fixes #4815 

**What was changed:**
- All Rank columns name were scapped since MySQL 8.0 interprets the word "Rank" as a internal function or constant (A good practice would be if all column names were escaped).
- All group by have been modified to have all columns that need to be grouped, in order to respect the `ONLY_FULL_GROUP_BY` flag set by default on MySQL 8.0. On these group bys were also included the columns that are used in the `window`, since are also required by the same tag.

**What is missing on this pull request:**
- "Add a mysql installation in .github workflow so we test this in addition to mariadb, then we don't break it again so easily."

**The behavior of all queries remains the same.**

<!-- 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
- [ ] 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: srdante <minidantebtc@gmail.com>
2022-03-21 23:13:52 +00:00
srdante 402387095d Fix ShowRank() ranking order by 2022-03-21 20:05:28 -03:00
srdante 2edeb21d34 Change scaped Rank name to Ranking 2022-03-21 20:04:05 -03:00
srdante 85ab2c82aa Fix websocket crash on client connect 2022-03-21 16:28:25 -03:00
bors[bot] eb51f9c626
Merge #4861
4861: Check if debug utils are available r=def- a=Jupeyy

<!-- 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: Jupeyy <jupjopjap@gmail.com>
2022-03-21 17:32:45 +00:00
bors[bot] 87c888d64a
Merge #4862
4862: Fix GCC 6.3.0 compilation r=Jupeyy 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: Dennis Felsing <dennis@felsin9.de>
2022-03-21 17:09:02 +00:00
Dennis Felsing 462e43e5ad Fix GCC 6.3.0 compilation 2022-03-21 17:59:22 +01:00
bors[bot] f95cc6cb11
Merge #4858 #4859 #4860
4858: Fail when shader can't be compiled (fixes #4857) r=Jupeyy 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)


4859: Fix Debian 9 compilation r=Jupeyy 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)


4860: Only try exe on Windows r=Jupeyy 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: Dennis Felsing <dennis@felsin9.de>
2022-03-21 16:46:34 +00:00
Jupeyy 8a8cd8737e Check if debug utils are available 2022-03-21 17:38:07 +01:00
Dennis Felsing 8adc1ca5de Fix Debian 9 compilation 2022-03-21 16:38:36 +01:00
Dennis Felsing 6600bc622b Fix some Windows build warnings 2022-03-21 16:34:47 +01:00
bors[bot] e632859707
Merge #4687
4687: Add Vulkan backend r=def- a=Jupeyy

This adds a Vulkan 1.0 backend and new features to the graphic settings to select the GPU(if multiple Vulkan GPUs are supported, and a new list for renderers (see screenshot below))

Mutleasy benchmark (CPU bound):
Vulkan multithreaded, single threaded vs OpenGL
(lower graphs are histograms, code by `@Chairn` )

Y = Frametimes in microseconds
lower graphs = amount of frametimes that happened (histogram)
(since the renderer speed differs, you should look at it more like a spread of values rather than the actual values)
![Figure_1](https://user-images.githubusercontent.com/6654924/153448356-941222a3-8bd3-424d-8685-a43389a4f691.png)

Vulkan is especially good in these scenarios, beating OpenGL 3.3 almost 3x with my setup (~600-700 FPS vs. ~1700-1800FPS)


Remaining TODO list:
- [x] compile shaders in cmake ( e.g. `https://gist.github.com/evilactually/a0d191701cb48f157b05be7f74d79396` )
- [ ] needs windows vulkan libraries
- [x] add build instructions (packages)
- [x] get away from coherent memory even for staging buffers (flushing memory just seems to be faster)
- [ ] a lot of testing :P

![screenshot_2022-02-10_17-13-46](https://user-images.githubusercontent.com/6654924/153449066-38d8741b-60c1-4c0c-ba50-57cc07aa2f9d.png)

![screenshot_2022-02-10_17-13-50](https://user-images.githubusercontent.com/6654924/153449075-91ef3b7b-7238-4cad-9a4c-aeb2d784238b.png)


If there are bugs and it's crashing inside the driver the best you can do is to start the client with `dbg_gfx 4` which will (if supported) add Khronos standard validation layers + verbose debugging information + validation layer extensions, e.g. a synchronization validation layer and validation errors reported by the GPU driver directly.
(setting for dbg_gfx (0: none, 1: minimal, 2: affects performance, 3: verbose, 4: all))

edits:
fixes #3547 (probably fixes it, fixed some data races)

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-21 14:20:54 +00:00
Jupeyy fbeba9eb5f Add Vulkan backend 2022-03-21 12:39:51 +01:00
Chairn bd5bfa453d clang-format 2022-03-21 05:55:01 +01:00
Chairn 4cc815711b Added direction enumeration for the editor 2022-03-21 05:53:36 +01:00
srdante 22f2f8b396 Fix Top command showing multiple ranks for the same player 2022-03-21 00:15:29 -03:00
srdante 29726dc0cb Fix queries for MySQL 8.0 2022-03-20 23:48:59 -03:00
Jupeyy e572704963 Multithreaded video rendering 2022-03-20 18:03:33 +01:00
Jupeyy 14ac5cf297 lazy load editor textures
improve entities texture flags
2022-03-20 18:03:33 +01:00
Jupeyy e54da1b396 Cleanup backend a bit for vulkan 2022-03-20 18:03:25 +01:00
bors[bot] 564a59d603
Merge #4845
4845: Enable -Wshadow=local r=Jupeyy a=def-

> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code

<!-- 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>
2022-03-20 16:45:22 +00:00
ChillerDragon b34302238f Do not mute if spamprotection is off (closed #4816) 2022-03-20 14:12:19 +01:00
def 8134f9fa55 Enable -Wshadow=local
> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code
2022-03-20 13:24:34 +01:00
bors[bot] 12b7ff3d4c
Merge #4842
4842: Replace browser icons with font icons r=def- a=Jupeyy

Replace and remove the menu icons and use the font icons instead.
Personally i find them more attractive, and objectivly they are resolution indepentent.

Opinions?

before:
![screenshot_2022-03-19_11-26-51](https://user-images.githubusercontent.com/6654924/159117535-6e027259-b7bc-43ff-b87b-80aabc368e97.png)

![screenshot_2022-03-19_11-31-02](https://user-images.githubusercontent.com/6654924/159117539-a0617fe6-4d30-407e-9b5c-588bd27c6834.png)

after:
![screenshot_2022-03-19_11-45-24](https://user-images.githubusercontent.com/6654924/159117919-d0deb3c7-2631-4233-a7e0-2b1e83362248.png)

![screenshot_2022-03-19_11-30-41](https://user-images.githubusercontent.com/6654924/159117546-db8f68d7-253c-4b99-9a8d-9f6668d0cb11.png)

![screenshot_2022-03-19_11-44-16](https://user-images.githubusercontent.com/6654924/159117880-0523ee15-e5f0-495c-9f5b-fe3e897efe79.png)


## Checklist

- [x] Tested the change ingame
- [x] 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>
2022-03-20 10:51:14 +00:00
bors[bot] f49afca3dc
Merge #4818
4818: Add str_startswith_nocase and str_endswith_nocase r=def- a=ChillerDragon

Gets rid of the more complex str_comp_nocase_num usage

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] 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: ChillerDragon <ChillerDragon@gmail.com>
2022-03-20 10:27:18 +00:00
def 3d47274f28 Add tutorial joining code and tutorial map 2022-03-19 23:35:27 +01:00
Jupeyy daea2feca9 Switch to Font-Awesome 2022-03-19 19:14:30 +01:00
Jupeyy 343a5291e5 Replace browse icons with icon font 2022-03-19 18:35:43 +01:00
Jupeyy 18d85fda0d Update icons font 2022-03-19 18:35:37 +01:00
srdante 216accbe73 Fix style warning 2022-03-18 20:37:20 -03:00
srdante 9dc944ab03 Fix player death effect color 2022-03-18 20:31:49 -03:00
bors[bot] 3fa7edcf41
Merge #4837 #4838
4837: Fix demo render menu r=Jupeyy a=def-

As reported by bencie on Discord

Old:
![Screenshot 2022-03-18 at 14 23 53](https://user-images.githubusercontent.com/2335377/159011986-de9028dc-8c76-40d6-9449-93d05ca8a781.png)
New:
![Screenshot 2022-03-18 at 14 30 44](https://user-images.githubusercontent.com/2335377/159011980-b8e3c260-8439-4e09-a4da-384458abc27a.png)


## Checklist

- [x] Tested the change ingame
- [x] 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)


4838: Update Korean language file (by 車魄) r=Jupeyy 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: Dennis Felsing <dennis@felsin9.de>
2022-03-18 18:14:09 +00:00
Dennis Felsing 71432bd19d Fix demo render menu 2022-03-18 16:28:47 +01:00
Dennis Felsing 748fb0ea5f Add contributor 2022-03-18 14:41:48 +01:00
bors[bot] 971f839c17
Merge #4832
4832: Add further contributors, thanks to all! r=Jupeyy a=def-

I hope I didn't miss anyone.

## 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: Dennis Felsing <dennis@felsin9.de>
2022-03-17 18:06:38 +00:00
Dennis Felsing 1501c28c1d Add further contributors, thanks to all! 2022-03-17 18:09:36 +01:00
c0d3d3v 944ed54625
fix sound bug in back in times 3 2022-03-17 15:29:44 +01:00
bors[bot] 3268986d91
Merge #4828
4828: Fixed bad DataReader loop on map_replace_image r=def- a=sctt


Happy to see that map_replace_image has actually been useful to you as it was used as a base to code map_convert_07.

As stated here https://github.com/ddnet/ddnet7/issues/20, map_replace_image seems to somehow break the map, that is due to a bad check inside the last datareader loop (it is just checking NumItems instead NumData).

Seems like it was just a coincidence that the tool was correctly working on the map i was testing, but i was able to confirm the problem by trying different maps.

now it is fixed.

Co-authored-by: sctt <scottistefano91@gmail.com>
2022-03-16 16:34:06 +00:00
sctt bc901d6eb2
Fixed bad DataReader loop 2022-03-16 16:40:13 +01:00
bors[bot] c712b756ab
Merge #4826
4826:  Improvement of the automatic completion of player names in chat r=def- a=C0D3D3V

This should fix #659 or just improve the order of player names if you use automatic completion. 

So far it was so that first at the beginning of the name was searched for the input and then there was a second iteration through the alphabetically sorted list with names where the input does not appear at the beginning.

Now it is so that the position of the input in the name is used as an evaluation criterion to determine the position in the suggestion list. If the input is found at the beginning of the name, the score is 0 and the name is suggested first. If the input is found at position 6 in the name, the score is 6 and the name appears later in the suggestion list. If two names have the same score, the alphabetical sorting remains.


## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-16 15:32:49 +00:00
c0d3d3v 92eaccfcb2
Improvement of the automatic completion of player names in chat 2022-03-16 15:25:56 +01:00
bors[bot] f74e3f9582
Merge #4821
4821: Add optional save_replay parameter, filename r=def- a=simpygirl

As suggested by bencie
> suggestion: would it be possible to add an optional parameter to save_replay so you could define the demo's name? save_replay [length] [demo name]

## 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: simpygirl <simpygirl@fedora.email>
2022-03-14 13:24:49 +00:00
bors[bot] d172a7fd2a
Merge #4802
4802: make the vanilla teams independent from the ddrace teams r=def- a=C0D3D3V

Fixes #259
Because my changes have some effects on the display and thus people who like it as it was could bother, I have described my changes in detail here.

Until now it was the case that players who are in /spec (while sv_pausable is activated) or the own active player who is in /pause or /spec are in the Spectators team.

With this change this is no longer the case. I took the opportunity to make a few adjustments in the display logic. 

On the server side nothing had to be adjusted, because there was already a separation of the normal and the ddnet teams. 


1. Regarding the specators component:

I intentionally did not adjust the conditions in the OnRender function (lines 224, 306, 325 and 338) so that you can manually select players who are in /spec to watch as well.
I find this helpful, because it has often annoyed me not to be able to quickly find players who are in /spec on the map.

This also allows the selection of players that are in spec in demos. The only problem is that in demos the information about sepc players is missing (The same as in Game, only in Game the information is provided as soon as you spectate). However, until now this was also the case for players who are not in their own team. I find it handy to also have Spec players selectable, so that when they become active, the camera follows them directly.

In addition, you can spectate yourself in demos as well as in the game.
In demos this was already possible, as long as the own player in the demo is not currently in pause, at that moment you could only follow the recorded spectating camera. 

However, I have kept that in SpectateNext, SpectatePrevious and SpectateClosest the own player is not included. However, it is also possible to jump here in spectating to players in /spec.  


2.  Regarding the scoreboard component:

Now only real spectators are displayed under the scoreboard in the spectators team. No longer players who are in /spec or the own player who is currently paused.
So I did not adjust line 125, 341, 354, 367.

Line 724 would not need to be adjusted anyway since it only affects vanilla team games. If the function GetClanName is used for DDnet, this has the effect that paused players are also included.

I have adjusted the active condition of the scoreboard so that it is not automatically displayed when the player is spectating (that's the way it used to be).

Since now the own player is shown in the scoreboard even if he is paused, I have removed the marking of the own player when following another player (line 416).


3.  Regarding the menus_ingame component:
I left the behavior as it was, since we are talking about dangerous commands here (join spectator team and commit suicide) I think it is quite good that these are hidden when the player is paused.

To maintain this behavior, when creating the kill button, we must also check if we are not in pause or spec.
Actually we could check here m_pClient->m_Snap.m_SpecInfo.m_Active just like I did in the scoreboard, but since the code was already created I kept it.


4.  Regarding the IsOtherTeam function in gameclient:
This function is used to determine if the transparency m_ClShowOthersAlpha should be applied to players and nameplates of other teams and if entities of other teams should be predicted.

So I left the behavior as it was, i.e. if you pause via /pause or /spec the transparency is not applied, because then False is returned.

5. Regarding the HUD component:
I have not adjusted any condition here (line 310, 319 and 323). So far the behavior was that when the player went on pause (/pause /spec), in the small time display at the bottom right the top2 players were displayed and otherwise the best and the own player.
Now it is so that the own player is also displayed when he is paused, but not when he is a real spectator.
I personally find it strange why the display should change just because you pause. 

6. Regarding the chat component:

If the dummy paused is in the same team as the player and then a team message arrives, it will no longer be double logged.
Until now, when a player is in the same team in /spec and sends a message, his name was displayed in the Spectators team color and not in the team color. Since I have not adjusted the condition in line 803, the player names are also displayed in the team color for such messages.


7. Regarding the items component:

Here it is determined whether the local player is in the game and depending on that other GameTicks are used and ReconstructSmokeTrail is not canceled. 
Here I could not work in so exactly, no idea what consequences this has that I have not adjusted the conditions in line 47 and 560.  
I noticed at least when testing no difference, maybe someone who knows about it can explain to me what that has for effects.


About all changes I made we can discuss I am ready to undo them or restore the behavior as it was before.  But please justify with arguments.


Independently:
I added a -1 check for the m_LocalClientID to the Strong Week indicators in the Nameplates. So that with server demos the array is not accessed outside of the array range. For demos there are currently no predicted characters and therefore no strong week indicators, so it doesn't change anything.


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change  
I can provide screenshots to compare before after, but it's best to test it yourself.

- [ ] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-14 13:06:42 +00:00
c0d3d3v 4619e825f3
make spectators team independent 2022-03-14 13:25:47 +01:00
simpygirl 18386e135f Use pFilename instead of Filename 2022-03-14 05:56:44 +01:00
heinrich5991 897ba5854a Use system.h style for system.h 2022-03-13 19:45:01 +01:00
bors[bot] 8ea73b7800
Merge #4822
4822: Auto select search string on hot key r=def- a=Jupeyy

Pressing CTRL+F should select the current search string, like basically every text editor and browser does

## 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>
2022-03-13 18:23:02 +00:00
Jupeyy cce42d41de Auto select search string on hot key 2022-03-13 19:12:06 +01:00
simpygirl 5e6283a807 Add optional save_replay parameter, filename 2022-03-13 15:17:44 +01:00
ChillerDragon 99b0eb2819 Add str_startswith_nocase and str_endswith_nocase 2022-03-13 11:42:45 +01:00
bors[bot] e91a4d4910
Merge #4817
4817: Don't mute for 0 seconds (fixes #4816) r=Jupeyy a=def-

<!-- 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>
2022-03-13 10:11:25 +00:00
def eab52b3378 Don't mute for 0 seconds (fixes #4816) 2022-03-13 11:09:06 +01:00
bors[bot] a1668e0a5b
Merge #4812
4812: Full size sound settings r=Jupeyy a=def-

Old:
![screenshot-20220312@234506](https://user-images.githubusercontent.com/2335377/158037595-d3a6affc-3092-4b6c-9668-aab13f66801c.png)
New:
![screenshot-20220312@234420](https://user-images.githubusercontent.com/2335377/158037596-06889367-93d9-4c92-891b-c380653d8a3d.png)

## Checklist

- [x] Tested the change ingame
- [x] 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>
2022-03-13 07:23:57 +00:00
def 6b497afba4 Don't allow infinite shotgun bounce (fixes #4809) 2022-03-13 00:02:42 +01:00
def 9518e4413e Full size sound settings 2022-03-12 23:45:21 +01:00
bors[bot] d140e05a2c
Merge #4811
4811: fix bug that sneaked in during refactoring (in #4775) r=def- a=C0D3D3V

Was detected by missing hammer animation at very high ping by texnonik and bencie


## 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
- [ ] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-12 19:01:34 +00:00
c0d3d3v 50eb249686
fix bug that sneaked in during refactoring (in #4775)
- was detected by missing hammer animation at very high ping
2022-03-12 18:48:04 +01:00
bors[bot] 420862dd61
Merge #4808
4808: Fix laser clipping. Closes #2176 r=def- a=Kaffeine

I've found this bug in a different mod and fixed it. Then I've got idea to check if any of the upstreams (this and tw)is  affected and it turned out that this is already [fixed](f3a1e68df9) in teeworlds.
I've dropped my change and did cherry-pick to reduce the difference between codebases.

Co-authored-by: oy <Tom_Adams@web.de>
2022-03-12 14:40:17 +00:00
Jupeyy 0ff8054b6c Allow more precise Destroy call to Job pool 2022-03-12 13:52:13 +01:00
Jupeyy 25ceea6f5f Write log to disk on assert 2022-03-12 13:48:29 +01:00
oy 9277e3cbeb Fix laser clipping. Closes #2176
(cherry picked from upstream commit f3a1e68df9)
2022-03-12 15:30:41 +03:00
bors[bot] f89142b433
Merge #4790
4790: Don't print binds into F1 by default (fixes #4789) r=heinrich5991 a=def-

<!-- 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>
2022-03-12 11:31:48 +00:00
Tater 3b93e656a0 Make hook collision line size adjustable 2022-03-11 21:19:17 -06:00
Jupeyy 95fe457abb Auto font size 2022-03-11 17:34:48 +01:00
bors[bot] fb20961cec
Merge #4762 #4792
4762: Set gfx_opengl_major 1 as default on 32bit x86 r=heinrich5991 a=def-

Multiple reports that BiT3 doesn't load with higher OpenGL

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


4792: Use ipv4 for info2.ddnet.tw requests r=heinrich5991 a=def-

<!-- 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
- [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: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-09 05:41:22 +00:00
Robert Müller 74f87ee604 Remove unnecessary trailing semicolons after method declarations 2022-03-08 20:01:26 +01:00
bors[bot] 849513f9ed
Merge #4787
4787: Fix some spacing in settings with German r=heinrich5991 a=def-

Reported by Izanagi on Discord
Old:
![screenshot-20220305@100323](https://user-images.githubusercontent.com/2335377/156877157-53e59c1c-455c-4ee1-ae44-14099c58d68d.png)
New:
![screenshot-20220305@102430](https://user-images.githubusercontent.com/2335377/156877213-92be8b48-9844-4095-adc7-6d70f203e63e.png)

## Checklist

- [x] Tested the change ingame
- [x] 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>
2022-03-08 16:07:00 +00:00
Alexander Akulich d4dbceea6c CPlayers::RenderPlayer: Stop overriding the Tee size
Tee size is already set to this value (64px) 372 lines above.

(Setting this value again makes it harder to customize this value)
2022-03-08 14:24:37 +03:00
Alexander Akulich 754562ce0b CGameClient::LoadMapSettings: Load the default tuning params by default
The code which changes the default settings ruins demo playback for
default modes.
2022-03-08 14:24:37 +03:00
Alexander Akulich 0a30d8a058 Apply snd_gun and snd_long_pain options only to DDRace and FNG games
On 'traumatic' game types (e.g. vanilla dm, tdm, ctf) it is critical to
hear SOUND_GUN_FIRE (because someone seems to shooting at you).

It is not any less important to head SOUND_PLAYER_PAIN_LONG which takes
its place whenever the character taken damage > 2 (because you need to
know whether someone was hit).
2022-03-08 14:24:37 +03:00
Alexander Akulich c4e1754808 CServer: Refactor the handling of the current map versions
- Replace hardcoded constants (namely '2') with enum value.
- Use the map type constants instead of bool-to-int casts.

This is a step toward support of more map types: e.g. we can have smaller
map versions with some mapres omitted for newer DDNet client versions.
2022-03-08 14:24:37 +03:00
Alexander Akulich e140d4c82e CBinds: Change 'no modifiers' value from '1' to '0'
The default bindings are set up via calls like Bind(KEY_A, "+left"); which
expands to Bind(KEY_A, "+left", /* FreeOnly */ false, /* ModifierCombination */ 0);

On the other hand, CMenusKeyBinder code does this: if(!Mask) Mask = 1 << MODIFIER_NONE;

This leads to a bug — binds which just set from the user input events are saved
in e.g. m_aapKeyBindings[1]['a'], and the default binds are still there
in m_aapKeyBindings[0]['a'] which leads to binds duplication in the UI.
2022-03-08 14:13:46 +03:00
Alexander Akulich 27922faea1 Engine/Text: Improve debug message on OnWindowResize() assert 2022-03-08 14:04:47 +03:00
c0d3d3v e01b1c5b3d
use TEAM_SPECTATORS and SPEC_FREEVIEW instead of -1 2022-03-07 22:16:28 +01:00
bors[bot] b0faac4a98
Merge #4784
4784: fix 4781 and refactor of the client id for server demos r=def- a=C0D3D3V

#Fixes #4781

I took the opportunity and directly refactored the code a bit, to be exact I replaced the -1 with the enum `SERVER_DEMO_CLIENT`, I can also change the identifier if we want to call it something else. Further I normalized the corresponding `>= 0` conditions to `> SERVER_DEMO_CLIENT`.


## 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
- [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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-07 18:08:32 +00:00
c0d3d3v 3438642dd8
fix 4781 and refactor of the client id for server demos 2022-03-07 19:03:43 +01:00
Dennis Felsing 9032f12cf3 Use ipv4 for info2.ddnet.tw requests 2022-03-07 15:01:37 +01:00
bors[bot] 2c4c858c24
Merge #4775
4775: Refactoring of players OnRender function r=def- a=C0D3D3V

Does anyone else feel that the code here: ff085a4545/src/game/client/components/players.cpp (L660-L709) is somewhat obfuscated? I do not think that the compactness of the code at this point increases the readability :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
- [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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-07 10:36:48 +00:00
def 6c0a564733 Don't print binds into F1 by default (fixes #4789) 2022-03-06 12:22:29 +01:00
bors[bot] 8d61322ca3
Merge #4788
4788: Add size checks to CVariableInt::Pack and ::Unpack, refactoring r=def- a=Robyt3

- Refactor `CVariableInt::Pack` some more according to upstream:
   - avoid right shift of negative number
   - rewrite loop smarter
- Add size parameters to `CVariableInt::Pack` and `CVariableInt::Unpack`. Adjust tests and add tests with too small buffer sizes.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] 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: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-03-05 22:15:56 +00:00
bors[bot] 3f222b46f8
Merge #4783
4783: Some network refactoring r=def- a=heinrich5991

In preparation to the proxy code, I refactored the network code a little, unifying its interface across operating systems and making our use of recvmmsg invisible to the caller.

## 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-03-05 21:59:57 +00:00
Robert Müller 66d64ec3fd Add size checks to CVariableInt::Pack and ::Unpack 2022-03-05 20:49:55 +01:00
Robert Müller 6337a4c2a9 Refactor CVariableInt::Pack 2022-03-05 20:48:04 +01:00
heinrich5991 1a35595bce Unify buffer handling in UDP sockets across operating systems
Previously, only Linux used an internal buffer (for optimized
receiving). Now all OSs use an internal buffer so that the call to
`net_udp_recv` behaves the same on all platforms.
2022-03-05 14:11:03 +01:00
def 729303822c Fix some spacing in settings with German 2022-03-05 10:24:26 +01:00
c0d3d3v e36363c2e2
deobfuscate players OnRender function 2022-03-04 20:03:24 +01:00
heinrich5991 a8664a0100 Hide the recvmmsg as an implementation detail 2022-03-04 19:33:06 +01:00
heinrich5991 3211b1de67 Remove unused Flags argument in network code 2022-03-04 19:33:06 +01:00
heinrich5991 471bb441a1 Move NETSOCKET behind a pointer so it can grow 2022-03-04 19:33:06 +01:00
heinrich5991 9af5870b3e Remove some redundant variable, spell out the condition instead 2022-03-04 19:20:36 +01:00
Edgar a7c25964f4
progress 2022-03-04 12:02:18 +01:00
bors[bot] 237a9170bd
Merge #4778 #4780
4778: More space for players in server browser (fixes #4777) r=Jupeyy a=def-

Old:
<img width="920" alt="Screenshot 2022-03-03 at 20 23 38" src="https://user-images.githubusercontent.com/2335377/156637630-a68291e3-7859-46b0-9a7c-249629d5a875.png">
New:
<img width="898" alt="Screenshot 2022-03-03 at 20 21 28" src="https://user-images.githubusercontent.com/2335377/156637402-6a8669bd-331d-402f-888c-97e2f3f189a6.png">

## Checklist

- [x] Tested the change ingame
- [x] 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)


4780: Update Korean translation by CHaBek r=edg-l 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: Dennis Felsing <dennis@felsin9.de>
2022-03-04 09:09:21 +00:00
c0d3d3v 8ddd53ab62
add enum for ShowOthers value 2022-03-03 22:56:32 +01:00
Dennis Felsing c7e1cf7d7a More space for players in server browser (fixes #4777) 2022-03-03 20:22:02 +01:00
c0d3d3v eda6ef899f
SV_TEAM enum was labeled 2022-03-03 15:36:06 +01:00
bors[bot] ff085a4545
Merge #4772
4772: Fix dummy connect on some vanilla servers r=def- a=Jupeyy

Fixes #4332, fixes #1698, fixes #4394, fixes #3544

For whatever reason the servers send "dm1.map" as map always (even if its not loaded at all), resulting in trying to disconnect the dummy, because on 
`NETMSG_CON_READY` message the config var `m_ClDummy` gets set, making the process server packet think this is the main connection, which then handles the map load as a map change. (The code generally doesn't look very safe, ez to break with the dummy connection check)

I changed the check to actually check if the connection is not the dummy connection for a few packets now, where i thought it doesnt make sense that the dummy connection (should) ever handle them
## 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
- [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: Jupeyy <jupjopjap@gmail.com>
2022-03-02 10:26:01 +00:00
Jupeyy c9094eb76f Fix dummy connect on some vanilla servers 2022-03-02 09:11:37 +01:00
bors[bot] e215aeb232
Merge #4768
4768: Videorecorder on by default (also for github builds) r=Jupeyy 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: Dennis Felsing <dennis@felsin9.de>
2022-03-02 08:02:32 +00:00
bors[bot] ac05c14c78
Merge #4771
4771: fix Alpha of Muzzle r=def- a=C0D3D3V

In principle https://github.com/ddnet/ddnet/issues/4207 has already been fixed with https://github.com/ddnet/ddnet/pull/4770
But I don't know if the bug has influence on another part. The faulty animation code is hereby fixed. The problem is that when you shoot with the Rifle or the Shotgun the Muzzle animation is executed. This manipulates Alpha, Alpha itself is actually redefined in the condition, but apparently it overwrites the Alpha used for RenderHand since it is in the same code block (from line 279 to 537).  


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-01 22:55:49 +00:00
Dennis Felsing 42907990ac Fix wrong param name 2022-03-01 23:52:46 +01:00
c0d3d3v e376eb995d
fix Alpha of Muzzle 2022-03-01 23:47:47 +01:00
bors[bot] 3a28f5fc6e
Merge #4769
4769: Fix integer overflow in CHud when server time exceeds around 248 days r=def- a=Robyt3

Fixes the server timer in the HUD showing 00:00 when the server time exceeds around 248 days.

Tested on "Vanilla Teeworlds Server - CTF":

![303d](https://user-images.githubusercontent.com/23437060/156249076-d3f20853-cd0a-4545-a459-493f123eb5bc.png)

Otherwise connecting to this server causes:

```
/src/game/client/components/hud.cpp:128:17: runtime error: signed integer overflow: 26254443 * 100 cannot be represented in type 'int'
    #0 0x55c8b6722e7d in CHud::RenderGameTimer() /src/game/client/components/hud.cpp:128
    #1 0x55c8b675cdfc in CHud::OnRender() /src/game/client/components/hud.cpp:855
    #2 0x55c8b6babec7 in CGameClient::OnRender() /src/game/client/gameclient.cpp:598
    #3 0x55c8b62b0330 in CClient::Render() /src/engine/client/client.cpp:1179
    #4 0x55c8b6301a62 in CClient::Run() /src/engine/client/client.cpp:3155
    #5 0x55c8b635fc34 in main /src/engine/client/client.cpp:4427
    #6 0x7f581a6150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x55c8b60f478d in _start (/build-asan/DDNet+0x1bd978d)
```

## 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
- [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 <robytemueller@gmail.com>
2022-03-01 22:38:43 +00:00
Robert Müller f89e6b6599 Fix integer overflow in CHud when server time exceeds around 248 days 2022-03-01 23:22:06 +01:00
Dennis Felsing 687f3e6160 Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
bors[bot] 3f36041c9c
Merge #4770
4770: Allow the ghost to carry any weapon r=def- a=C0D3D3V

I tried to reproduce another bug (https://github.com/ddnet/ddnet/issues/4207) and I noticed that ghosts are not allowed to carry any other weapons except grenade launcher and pistol. This is no longer necessary since we have been using the general renderer for players for a long time. We don't create projectiles for Ghosts, but it's always been like that and doesn't look worse than before.
![image](https://user-images.githubusercontent.com/14315968/156250428-3d8105d6-cf4a-4dd1-bf5c-cf1b9cab81d3.png)
![image](https://user-images.githubusercontent.com/14315968/156250490-02ac6d31-9146-47ff-89ac-9f4153d327a8.png)

So now you can see at least when the tee was frozen (before he was as seen in the linked issue with pistol in the freeze and alive)
![image](https://user-images.githubusercontent.com/14315968/156250525-857ca975-922f-48db-b38b-08ca86f5bd29.png)


## Checklist

- [x] Tested the change ingame
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-01 21:57:58 +00:00
Dennis Felsing c92423362e Videorecorder on by default (also for github builds) 2022-03-01 22:56:24 +01:00
c0d3d3v 5a621522b0
Allow the ghost to carry any weapon 2022-03-01 22:14:02 +01:00
bors[bot] 9d8e5f7957
Merge #4751 #4765
4751: Don't try to send messages outside of sv_max_clients (fixes# 4750) r=Jupeyy a=def-

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


4765: Show correct server address when connecting r=Jupeyy a=def-

This just saved the secret server for BiT3 streaming, but still a bug ;)

## 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: Dennis Felsing <dennis@felsin9.de>
2022-03-01 14:39:05 +00:00
bors[bot] 4533a3541a
Merge #4763
4763: Quad knife tool r=def- a=HiRavie

A new way to slice quads that doesn't make mappers pull their hair out.
To use it, open the quad context menu and click the _Slice_ button, check out the tooltip for more instructions.
Snaps automatically to corners and edges if close enough or to grid.

![gif](https://user-images.githubusercontent.com/65019210/155854241-9e07a5b2-1915-41d4-86c9-b2084ff6b929.gif)

## Checklist

- [x] Tested the change ingame
- [x] 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
- [ ] 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: Ravie <65019210+HiRavie@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-01 10:34:34 +00:00
Dennis Felsing c75139a1ad Fix clang-format and clang-tidy 2022-03-01 11:33:53 +01:00
Ravie 41ea78ac56 Simpler visuals code 2022-02-28 23:45:57 +01:00
Tater 959e7c2763 Fixed specteam 1 not showing teammates while spectating/freecam in solo 2022-02-28 12:47:01 -06:00
Dennis Felsing 3cd7058fe6 Show correct server address when connecting 2022-02-28 19:38:59 +01:00
def fd44f4523a Support NO_COLOR environment variable 2022-02-27 09:30:51 +01:00
Ravie 603089754f Some fixes 2022-02-27 00:44:34 +01:00
Ravie 2745c1a694 Knife tool 2022-02-26 18:49:06 +01:00
def a85d2f3d54 Set gfx_opengl_major 1 as default on 32bit x86
Multiple reports that BiT3 doesn't load with higher OpenGL
2022-02-26 11:53:03 +01:00
Tater ccc23161f6 Update players.cpp
Local Hook Collision line updates every frame instead of every tick
2022-02-25 06:22:51 -06:00
bors[bot] a8e8619af7
Merge #4759
4759: Add module offset r=def- a=Jupeyy

Get module offset, so we can at least recover the DDNet.exe paths:
`Error occurred on Wednesday, February 23, 2022 at 20:34:57. (with offset 00007FF7C4A00000)`
(Address - Offset) + (Image-Base)
(ImageBase  = winedump -f DDNet.exe (image base: usually 0x140000000)

Tested on windows 64-bit

08ab91c489

ez download from github actions:
https://github.com/Jupeyy/drmingw/actions/runs/1889238377

## 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-02-24 10:59:52 +00:00
Jupeyy 8bed1c7267 Add module offset 2022-02-24 10:45:58 +01:00
bors[bot] 03fc4d8f6e
Merge #4758
4758: Fix logging into rcon with dummy r=def- a=heinrich5991

Fixes #4721.

<!-- 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: heinrich5991 <heinrich5991@gmail.com>
2022-02-23 21:28:28 +00:00
heinrich5991 eff9abf769 Fix logging into rcon with dummy
Fixes #4721.
2022-02-23 20:42:08 +01:00
Chairn c0d398df38 CheckImageFormatRGBA --> IsImageFormatRGBA 2022-02-23 00:39:31 +01:00
Chairn 0ea66bca57 Clang format 2022-02-22 20:21:43 +01:00
Chairn 76064bd1c8 Drop non RGBA images 2022-02-22 20:21:34 +01:00
Dennis Felsing e2c48ec47e Don't try to send messages outside of sv_max_clients (fixes# 4750) 2022-02-21 16:33:53 +01:00
Dennis Felsing cc4be4b3b1 s/errornous/erroneous/g 2022-02-21 15:54:55 +01:00
Robert Müller 9ebb85f520 Fix listbox item double click behavior 2022-02-20 19:58:24 +01:00
def cf23a73891 Fix style 2022-02-20 10:41:06 +01:00
simpygirl 4e7b82a3fd Fix broken checkbox 2022-02-20 04:04:47 +01:00
c0d3d3v eac2d731b6
Refactoring of g_Config.m_SvTeam, See #4601 2022-02-19 18:11:15 +01:00
bors[bot] 40380d088f
Merge #4713
4713: Give the condition waits proper conditions r=def- a=Jupeyy

<!-- 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: Jupeyy <jupjopjap@gmail.com>
2022-02-19 12:48:40 +00:00
bors[bot] e79c166259
Merge #4697
4697: Show key presses in nameplates r=def- a=C0D3D3V


As described in [x](https://github.com/ddnet/ddnet/issues/4589) the arrows that show the key presses of the players are not visible in many situations, this is now my attempt to fix this by including the arrows in the nametags.

~~Also, I created a new option called `cl_show_direction_below` to show the arrows below the player. We can discuss whether this is useful, or whether it should simply be displayed as before only above the player.~~

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
https://streamable.com/czk2ht
See also https://github.com/ddnet/ddnet/issues/4589
- [x] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-02-19 12:36:50 +00:00
c0d3d3v d43ed14897
render key presses independent of m_ClNameplates 2022-02-19 13:31:34 +01:00
bors[bot] a5b3bd9fa0
Merge #4733
4733: Fix MinGW warnings (fixes #4731) r=Jupeyy a=def-

`@Jupeyy` `@Robyt3` `@Zwelf` 

## 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: Dennis Felsing <dennis@felsin9.de>
2022-02-19 08:51:54 +00:00
bors[bot] 501364cffe
Merge #4734
4734: No chat messages for live freeze r=Jupeyy a=def-

Since you have visual indication already, as suggested by fokkonaut and
Konsti

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-02-18 17:11:17 +00:00
Dennis Felsing bc0bf4e549 No chat messages for live freeze
Since you have visual indication already, as suggested by fokkonaut and
Konsti
2022-02-18 13:02:03 +01:00
Dennis Felsing aaec807963 Disable invalid cast warning in set_exception_handler_log_file 2022-02-18 12:55:13 +01:00
Dennis Felsing ded32c4334 Fix MinGW warnings (fixes #4731) 2022-02-18 12:54:19 +01:00
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 2782f82141 Increase MAX_IDS to 32k (fixes #4723)
Not sure I like it, otherwise we have to edit Game City.

Maybe we should fail this in map editor already instead of allowing to
create a map which requires > MAX_IDS
2022-02-17 23:36:08 +01:00
bors[bot] c8363bc96f
Merge #4719
4719: Better fix for sqlite3_expanded_sql r=Zwelf 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: Dennis Felsing <dennis@felsin9.de>
2022-02-17 10:32:11 +00:00
Robert Müller 89f126cf8d Remove obsolete ignore_convention comment 2022-02-16 20:54:11 +01:00
Dennis Felsing 14e52220c0 Better fix for sqlite3_expanded_sql 2022-02-15 23:28:11 +01:00
bors[bot] 84d896a783
Merge #4717
4717: Fix #4714 r=Zwelf a=def-

sqlite on Windows doesn't seem to have this function
<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-02-15 21:10:04 +00:00
Dennis Felsing 18ee351247 Version 15.9.1 2022-02-15 21:20:31 +01:00
Dennis Felsing 97a79c1053 Fix #4714
sqlite on Windows doesn't seem to have this function
2022-02-15 21:05:50 +01:00
bors[bot] dc52f81e2d
Merge #4715
4715: Initialize m_aErrorString earlier (fixes #4707) r=Jupeyy a=def-

Just a guess that there might stil be garbage in this array
<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-02-15 18:48:32 +00:00
Dennis Felsing 1972a1be9a Initialize m_aErrorString earlier (fixes #4707)
Just a guess that there might stil be garbage in this array
2022-02-15 18:30:20 +01:00
Jupeyy 8cbff50461 Give the condition waits proper conditions 2022-02-15 16:31:29 +01:00
c0d3d3v 94c1d7fe66
remove m_ClShowDirectionBelow
Show keystrokes always above the players
2022-02-15 11:59:07 +01:00
Dennis Felsing e615d4b844 Fix tools 2022-02-15 01:07:26 +01:00
Dennis Felsing 18d9997348 Fix clang-format 2022-02-15 00:32:04 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing 7da9f1b93b Add modernize-use-equals-delete 2022-02-15 00:20:34 +01:00
Dennis Felsing b58470fda4 Add modernize-use-equals-default 2022-02-15 00:17:57 +01:00
Dennis Felsing 2da5d7d289 Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
Dennis Felsing 62756dbda0 Enable modernize-make-unique clang-tidy check 2022-02-15 00:05:46 +01:00
Dennis Felsing 1afd1a32d1 Fix Linux build with C++20
src/game/client/components/chat.cpp: In lambda function:
src/game/client/components/chat.cpp:686:33: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  686 |  auto &&FChatMsgCheckAndPrint = [=](CLine *pLine) {
      |                                 ^
src/game/client/components/chat.cpp:686:33: note: add explicit ‘this’ or ‘*this’ capture
2022-02-14 19:19:20 +01:00
Dennis Felsing 4c8e33ee8e Fix MSVC build
src\game\gamecore.cpp(185,36): warning C5055: operator '*': deprecated between enumerations and floating-point types [D:\a\ddnet\ddnet\debug\game-shared.vcxproj]
2022-02-14 19:19:20 +01:00
ChillerDrgon 064ba50230 Add secure_random_uninit 2022-02-14 12:06:31 +01:00
def 75c7303c66 Version 15.9 2022-02-13 00:00:18 +01:00
bors[bot] 0dbb4886b3
Merge #4700
4700: Fix integer overflow of snapshot delta item size r=def- a=Robyt3

Fixes

```
src/engine/shared/snapshot.cpp:373:13: runtime error: signed integer overflow: 1661611014 * 4 cannot be represented in type 'int'
    #0 0x56377a580246 in CSnapshotDelta::UnpackDelta(CSnapshot const*, CSnapshot*, void const*, int) src/engine/shared/snapshot.cpp:373
    #1 0x563779c540d3 in CClient::ProcessServerPacket(CNetChunk*) src/engine/client/client.cpp:1465
    #2 0x563779c5a5fc in CClient::PumpNetwork() src/engine/client/client.cpp:1599
    #3 0x563779c622ce in CClient::Update() src/engine/client/client.cpp:1769
    #4 0x563779c774d2 in CClient::Run() src/engine/client/client.cpp:2112
    #5 0x563779c92c74 in main src/engine/client/client.cpp:2712
    #6 0x7fbf393bb0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x563779b0e15d in _start (/teeworlds/build/x86_64/debug/teeworlds+0x121815d)
```

(Trace is from upstream; the affected code is identical).

## 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>
2022-02-11 16:35:40 +00:00
Robert Müller 800a5fbe92 Fix integer overflow of snapshot delta item size 2022-02-11 17:18:00 +01:00
bors[bot] 22a5bb9826
Merge #4695
4695: Always destroy bullets/lasers on kill when in practice team (fixes #4694) r=heinrich5991 a=def-

to prevent /teleporting back to start line and cheating

Any thoughts on whether to include this for 15.9? I'd say yes.

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-02-11 16:04:07 +00:00
Dennis Felsing 3650281cf0 Always destroy bullets/lasers on kill when in practice team (fixes #4694)
to prevent /teleporting back to start line and cheating
2022-02-11 16:58:04 +01:00
bors[bot] f1c77fc8f6
Merge #4698
4698: Close wordlist.txt file handle after use r=def- a=ChillerDragon

<!-- 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: ChillerDragon <ChillerDragon@gmail.com>
2022-02-11 15:38:27 +00:00
ChillerDragon 0a3c75b925 Close wordlist.txt file handle after use 2022-02-11 16:30:18 +01:00
c0d3d3v 724a49dc59
Show keystrokes in the nametag and new option cl_show_direction_below to show the keypresses below the players 2022-02-11 14:05:37 +01:00
bors[bot] 9bad96d0b3
Merge #4680
4680: Add CentOS, RedHat, AlmaLinux instructions and fix build 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: Dennis Felsing <dennis@felsin9.de>
2022-02-11 12:18:33 +00:00
Dennis Felsing 8162257a72 Allow sv_show_others_default in map settings
for tutorial map
2022-02-10 23:49:58 +01:00
bors[bot] 80df1aefea
Merge #4689
4689: Lower the sound volume even further after #4568 r=def- a=heinrich5991

In my non-representative survey, I found that my own sound settings are
at 9 for global volume and 100 for the rest, and for a newbie, it was ~30
for all settings. This should be equivalent given 0.3*0.3=0.09.

CC #4567
CC #4568

<!-- 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: heinrich5991 <heinrich5991@gmail.com>
2022-02-10 17:56:50 +00:00
heinrich5991 b01afd6013 Lower the sound volume even further after #4568
In my non-representative survey, I found that my own sound settings are
at 9 for global volume and 100 for the rest, and for a newbie, it was ~30
for all settings. This should be equivalent given 0.3*0.3=0.09.

CC #4567
CC #4568
2022-02-10 18:05:13 +01:00
Robert Müller 6d15f360c1 Delay double click handling one frame after item activation 2022-02-10 17:40:03 +01:00
bors[bot] 007e632530
Merge #4675
4675: Remove the totally unsafe editor undo r=heinrich5991 a=def-

Since it causes crashes because another thread just accesses the data.

No one has wanted to fix this, so maybe we should just remove it instead
of having clients crash in editor. I'm wondering how much effort it
would be to make this safe. Would we just have to lock for a short part
or is it basically the entire threaded undo operation that has to be
serialized? (No need for a thread then)

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-02-09 17:11:03 +00:00
bors[bot] 0d3234e316
Merge #4684
4684: Init m_NonEmptySince r=def- a=ChillerDragon

<!-- 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: ChillerDrgon <ChillerDragon@gmail.com>
2022-02-09 16:30:08 +00:00
ChillerDrgon 7bcb9fa9ca Init m_NonEmptySince 2022-02-09 17:18:43 +01:00
bors[bot] 0c5d5e1a7a
Merge #4683
4683: Init m_pNextTraverseEntity r=heinrich5991 a=Jupeyy

<!-- 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: Jupeyy <jupjopjap@gmail.com>
2022-02-09 14:36:20 +00:00
Jupeyy ea2102efcb Init m_pNextTraverseEntity 2022-02-09 15:26:50 +01:00
Chiller Dragon d27a3303c4
Remove commented out OnEntity call
Was added by GreYFoX in some big merge commit

f7f6058a92 (diff-aba621fd6688d4086ab40e58808cc12fdf591fdedf0d6c58cde2312b68cea5e0R1737)
2022-02-09 10:17:45 +01:00
Dennis Felsing 1beb3f7b22 Fix backend_sdl.cpp build
src/engine/client/backend_sdl.cpp: In function ‘bool BackendInitGlew(EBackendType, int&, int&, int&)’:
src/engine/client/backend_sdl.cpp:305:20: error: ‘GLEW_VERSION_4_5’ was not declared in this scope; did you mean ‘GLEW_VERSION_1_5’?
  305 |                 if(GLEW_VERSION_4_5)
      |                    ^~~~~~~~~~~~~~~~
      |                    GLEW_VERSION_1_5
2022-02-08 18:35:59 +01:00
Dennis Felsing 720268af6a Fix compilation error in client.cpp
src/engine/client/client.cpp:3861:47: error: ‘INT_MAX’ was not declared in this scope
 3861 |         if(Start < 0 || Length < 0 || Start > INT_MAX - Length)
      |                                               ^~~~~~~
src/engine/client/client.cpp:81:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
2022-02-08 18:35:55 +01:00
Dennis Felsing bec66a2cb6 Fix backend_opengl.cpp build (fixes #4681) 2022-02-08 18:17:56 +01:00
Dennis Felsing e428f6ab5d Ignore F5 key press when ingame menu is open
Since ghost menu and browser use F5 already to refresh, and having a
bind on it, would cause both actions at once.

I believe it makes sense to have this special handling only for F5,
other F-keys don't have this problem since we don't use them in any
menus.
2022-02-08 00:38:05 +01:00
bors[bot] d2045b5d78
Merge #4676
4676: Record player_ready event in teehistorian r=heinrich5991 a=Zwelf

Allows reproducing teehistorian files without lookahead and without relying on PlayerNew messages.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
  - tested with teehistorian deactivated
- [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: Zwelf <zwelf@strct.cc>
2022-02-07 23:11:17 +00:00
Zwelf 3ea55dcc0e Record player_ready event in teehistorian 2022-02-07 23:31:46 +01:00
Dennis Felsing fe1b86b173 Remove the totally unsafe editor undo
Since it causes crashes because another thread just accesses the data.

No one has wanted to fix this, so maybe we should just remove it instead
of having clients crash in editor. I'm wondering how much effort it
would be to make this safe. Would we just have to lock for a short part
or is it basically the entire threaded undo operation that has to be
serialized? (No need for a thread then)
2022-02-07 15:57:27 +01:00
bors[bot] 0a7ff4f9d0
Merge #4674
4674: Fix evolve limit r=def- a=heinrich5991

Mixed up previous and current. This did not show up in testing, because
these two were always true at the same time. I've now debugged it and
manually made specific conditions false to verify that it's working.

Sorry for the mess.

<!-- 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: heinrich5991 <heinrich5991@gmail.com>
2022-02-07 14:06:36 +00:00
heinrich5991 7aafc78622 Fix evolve limit
Mixed up previous and current. This did not show up in testing, because
these two were always true at the same time. I've now debugged it and
manually made specific conditions false to verify that it's working.

Sorry for the mess.
2022-02-07 14:29:49 +01:00
bors[bot] 3de74a9cbc
Merge #4672
4672: Make the evolve limit more visible r=def- a=heinrich5991

This is to make sure that modders don't start to rely on the fact that
we clamp the evolve duration to 3 seconds.

CC #4624

## 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-02-07 12:29:24 +00:00
heinrich5991 a203478809 Make the evolve limit more visible
This is to make sure that modders don't start to rely on the fact that
we clamp the evolve duration to 3 seconds.
2022-02-07 12:16:39 +01:00
bors[bot] d7ed57fa3f
Merge #4576 #4670 #4671
4576: HTTP Serverbrowser: Quit faster (fixes #4563) r=heinrich5991 a=def-

```
[2022-01-08 09:57:03][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=54ms
[2022-01-08 09:57:03][client]: disconnecting. reason='unknown'
[2022-01-08 09:57:03][http]: https://master2.ddnet.tw/ddnet/15/servers.json failed. libcurl error: Callback aborted
[2022-01-08 09:57:03][serverbrowse_http]: master chooser aborted
```

Not instantaneous but much faster, depends on how often curl calls the PROGRESSFUNCTION.

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


4670: Lib updates r=heinrich5991 a=def-

curl 7.79.0 -> 7.81.0
freetype 2.11.0 -> 2.11.1
sqlite 3.36.0 -> 3.37.2
ffmpeg 4.4 -> 5.0
websockets 4.2 -> 4.3

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


4671: Update Chinese translations (by cheeser0613) 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: Dennis Felsing <dennis@felsin9.de>
2022-02-07 11:01:38 +00:00
bors[bot] 4d2505284b
Merge #4624
4624: Limit evolving to 3 seconds r=heinrich5991 a=ChillerDragon

Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)

Fixes client freezes if the server sends funny ticks

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-02-07 10:50:02 +00:00
bors[bot] 3025bb0036
Merge #4668
4668: Fix bindings with modifiers r=def- a=Kaffeine

I work on a client for InfClass mod and it is important to have bindings for many situations, so we have to use modifiers (one modifier per bind).

It turned out that bindings (with a modifier) are broken in DDNet since commit 4326d00df9 which changes the implementation to support modifier combinations but it messes up the UI part.

I've considered options to revert the commit or to fix the combined modifiers and bravely 😅  choose the latter way. The code had at least five bugs and fixing e.g. four of them does not help much, making it really hard to say if the fix is correct or not. I had to rename some vars first to make the code readable and now (with the correct names) each fix should seem reasonable.

`Modifier` was confused with `ModifierCombination` in so many places. I do not like the idea of deviating from the `teeworlds` codebase but we already did it here by introducing of combined modifiers. We do not use a stronger type system (enum classes and flag classes) but one thing we can do to give a developer the idea of what is going on is to use the correct variable and argument names at least.

## Checklist

- [x] Tested the change ingame
- [x] 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)

I checked the follow cases:
- Binding of a normal key (e.g. `t`)
- Binding of a sole modifier (e.g. `lctrl`)
- Binding of a key combined with a modifier (e.g. `ctrl+t`)
- Binding of a key combined with many modifier (e.g. `ctrl+alt+t`)

### Before
Bindings with `Shift` modifiers displayed as `Ctrl+`, bindings with `Ctrl` or `Alt` are not displayed at all.
![image](https://user-images.githubusercontent.com/374839/152705632-42668ec2-a424-4dfa-99ff-250e146da5ea.png)

### After
All bindings displayed correctly
![image](https://user-images.githubusercontent.com/374839/152706393-08c36e36-1200-482a-9eb3-dc0d96185cdd.png)

but also it is possible to set any crazy binding from UI
![image](https://user-images.githubusercontent.com/374839/152706406-b1e18139-16a3-451e-9ac9-702b0aac4d2e.png)



Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
2022-02-07 09:24:02 +00:00
Alexander Akulich 9a5b7339cf Client: Fix projectiles rendering for demo playback
The playback timing leads to always negative client time for projectiles
fired on the current game tick.
2022-02-07 02:41:21 +03:00
Alexander Akulich 17222d67bf Binds: Reorder modifiers according to the convention
The modifiers order in the UI and console follows the order
of modifier enum items.

The conventional order of the modifiers is: Ctrl, Alt, Shift, GUI (Win, Meta).

Place Shift after Alt to get proper order, e.g.:
Alt+Shift+R (conventional) instead of Shift+Alt+R (weird)
2022-02-07 01:54:12 +03:00
Alexander Akulich 7d1595f06f Client/CMenus: Actually process and show all bindings with modifiers 2022-02-07 01:54:12 +03:00
Alexander Akulich e0876960fc CBinds: Remove unused ModifierMatchesKey() 2022-02-07 01:54:12 +03:00
Alexander Akulich fff597cd2a CMenusKeyBinder: Fix binding in cases with only a modifier key pressed 2022-02-07 01:54:12 +03:00
Alexander Akulich 2233ca98c1 CBinds::GetModifierMask: Make the method actually returning the mask
... instead of the modifier enum value.

This fixes CMenusKeyBinder which now saves the bindings into the right slot.
2022-02-07 01:54:12 +03:00
Alexander Akulich ae482d018f CMenus::DoKeyReader: Fix the UI text for binds with a modifier(s) 2022-02-07 01:50:14 +03:00
Alexander Akulich db1d136006 client/menus: Fix variable names 2022-02-07 01:50:14 +03:00
Alexander Akulich 343b2543cc Client/CBinds: Rename arguments which refers to the ModifierCombination
The first dimention of m_aapKeyBindings is ModifierCombination
since commit 4326d00df9.

Rename the arguments to make it clear when the arg is a combination
(e.g. the arg value '2' refers to '1 << MODIFIER_SHIFT' instead of 'MODIFIER_CTRL')

This is needed to make the code cleaner and the bugs more obvious.
2022-02-07 01:50:14 +03:00
Alexander Akulich 68b1afce0e client/menus_settings: Replace hardcoded config name with a macro 2022-02-06 22:44:21 +03:00
Alexander Akulich ac61a38afe CPlayers::RenderPlayer: Consistently use Alpha variable
We already use Alpha to render the weapon, Tee hand, and emoticon.
We also rendered ghost Tee with the same Alpha value.
2022-02-06 22:29:27 +03:00
Alexander Akulich d7a4c37f11 engine/client: Replace the game hardcoded name with a macro variable 2022-02-06 22:25:34 +03:00
Dennis Felsing b897753ef0 HTTP Serverbrowser: Quit faster (fixes #4563)
[2022-01-08 09:57:03][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=54ms
[2022-01-08 09:57:03][client]: disconnecting. reason='unknown'
[2022-01-08 09:57:03][http]: https://master2.ddnet.tw/ddnet/15/servers.json failed. libcurl error: Callback aborted
[2022-01-08 09:57:03][serverbrowse_http]: master chooser aborted
2022-02-06 18:39:14 +01:00
bors[bot] 00f93da936
Merge #4661
4661: Make spawn position independent of players in other teams r=heinrich5991 a=def-

As suggested by Rockus, should help speedrunners who get followed by
other players

<!-- 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>
2022-02-06 12:50:04 +00:00
bors[bot] f654b1a12c
Merge #4665
4665: Support saving any size binds (fixes #4660) r=heinrich5991 a=def-

Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file

<!-- 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>
2022-02-06 11:43:30 +00:00
def db4d9f9a47 Support saving any size binds (fixes #4660)
Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file
2022-02-06 12:01:46 +01:00
bors[bot] 90944e0cac
Merge #4654
4654: Add a groundjump-only tile r=def- a=heinrich5991

Implements a new mode of jumping: "you only have ground jump".  This differs from "you only have one jump" in that it doesn't allow you to air-jump, even if you haven't jumped to get off the ground. To access this mode, it reuses the "air-jump tile" in the switch layer with the number of jumps set to 255.

This tile is planned to be used in tutorial developed by unique2 and Alisa.

## 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-02-06 09:23:14 +00:00
def d96f354b28 Make spawn position independent of players in other teams
As suggested by Rockus, should help speedrunners who get followed by
other players
2022-02-06 00:01:50 +01:00
heinrich5991 620d611521 Add "groundjump-only" tile
Works by setting the airjump tiles' jumps to 255.
2022-02-05 23:53:32 +01:00
bors[bot] 7ef077cfea
Merge #4655
4655: Add windowed fullscreen ( a special case for Windows ) r=def- a=Jupeyy

fixes #4597

## 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>
2022-02-05 21:53:39 +00:00
heinrich5991 87df5b8c14 newJumpsNewJumps 2022-02-05 22:32:55 +01:00
Robert Müller 082e26d5ba Reduce system API calls when listing directory contents 2022-02-04 16:30:12 +01:00
Jupeyy 338b6b2238 Add windowed fullscreen ( a special case for Windows ) 2022-02-04 11:14:10 +01:00
heinrich5991 a51875f9b6 Sync the config file replacement to disk before renaming
Hopefully, this fixes player's incomplete config issues.
2022-02-01 02:33:20 +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
bors[bot] f15b3afd95
Merge #4648
4648: Add some checksum functions to the client r=def- a=heinrich5991

Let's see if it works out, if not, we can revert it.

## 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-01-31 22:42:24 +00:00
bors[bot] c9cecaa6e2
Merge #4580
4580: Add teleport/tp chat command to teleport yourself r=edg-l a=def-

to another player or spectated location. Requires /practice mode

As suggested by Rockus on Discord

<!-- 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>
2022-01-31 21:29:14 +00:00
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00
heinrich5991 7a6f5a8af4 Add a function for getting a handle to the current executable file 2022-01-31 21:31:26 +01:00
Dennis Felsing 3aa29a9ea3 Don't clamp team quietly, but crash on invalid team 2022-01-31 13:29:11 +01:00
def 3078d9dcfc Transfer super state to client and predict properly 2022-01-31 13:22:44 +01:00
def d31f1c6554 Make super player sounds always appear 2022-01-31 13:22:44 +01:00
def c5d0b984df Ignore start line warning in practice mode 2022-01-31 13:21:26 +01:00
def 1bdf960945 Add teleport/tp chat command to teleport yourself
to another player or spectated location. Requires /practice mode

As suggested by Rockus on Discord
2022-01-31 13:21:04 +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
heinrich5991 9ef3c8c94a Mark all component functions overrides with override 2022-01-31 00:53:12 +01:00
Robert Müller d8aefa5bed Add missing default value for CServerCapabilities::m_SyncWeaponInput 2022-01-30 11:47:30 +01:00
Dennis Felsing 1cf377f172 Disallow start_video outside of video player (fixes #4642) 2022-01-28 21:12:31 +01:00
Robert Müller 4f653cfcda Use H/VSplitMid where possible 2022-01-26 20:41:08 +01:00
Robert Müller f341e96689 Use Spacing parameter where possible 2022-01-26 20:41:08 +01:00
Robert Müller 4fbca828f4 Add optional Spacing parameter to H/VSplitMid 2022-01-26 20:41:05 +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
bors[bot] f1f0cd0bc5
Merge #4640
4640: Don't clamp "zoom" command, we already clamp in ChangeZoom r=heinrich5991 a=def-

Thanks to chillerdragon for noticing

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-01-26 13:06:41 +00:00
Dennis Felsing 0374ddac72 Don't clamp "zoom" command, we already clamp in ChangeZoom
Thanks to chillerdragon for noticing
2022-01-26 12:54:19 +01:00
Dennis Felsing 087a9a8235 Fix SendStartWarning() to only warn every 3 seconds
Thanks for Skeith for report
2022-01-26 12:24:56 +01:00
Dennis Felsing 5cc8eb979d Better fixes 2022-01-26 11:01:11 +01:00
bors[bot] 253bfaf987
Merge #4637
4637: Only record snapshot of the currently active tee r=def- a=heinrich5991

Fixes #4636.

<!-- 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: heinrich5991 <heinrich5991@gmail.com>
2022-01-26 07:47:43 +00:00
heinrich5991 aed195b244 Only record snapshot of the currently active tee
Fixes #4636.
2022-01-26 01:28:20 +01:00
Dennis Felsing f346e445bd Fix timestamp in record_maps in test (fixes #4631) 2022-01-24 20:58:14 -03:00
heinrich5991 408ece7645 Fix rcon command receiving
Only use the rcon commands from the main connection
2022-01-24 15:29:17 +01:00
heinrich5991 b92f794e3e Fix old-style DDNet version message sending
Forgot to invert a condition in
49bc150afd.

Fixes #4629.
2022-01-24 15:29:04 +01:00
Dennis Felsing 827ebf1ce6 Emote -> Emoticon 2022-01-23 19:16:23 +01:00
Dennis Felsing 7903b40066 Quiet clang-tidy on macOS 2022-01-23 19:04:01 +01:00
Dennis Felsing 4da76e0e7d Fix any_of 2022-01-23 18:56:37 +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 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +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
def 7aac8b5386 Add readability-container-size-empty 2022-01-22 13:54:25 +01:00
def bcb50c1b29 Enable readability-const-return-type, readability-container-data-pointer, readability-delete-null-pointer 2022-01-22 13:49:14 +01:00
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +01:00
def f3796e5455 Disable or fix some spammy new clang-tidy 13 warnings
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)
                                                          ^ ~~~~~~~~~
2022-01-22 13:35:52 +01:00
bors[bot] 623d8af04c
Merge #4623
4623: Refactor: Distinguish between two concepts previously called "Dummy" r=def- a=heinrich5991

On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

Also fix a few bugs in dummy handling.

## 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-01-21 21:26:21 +00:00
heinrich5991 d2bf8d6513 Rename Client to Conn (suggestion by deen) 2022-01-21 22:13:35 +01:00
bors[bot] 390e54f627
Merge #4625
4625: Use ETextAlignment enum for UI r=def- a=ChillerDragon

Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

`@cinaera` added alignment enums
	04ee8b20a1

`@TsFreddie` renamed them
	67651e8122

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-01-21 15:39:36 +00:00
ChillerDragon b770bc6988 Use ETextAlignment enum for UI
Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

@cinaera added alignment enums
	04ee8b20a1

@TsFreddie renamed them
	67651e8122
2022-01-21 16:26:19 +01:00
ChillerDragon 41fd1639d9 Limit evolving to 3 seconds
Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)
2022-01-21 11:30:31 +01:00
heinrich5991 4435e17b95 Fix a few bugs in dummy handling
Previously, e.g. pings would only be replied to on the currently active
client.
2022-01-21 02:02:08 +01:00
heinrich5991 49bc150afd Refactor: Distinguish between two concepts previously called "Dummy"
On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

I tried to not fix bugs unless it would complicate the code.
2022-01-21 01:54:14 +01:00
bors[bot] 6d3aaaeff9
Merge #4622
4622: Refactoring: move RenderTilemapGenerateSkip to CLayers, Add CLayers::NumLayers r=def- a=Robyt3

- Move `CRenderTools::RenderTilemapGenerateSkip` to `CLayers::InitTilemapSkip`, as it can be a private function in `CLayers`.
- Add missing `CLayers::NumLayers` accessor.
- Improve code style.

## 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: Robert Müller <robert.mueller@uni-siegen.de>
2022-01-20 21:54:42 +00:00
bors[bot] 670c47fa60
Merge #4621
4621: Forgot a part of the asyncrender revert r=Jupeyy a=def-

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-01-20 15:03:25 +00:00
Dennis Felsing 57d340701d Forgot a part of the asyncrender revert 2022-01-20 16:02:02 +01:00
bors[bot] 2c32686101
Merge #4620
4620: Shutdown components r=def- a=ChillerDragon

<!-- 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: ChillerDragon <ChillerDragon@gmail.com>
2022-01-20 13:18:29 +00:00
ChillerDragon e4be3f5241 Shutdown components 2022-01-20 12:20:29 +01:00
bors[bot] ca7a613c2e
Merge #4619
4619: Further android build fixes r=def- a=Jupeyy

I just build the whole Android project now to check if there is other stuff:
- SDL also renamed a CMAKE flag
- apparently we updated icons, 512x512 was removed
- the newer compiler version warned about mismatched c function signature(SDL_main)
- since we moved all resize stuff to the main thread i made sure the main thread gets the updated window, which is important for android


I tested it on phone, so it works now and fixes #4615

## 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>
2022-01-20 10:58:13 +00:00
Jupeyy 55a1406641 Further android build fixes 2022-01-20 11:04:47 +01:00
Robert Müller 4791bc4cd8 Remove unnecessary trailing semicolons 2022-01-19 22:44:20 +01:00
Robert Müller e9293877ca Add CLayers::NumLayers 2022-01-19 22:44:16 +01:00
Robert Müller 6c558c2138 Improve code style of InitTilemapSkip 2022-01-19 22:27:59 +01:00
Robert Müller 1810ff3949 Move InitTilemapSkip to CLayers 2022-01-19 22:22:31 +01:00
Robert Müller 39b716d5ab Fix double clicking on folders in demo browser 2022-01-19 21:45:47 +01:00
Robert Müller 2f17fa9b39 close find handle in fs_file_time on windows 2022-01-18 22:42:08 +01:00
bors[bot] 054e7528dd
Merge #4612
4612: Handle SIGINT and SIGTERM (fixes #4610) r=heinrich5991 a=def-

Code by Robyt3 taken from Teeworlds, added SIGTERM

## 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>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-17 23:51:58 +00:00
bors[bot] 48e53470cd
Merge #4581 #4590 #4593 #4607
4581: Adjustable prediction margin r=def- a=trml

This adds an option to adjust how early the client sends an input for a given tick. In vanilla this value is hardcoded to 10 milliseconds before the next tick, which is good for low-latency gameplay and/or when you have a stable connection, but sometimes it could perhaps be useful to increase the value, to either test something with a high ping (without having to joing a high-ping server or use on a 3rd party program like tc/netem), or for counteracting the effect of jitter and jumping ping.

The last part comes at a tradeoff for higher ping though, and it also doesn't handle lag caused by packet loss, but it I have found it useful in some situations when playing race/solo/dummy with a bad connection. Since it's a bit experimental I only added it as an f1 option and not stored between sessions, and also added a gameinfo flag to only support it on servers that implement #1441.

Edit: Also attempted to cleanup variable names for tick calculations in client.cpp slightly.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] 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)


4590: Remove extra projectiles r=def- a=trml

Aligns the code with vanilla, and cleans up things a bit
(same as [329e6261f3](url))

These were used to show projectiles a tick (or fraction of a tick) earlier than they otherwise would (and they were also sent without extrainfo since they didn't matter for prediction), so removing them would perhaps not make a noticeable difference. (and perhaps also less of a difference now since weapon input isn't applied before the start of a tick anymore).

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


4593: Fix compiler warning with new ffmpeg version (currently built from git) r=heinrich5991 a=def-

```
src/engine/client/video.cpp:102:32: error: assigning to 'AVOutputFormat *' from 'const struct AVOutputFormat *' discards qualifiers
        m_pFormat = m_pFormatContext->oformat;
                    ~~~~~~~~~~~~~~~~~~^~~~~~~
src/engine/client/video.cpp:571:13: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
        *ppCodec = avcodec_find_encoder(CodecId);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
<!-- 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)


4607: Adopt upstream input (especially double click) handling, refactoring r=def- a=Robyt3

This adopts the 0.7 way of handling double clicks, by checking `Event.button.clicks` of the `SDL_Event`. The double click is stored as a flag which is cleared when the `MouseDoubleClick()` function is called (d215c73206 and 7977b46d36).

This reverts 72a6e20, as this hack is no longer required (closes #1745). Double clicking a friend in the friend list still works (#444) with both `gfx_asyncrender_old 0` and `1`.

Refactorings and minor fixes synchronizing with upstream:

- Only copy SDL keystate of _keyboard_ keys and mem_zero the rest to ensure out of bounds SDL keys don't trigger mouse keys.
- Rename variables and use SDL constants.
- Reduce unnecessary indentation.

## Checklist

- [X] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [X] 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: trml <trml@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: oy <Tom_Adams@web.de>
2022-01-17 23:36:14 +00:00
Dennis Felsing 8a6cb2bed7 Simplify signal handling by unregistering 2022-01-18 00:35:33 +01:00
Dennis Felsing d54a7993d5 Fix compiler warning with ffmpeg 5.0 2022-01-18 00:30:34 +01:00
bors[bot] 0177f21d36
Merge #4613
4613: Revert LFREEZE-LUNFREEZE explanation on editor for Switch layer r=def- a=GiuCcc

Thank `@fokkonaut`
Revert two lines to original.

Commit to be reverted:
2017464282 (diff-6ecdf8a78005b8c2541e54e3532ebec8f3f4ef2ec69ba8a6a281ce4421562570)


## 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: Wohoo <giu.casuccio@gmail.com>
2022-01-17 23:22:56 +00:00
Wohoo 163666a9fb Revert of 2017464282
on LFREEZE and LUNFREEZE  case
2022-01-18 00:07:52 +01:00
Dennis Felsing f16e1f09c1 Also handle SIGTERM (fixes #4610) 2022-01-17 23:16:03 +01:00
Robert Müller 259a449b67 use compliant sig_atomic_t for signal handler, use _Exit 2022-01-17 23:15:52 +01:00
Robert Müller a69852bdfc force quit on second Ctrl+C 2022-01-17 23:15:52 +01:00
Robert Müller eecd13476c handle SIGINT in server to properly shutdown everything 2022-01-17 23:15:49 +01:00
bors[bot] cfe5032217
Merge #4611
4611: Default players to being afk on new map r=heinrich5991 a=def-

As reported by MitakoKotomi in https://forum.ddnet.tw/viewtopic.php?f=118&p=70154

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-01-17 15:16:03 +00:00
Dennis Felsing c033513976 Default players to being afk on new map
As reported by MitakoKotomi in https://forum.ddnet.tw/viewtopic.php?f=118&p=70154
2022-01-17 12:58:14 +01:00
bors[bot] e03e6210e0
Merge #4604
4604: Allow multiple comands when adding vote in UI r=heinrich5991 a=def-

as reported by louis

<!-- 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>
2022-01-17 02:10:34 +00:00
def 7e7fac82da Escape voting commands sent from client 2022-01-17 00:41:47 +01:00
trml b391e4b50d Fix bullet rendered through walls 2022-01-16 21:58:51 +01:00
Robert Müller c214918977 only consume double click if item hot 2022-01-16 12:43:32 +01:00
Robert Müller c495d4b327 change type of MouseDoubleClick from int to bool 2022-01-16 12:43:32 +01:00
oy e3b20696cc end double mouse click state when doing a new single click. 2022-01-16 12:43:32 +01:00
oy bbc194ce2a use info provided by sdl for mouse double clicks 2022-01-16 12:43:32 +01:00
Robert Müller 3557bea32d reduce indentation of input event handling code 2022-01-16 12:43:29 +01:00
Robert Müller 6675de319b do not copy keyboard over mouse state, refactoring 2022-01-16 12:41:31 +01:00
Robert Müller 79879591b1 refactor mouse state handling 2022-01-16 12:41:31 +01:00
Robert Müller b4a99fecdf Revert "Split CInput::NextFrame() from CInput::Update() (fixes #444)"
This reverts commit 72a6e20ba8.
2022-01-16 12:41:31 +01:00
def 746fc307aa Allow multiple comands when adding vote in UI
as reported by louis
2022-01-16 10:43:35 +01:00
bors[bot] dd9eb0d736
Merge #4584
4584: Fix rescue tee when swapping (fixes #4578) r=Jupeyy a=def-

<!-- 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>
2022-01-15 18:39:31 +00:00
bors[bot] b0f6b805d3
Merge #4583
4583: Update score hud immediately when switching dummy r=Jupeyy a=def-

<!-- 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>
2022-01-15 18:27:42 +00:00
bors[bot] c1cd846c79
Merge #4568
4568: Reduce default ambient volume to 30 (fixes #4567) r=Jupeyy 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>
2022-01-15 16:28:28 +00:00
bors[bot] dcc912d317
Merge #4602
4602: Fix windows macro and split the resize events r=def- a=Jupeyy

I noticed that the resize backend used the wrong macros `CONF_PLATFORM_WINDOWS` instead `CONF_FAMILY_WINDOWS`(windows seems to be the only one in detect.h that splits platform between 32bit and 64bit, maybe we should change that)

maybe this fixes #4351, because actually the workaround for windows was exactly inside the wrong macro to fix resizing in fullscreen.

I also split the resize functions, so its less confusing Resize (actively resize in the resolution list) vs GotResized (reported by SDL) and made some things a bit clearer

## 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>
2022-01-15 16:17:15 +00:00
Jupeyy 69202fdc22 Fix windows macro and split the resize events 2022-01-15 16:55:32 +01:00
bors[bot] 2d48cf7dcb
Merge #4573
4573: Implemented live freeze (tiles LFREEZE and LUNFREEZE) r=def- a=GiuCcc

Implemented live freeze.
Live frozen tees cannot move or jump, but they can use hook and weapons.
Live freeze permit the reverse-hammerfly: above tee is live frozen, so it can only hook, not drive. Lower tee has to hammer and drive.

It's implemented adding a new flag: CHARACTERFLAG_NO_MOVEMENTS.
Two tiles are 144 (LFREEZE) and 145 (LUNFREEZE) must be added as entities <--- MISSING ARTWORK HERE
Backcompatibily in-game has been tested, but missing cosmetic on old client: live frozen tee should have smoke too.
I've not tested the back-compatibility about save or rescue.

Added popup gametile in editor: live freeze and live unfreeze.
Added fix in editor explanation: classic TILE_FREEZE and TILE_UNFREEZE can be placed in switch layer too.

TODO:
Missing entities artwork for Tile 144 (LFREEZE) and 145 (LUNFREEZE)

## Checklist

- [x] Tested the change ingame
- [x] 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: Wohoo <giu.casuccio@gmail.com>
2022-01-15 10:27:04 +00:00
bors[bot] e316cfdf75
Merge #4598
4598: Fix console line y offsets when resizing r=def- a=Jupeyy

Hopefully fixes #4319
I can only imagine it happening bcs of resizing

## Checklist

- [x] Tested the change ingame (only tested with resizing)
- [ ] 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>
2022-01-14 22:17:33 +00:00
Jupeyy 956afed264 Fix console line bug when resizing 2022-01-14 22:36:41 +01:00
Robert Müller 4dbd8b454d Fix OOB access in CSnapshotDelta::UnpackDelta, cleanup 2022-01-14 19:10:43 +01:00
bors[bot] ccdb758479
Merge #4592
4592: Fix crash in macOS when moving screen (fixes #4435) r=Jupeyy a=def-

Thanks to Jupeyy for the suggestion

Normally it crashes after a few seconds, tried moving window around, resizing, moving between screens like crazy and no crashes after 1-2 min.

## 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: Dennis Felsing <dennis@felsin9.de>
2022-01-13 14:50:12 +00:00
bors[bot] 53b652f16f
Merge #4582
4582: Revert "Disable gfx_asyncrender_old on macOS (fixes #4435)" r=Jupeyy a=def-

Doesn't help fully against the crashes, just makes them a bit less
likely. Causes VSync to have even more delay. Should find an alternative
(real) fix.

This reverts commit 7d8a142768.

<!-- 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>
2022-01-13 14:33:32 +00:00
Dennis Felsing 52e03c765d Fix crash in macOS when moving screen (fixes #4435)
Thanks to Jupeyy for the suggestion
2022-01-13 15:33:10 +01:00