3683: More colors from components in console r=heinrich5991 a=Jupeyy
![screenshot_2021-03-08_01-18-23](https://user-images.githubusercontent.com/6654924/110260454-9d97b600-7fac-11eb-9437-e5b31c9146ab.png)
dunno how to trigger that echo chat, but rest looks fine i think
## 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
- [ ] 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)
3684: Increase max ban duration from 1 month to 1 year r=heinrich5991 a=def-
to show ban message more accurately when player gets globally banned
<!-- 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>
Co-authored-by: def <dennis@felsin9.de>
3687: Free Client.m_PersistentData r=heinrich5991 a=def-
Caused by https://github.com/ddnet/ddnet/pull/3605
Found by ASAN:
```
==11628==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 64 object(s) allocated from:
#0 0x4f36b3 in __interceptor_malloc (/home/teeworlds/servers/DDNet-Server-asan+0x4f36b3)
#1 0x5536a7 in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2362:31
#2 0x562408 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3594:21
#3 0x7f6ee56d209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
```
<!-- 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>
Caused by https://github.com/ddnet/ddnet/pull/3605
Found by ASAN:
==11628==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 64 byte(s) in 64 object(s) allocated from:
#0 0x4f36b3 in __interceptor_malloc (/home/teeworlds/servers/DDNet-Server-asan+0x4f36b3)
#1 0x5536a7 in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2362:31
#2 0x562408 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3594:21
#3 0x7f6ee56d209a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
3669: Local ranking info viewable in-game r=def- a=houseme-kyle
The feature is based on the issue below:
https://github.com/ddnet/ddnet/issues/3655
The main concern was the impact it would have if we had to double our ranking/point commands to support it. I took the feedback into account and combined the info into one command. The PR is in draft as I don't want to implement it for the remaining commands before getting thoughts on the approach taken.
**Feature**
Display local stats alongside global while using the same commands
**Implementation**
- /rank, /top5 etc to display their local position alongside global.
- Top 5 changed to top 3 due to space limitations
- Message limit increased by 1
- Don't show "requested by" when the request was made by the same individual
**Reason for feature**
- Foster growth in the smaller communities as they compete amongst each other in their own leaderboard
- The names become more relevant to all communities as they can better relate to the names displayed
**TODO**
~- Tested with production sqlite data but not MySQL storage~
~- Expand concept to other relevant ranking commands~
(Example of NovaShock who is the top player in South Africa)
![image](https://user-images.githubusercontent.com/25198124/109824890-f03a4080-7c41-11eb-84dc-ad319cb98f1e.png)
![image](https://user-images.githubusercontent.com/25198124/109824910-f6302180-7c41-11eb-9013-f3254c08f068.png)
## 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
- [ ] 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: houseme-kyle <kyle@houseme.co.za>
Co-authored-by: Kyle Bradley <kyle@house.me>
Co-authored-by: = <=>
3680: Fix legacy serverinfo with reserved slots and num_players > 15 (fixes#3678) 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>
3662: Don't allocate the windows console default r=def- a=Jupeyy
fixes#3661
## 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>
3664: Add initial delay to talking in chat r=heinrich5991 a=Learath2
<!-- What is the motivation for the changes of this pull request -->
This adds a delay before one can chat. It should help mods in situations where people are spamming chat
## 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: Learath2 <learath2@gmail.com>
3665: Add a way to block people from chatting on vpns r=def- a=Learath2
<!-- What is the motivation for the changes of this pull request -->
Another tool that should help moderators
## 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: Learath2 <learath2@gmail.com>
3658: Fix /mapinfo displaying a time when not having finished r=def- a=heinrich5991
The C API doesn't return 0.0f for NULL values, check for them
explicitly.
Fixes#3653.
<!-- 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>
Pull request #3630 started showing the countries where ranks are from,
but created a mismatch between the two queries, one selected
Time, Ago, Stamp
the other
Time, Ago, Stamp, Name, Server
but both tried accessing the server. Add Server to the former query and
swap Name and Server in the second query to fix the problem.
Fixes#3643.
3568: Get rid of the MySQL C++ connector as a dependency and disable C++ exceptions r=Learath2 a=heinrich5991
We now use the C API directly. This has the advantage of using one
obscure dependency less, as the C++ connector also used the C API.
Also remove exceptions from database code.
The equivalent code with return codes is a human-assisted mechanical
translation of the old code, no attempts to improve correctness were
made.
This allows us to enable the -fno-exceptions flag.
## 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
- [ ] 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>
The equivalent code with return codes is a human-assisted mechanical
translation of the old code, no attempts to improve correctness were
made.
This allows us to enable the -fno-exceptions flag.