5235: Enable less controversial cppcoreguidelines clang-tidy checks 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>
5236: Don't enable colors when stdout is redirected to a file (fixes#5233) 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: Dennis Felsing <dennis@felsin9.de>
5183: render allways the nameplate of a specchar (or the real player) r=def- a=C0D3D3V
fokkonaut uses spec chars in addition to normal players in his mod, so the names should also be displayed in addition to the player 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
- [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>
5245: disable dragger beams soon, not only every 150ms r=def- a=C0D3D3V
The check whether a dragger is active, I somehow forgot in the dragger beams. Sorry! Actually, I should have noticed this during testing. But when I tested Fall into the Future today, it seemed strange to me (already at the first part). I should have noticed it when I tested it. I have compared that in any case with 15.9.1 and looked at the code again and saw that there the check is made every tick.
## 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>
5244: Remove predicted character from gameworld before calling base class d… r=Jupeyy a=trml
…estructor
cc #5241
I believe this fixes#5238. Edit: Seems to fix#5239 as well (no longer crashes in OnPredict while being in a map and zooming in/out).
After looking at the code I think it could need a larger cleanup (and Im not 100% happy with this solution), so I plan to look more into this and the related code afterwards.
## 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: trml <trml@users.noreply.github.com>
5231: Fix windows crash r=def- a=C0D3D3V
Fixes#5226
I tested it in a Windows VM.
`@sjrc6` is it correct that `TempCore` is this way zero initialized, can you check that maybe in the debugger? I do not want to change the behaviour, even tho the core is read in two lines later with `TempCore.ReadCharacter(pCharacter);`
## 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>
5006: Add integration test script and coverage map r=heinrich5991 a=ChillerDragon
The ``scripts/integration_test.sh`` runs two clients and one server. Lets the two clients connect for a few seconds.
The goal is to get some automated runtime tests. Even tho the the two clients do not move they will touch a few gametiles by falling through them. This covers a few basic game mechanics like: freeze, draggers, bullets, solo, shields, tele, speedup, collision, player collision and map finishes.
This pr adds a new directory ``test/`` at the root of the repository. Holding a test map. (not sure if thats cool 🤷 )
The script can be run locally using ``scripts/integration_test.sh [build directory]`` using ``build`` as a default. It will catch client/server crashes and check if sqlite ranks are inserted. If built with asan/ubsan it will catch these errors too. Probably not too useful for local testing since it most likely will not cover the currently developed features.
In the CI it will use a ASan + UBSan build directory and thus catch all basic issues caused by simple client server interaction.
![image](https://user-images.githubusercontent.com/20344300/163870637-acc5b16d-042b-407a-b223-febcd2565c97.png)
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
5219: macOS fixes r=heinrich5991 a=def-
```
ld64.lld: warning: /opt/homebrew/opt/freetype/lib/libfreetype.6.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/opt/freetype/lib/libfreetype.6.dylib
ld64.lld: warning: /usr/local/lib/libGLEW.2.2.0.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /usr/local/lib/libGLEW.2.2.0.dylib
ld64.lld: warning: /opt/homebrew/Cellar/wavpack/5.4.0/lib/libwavpack.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/wavpack/5.4.0/lib/libwavpack.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavformat.59.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavformat.59.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavcodec.59.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavcodec.59.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavutil.57.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavutil.57.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswscale.6.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswscale.6.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswresample.4.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswresample.4.dylib
ld64.lld: warning: /opt/homebrew/Cellar/opusfile/0.12/lib/libopusfile.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/opusfile/0.12/lib/libopusfile.dylib
ld64.lld: warning: /opt/homebrew/Cellar/opus/1.3.1/lib/libopus.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/opus/1.3.1/lib/libopus.dylib
ld64.lld: warning: /opt/homebrew/Cellar/libogg/1.3.5/lib/libogg.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/libogg/1.3.5/lib/libogg.dylib
ld64.lld: error: undefined symbol: ___glewBindSampler
>>> referenced by CMakeFiles/DDNet.dir/src/engine/client/backend/opengl/backend_opengl.cpp.o
ld64.lld: error: undefined symbol: ___glewBindSampler
>>> referenced by CMakeFiles/DDNet.dir/src/engine/client/backend/opengl/backend_opengl.cpp.o
[...]
```
<!-- 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>
ld64.lld: warning: /opt/homebrew/opt/freetype/lib/libfreetype.6.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/opt/freetype/lib/libfreetype.6.dylib
ld64.lld: warning: /usr/local/lib/libGLEW.2.2.0.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /usr/local/lib/libGLEW.2.2.0.dylib
ld64.lld: warning: /opt/homebrew/Cellar/wavpack/5.4.0/lib/libwavpack.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/wavpack/5.4.0/lib/libwavpack.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavformat.59.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavformat.59.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavcodec.59.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavcodec.59.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavutil.57.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libavutil.57.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswscale.6.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswscale.6.dylib
ld64.lld: warning: /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswresample.4.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/ffmpeg/5.0.1/lib/libswresample.4.dylib
ld64.lld: warning: /opt/homebrew/Cellar/opusfile/0.12/lib/libopusfile.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/opusfile/0.12/lib/libopusfile.dylib
ld64.lld: warning: /opt/homebrew/Cellar/opus/1.3.1/lib/libopus.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/opus/1.3.1/lib/libopus.dylib
ld64.lld: warning: /opt/homebrew/Cellar/libogg/1.3.5/lib/libogg.dylib has version 12.0.0, which is newer than target minimum of 11.0.0
ld64.lld: error: LC_DYLD_INFO_ONLY not found in /opt/homebrew/Cellar/libogg/1.3.5/lib/libogg.dylib
ld64.lld: error: undefined symbol: ___glewBindSampler
>>> referenced by CMakeFiles/DDNet.dir/src/engine/client/backend/opengl/backend_opengl.cpp.o
ld64.lld: error: undefined symbol: ___glewBindSampler
>>> referenced by CMakeFiles/DDNet.dir/src/engine/client/backend/opengl/backend_opengl.cpp.o
[...]
5225: Only record swap in teehistorian if active r=heinrich5991 a=Zwelf
Fixes#5215
## 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
- [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>
5222: Fix crash because of hooks on non ddnet server r=def- a=C0D3D3V
Reported by `@Ясно` Понятно
on non ddnet server, this code gets run to detect strong-weak ids:
6a5673aa04/src/game/client/gameclient.cpp (L2540-L2541)
which causes a crash because this CCharacterCore is not bound to a gameworld
the check for m_pWorld failed because m_pWorld is fill of random data
ac15943e85/src/game/gamecore.cpp (L625)
So I would also like to initialize it with a nullpointer
## 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>
5218: do not snap dragger beam, if the target is out of reach r=def- a=C0D3D3V
fixes#5216
## 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>
5194: Revert Ellipsis (alternative to #5193) 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>
5214: Use CMAKE_PROJECT_NAME instead of hardcoding ddnet r=def- a=ChillerDragon
Output for ddnet is the same. But now it is easier and less conflicting for downstream projects to do rebranding.
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>