4464: Skip the UTF-8 BOM on all read text files r=def- a=heinrich5991
Fixes#4462.
## Checklist
- [ ] 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
- [ ] 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>
4443: Swap projectile owners when using /swap r=Learath2 a=def-
Thanks to Soapy Sandwich for responsibly disclosing this issue.
https://user-images.githubusercontent.com/2335377/145693247-c5c1ab2e-6353-4a4a-afab-c73f2d7eebc1.mp4
/swap is currently disabled until this is merged.
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [x] Tested the change ingame
- [x] 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: def <dennis@felsin9.de>
4456: Pull some more refactoring from the upstream r=def- a=Kaffeine
The main motivation is making it easier to take (and push) patches to/from `teeworlds`
## 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)
I'm not that familiar with the code. Please let me know if this commit make sense or not:
56900d7644
IIUC two other commits from https://github.com/teeworlds/teeworlds/pull/2594 are not relevant for DDNet (because we're reducing the CPU load differently).
Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
Co-authored-by: Robert Müller <robert.mueller@student.uni-siegen.de>
4450: Add code formatting instructions 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: def <dennis@felsin9.de>
4454: Don't clear client version on map change r=def- a=heinrich5991
Also still record client version on map changes into teehistorian.
Fixes#4445.
Thanks to `@Kaffeine` for noticing.
## 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>
4448: Increase scrollbar handle size for small scrollbars r=def- a=Robyt3
The maximum scrollbar handle size was too small for small scrollbars.
AFAIK, the previous size did not directly affect ddnet client, as there are no scrollbars that small, but they might be used eventually.
See screenshots in https://github.com/teeworlds/teeworlds/pull/2995.
## 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: Robert Müller <robert.mueller@uni-siegen.de>
Since CDraggers are also stores as entities of ENTTYPE_LASER:
/media/ddnet/src/game/server/teams.cpp:898:23: runtime error: downcast of address 0x61600003db80 which does not point to an object of type 'CLaser'
0x61600003db80: note: object is of type 'CDragger'
00 00 00 00 d0 24 3c b2 75 55 00 00 00 00 00 00 00 00 00 00 80 d8 03 00 60 61 00 00 f8 c1 04 5a
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'CDragger'
4427: Update Persian translations (by younesdevil) r=def- 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)
4432: Update Ukrainian translation (by SwiatoslaW) r=def- 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>
4405: Try to use unique_ptr in tests so we can't forget to delete r=heinrich5991 a=def-
Why is the PingCache test failing now???
<!-- 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>
4433: Adopt vanilla scrollbar colors and sizes, minor code style changes r=def- a=Robyt3
Adopt the vanilla color scheme for scrollbars, making the rails white instead of black for increased visibility.
Fix the calculation of the handle size, so it is consistent with vanilla, making the handles slightly smaller compared to before.
Minor refactoring / style changes.
## Screenshots (before, after)
![screenshot_2021-12-09_22-52-20](https://user-images.githubusercontent.com/23437060/145482944-2ddc1b1e-f99c-4a17-bd50-6d0d76949c2e.png)
![screenshot_2021-12-09_22-54-59](https://user-images.githubusercontent.com/23437060/145482958-67c379df-d82d-493f-92df-757a4ac78a5e.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: Robert Müller <robert.mueller@uni-siegen.de>
4431: Fix UUID for demo playback, add a conf var to toggle console colors r=def- a=Kaffeine
<!-- What is the motivation for the changes of this pull request -->
I added an extended kill message info (with killer assistant and mod-specific weapon id) and found a few bugs/mistakes in the current UUID implementation.
1. CUuidManager::RegisterName() mostly ignores the `ID` argument (totally ignored before https://github.com/ddnet/ddnet/pull/3053). Namely: it [add](a39af83a42/src/engine/shared/uuid_manager.cpp (L110)) the names into m_aNames. But then in order to pack them, the manager uses [GetUuid](a39af83a42/src/engine/shared/uuid_manager.cpp (L162)) which [picks](a39af83a42/src/engine/shared/uuid_manager.cpp (L120)) the uuid at [ID - OFFSET_UUID;](a39af83a42/src/engine/shared/uuid_manager.cpp (L94)). Sum up: if we have 10 registered UUIDs, then call `RegisterName(65536 + 123, "myname")` results in adding the name as m_aNames[11]. Later on, `GetUuid(123)` 'll pick `m_aNames[123]` and either cause a segfault or get invalid data. Why this does not affect the current production code? This works because the order of registration coincides with the registration ID and we have no sparse. If we'll swap `RegisterTeehistorianUuids()` and `RegisterGameUuids()` then the server 'll send corrupted packets.
2. Demo playback with UUID messages literally ignores them. This part is obvious, and the same is the patch. I can confirm that it works and fixes the issue.
The work to fix `#1` is not justified to me; I've already spent many hours on this. Now I fixed the registration order in my code instead and I'm done for this time.
Keep in mind that this might hurt DDNet later. Or not.
I've also added an option to disable colors in the debug output because it makes the text unreadable in my IDE:
![image](https://user-images.githubusercontent.com/374839/145075621-c2b96c94-aa36-4f59-bd5c-2b1df940366e.png)
## 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: Alexander Akulich <akulichalexander@gmail.com>
4428: Don't shutdown server when there are outstanding sql queries to be executed r=def- a=Zwelf
Quick fix to loose less ranks. Further fixes incoming, but I've split this out, because it is easy to review and already helpful on its own. For #4424
## 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>
4417: Hopefully fix execution on Mac by fixing link to SDL r=heinrich5991 a=def-
As reported by zou'
<img width="1319" alt="Bildschirmfoto_2021-12-03_um_22 58 32" src="https://user-images.githubusercontent.com/2335377/144679842-1889585f-0137-4645-b4eb-3ad5eb5aebea.png">
<!-- 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>
4426: Update readme (fixes#4425) r=heinrich5991 a=def-
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
4421: Swap: Don't spam-protect retrying with local messages only r=heinrich5991 a=def-
As suggested by 冷落:
> I have a advice./swap need wait 30s,and often someone will say /swap
> within 30 seconds,but kept saying it would be muted
<!-- 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)
4423: Fix command line arguments with unicode on windows (without changing existing code) r=heinrich5991 a=Robyt3
#4380 plus the proposed changes. Closes#4369.
## 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: def <dennis@felsin9.de>
Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
4419: osx -> macos r=heinrich5991 a=def-
<!-- What is the motivation for the changes of this pull request -->
## Checklist
- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)
Co-authored-by: def <dennis@felsin9.de>
4416: Various UI/input refactoring r=def- a=Robyt3
Move duplicate `DoClearableEditBox` from menus and editor to `CUIEx`.
Various minor refactoring.
## 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>