Commit graph

3700 commits

Author SHA1 Message Date
heinrich5991 47c803f3fb Remove server info backward compatibility that is no longer needed
Goes all the way back to 04eddacd65 in
2008, pre 0.5.0.
2021-05-14 01:01:09 +02:00
heinrich5991 bd4e0f7fd8 Try parsing the server list before considering a masterserver 2021-05-14 01:01:08 +02:00
heinrich5991 afe6ab87e2 Also sort HTTP server info by score/name 2021-05-14 01:01:08 +02:00
heinrich5991 ee42faac1f Determine one's own location automatically, but provide override
Automatically determine the approximate location of the client by
including that info in the already fetched https://info2.ddnet.tw/info.
Can be overridden using the the config variable `br_location`.
2021-05-14 01:01:08 +02:00
heinrich5991 9eca91de74 Special case China as its own continent for ping estimation
It has an exceptionally bad connection to the outside due to the Great
Firewall of China:
https://en.wikipedia.org/w/index.php?title=Great_Firewall&oldid=1019589632
2021-05-14 01:01:08 +02:00
heinrich5991 acbaa87835 Use in-band ping for determining latency, if supported
Still fall back to server info requests for pinging.
2021-05-14 01:01:08 +02:00
heinrich5991 5ae0c3f3a0 Fix server capabilities only working after disconnect 2021-05-14 01:01:08 +02:00
heinrich5991 6567743546 Add PINGEX and PONGEX messages that are correlatable
The current NETMSG_PING and NETMSG_PING_REPLY messages suffer from the
fact that you cannot know whether a given NETMSG_PING_REPLY is from your
NETMSG_PING.
2021-05-14 01:01:08 +02:00
heinrich5991 a0df2bdf9c Measure the ping to the current server occasionally
This is done using the serverbrowser extended GETINFO packet. It's done
when the client enters the game and every ten minutes afterwards.
2021-05-14 01:01:08 +02:00
heinrich5991 ed561c3602 Add a command to ping all servers
Name it in a way to make clear what information it leaks to anyone who
wants to listen.
2021-05-14 01:01:07 +02:00
heinrich5991 bce7a4f84e Add serverbrowser ping cache 2021-05-14 01:00:41 +02:00
heinrich5991 355c6fccd3 Add sqlite3 to the client 2021-05-14 01:00:41 +02:00
heinrich5991 4301ffab58 Give tests their own playground IStorage
Also add a function to clean it up after the test.
2021-05-14 01:00:41 +02:00
heinrich5991 436e202cbd Add client-side HTTP server info
Summary
=======

The idea of this is that clients will not have to ping each server for
server infos which takes long, leaks the client's IP address even to
servers the user does not join and is a DoS vector of the game servers
for attackers.

For the Internet, DDNet and KoG tab, the server list is entirely fetched
from the master server, filtering out servers that don't belong into the
list.

The favorites tab is also supposed to work that way, except for servers
that are marked as "also ping this server if it's not in the master
server list".

The LAN tab continues to broadcast the server info packet to find
servers in the LAN.

How does it work?
=================

The client ships with a list of master server list URLs. On first start,
the client checks which of these work and selects the fastest one.
Querying the server list is a HTTP GET request on that URL. The
response is a JSON document that contains server infos, server addresses
as URLs and an approximate location.

It can also contain a legacy server list which is a list of bare IP
addresses similar to the functionality the old master servers provided
via UDP. This allows us to backtrack on the larger update if it won't
work out.

Lost functionality
==================

(also known as user-visible changes)

Since the client doesn't ping each server in the list anymore, it has no
way of knowing its latency to the servers.

This is alleviated a bit by providing an approximate location for each
server (continent) so the client only has to know its own location for
approximating pings.
2021-05-14 01:00:39 +02:00
heinrich5991 11adc8c1ff Make it possible to run jobs in the current thread 2021-05-13 03:15:18 +02:00
bors[bot] 22ef342ffc
Merge #3825
3825: Add sv_swap r=heinrich5991 a=def-

Because swap is broken and the current way of disabling is horrible.

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-05-11 20:05:47 +00:00
def 6a348c8f60 Add sv_swap
Because swap is broken and the current way of disabling is horrible.
2021-05-11 17:05:17 +02:00
bors[bot] e7787bf58d
Merge #3823
3823: Add hookcollision color changeable r=heinrich5991 a=Jupeyy

![t](https://cdn.discordapp.com/attachments/293493549758939136/841549439742378034/unknown.png)

in HUD

## Checklist

- [ ] 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>
2021-05-11 14:39:42 +00:00
Jupeyy f8b15e0412 Add hookcollision color changeable 2021-05-11 14:34:53 +02:00
bors[bot] 5d0e820af4
Merge #3814
3814: Fix x11 notify by Maiski r=def- a=Jupeyy

This works on KDE without problems, he also tested on i3

## 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>
2021-05-07 21:33:46 +00:00
Arda Demir 500670cfba Rename gfx_display_all_modes to gfx_display_all_video_modes 2021-05-07 12:56:50 +03:00
bors[bot] 1d0253aa67
Merge #3811
3811: Add Intel as vendor to the block list on windows r=def- a=Jupeyy

I also added, that the warning doesnt require to be displayed, as it currently won't help anyway to update the driver.

Should set all Intel users to OGL 2.0 default, they can ofc still manually change the setting as they want

## 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>
2021-05-07 07:52:57 +00:00
bors[bot] 23b8ad5cc2
Merge #3812
3812: Make init/shutdown when GL processor creation fails safer r=def- a=Jupeyy

Especially with GL 3.3, which has a shutdown command implemented, it should only get called, if it actually created the the backend stuff.

## 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>
2021-05-07 07:43:27 +00:00
Freddie Wang 08ecb91622 detect display changes and clamp the resolution 2021-05-07 12:00:32 +08:00
Jupeyy 99e460deb7 Fix x11 notify by Maiski 2021-05-07 02:07:37 +02:00
Freddie Wang 24ccffb005 calculate canvas size instead of window size 2021-05-06 22:29:49 +08:00
Jupeyy fbbfbf7890 don't initialize opengl stuff, if not required 2021-05-06 13:39:17 +02:00
Freddie Wang 2f008d04d3 dpi-aware resolution list 2021-05-06 18:59:30 +08:00
Jupeyy 9104c19a1a remove dublicate code 2021-05-06 12:48:46 +02:00
def 427c01294a av_init_packet is deprecated, use av_packet_alloc instead 2021-05-06 12:25:12 +02:00
Jupeyy 899c30406d Add Intel as vendor to the block list on windows 2021-05-06 12:23:40 +02:00
bors[bot] 97ab2c6c01
Merge #3798
3798: Add GLES support r=def- a=Jupeyy

I know i *****ed up, that i didnt move the files in a different commit, but when i noticed it was already too late.
Its mostly disabling stuff that GLES doesn't support. Global LOD bias or glOrtho for examlpe.

~***Strong note***:
This will move ALL linux implementation to GLES instead of GL, since GLES is supported by X11 and wayland, we probably want some testing for this.
This also means, that the default for Linux gets GLES 3.0 which is equivalent to OpenGL 3.3, not OpenGL 3.0!!!~

~If you wonder "why":
Gles just works differently to OGL, it knows about all functions that exists, and e.g. doesn't require GLEW at all, but that also means, that GLES does NOT work while we use OGL, because GLEW would kill GLES.~
GLEW in EGL mode works fine with wayland, just requires X11 to use EGL too(SDL_VIDEO_X11_FORCE_EGL)

_Additionally, for GLES only, only 3.0 and 1.0 context are supported._(doesn't matter anymore for linux)

probably fixes:
~not_really_fixes  #3797~
fixes #2885

And would also allow android support, if i ever get these build scripts upto date, or smby is interested into fixing them for me :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
- [ ] 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>
2021-05-06 09:50:26 +00:00
Dennis Felsing 6bd41d5dd2
Support ipv6
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-05-05 17:32:37 +02:00
def 6a6ba69189 Steam: Support connecting to hostname
instead of just ip address, untested
2021-05-05 16:10:30 +02:00
Jupeyy 8be6f1791c Make video's pixel read GLES conform 2021-05-03 23:02:45 +02:00
Patiga ec53b8742e Fix duplicate uuid index in maps edited by tools 2021-05-03 12:02:18 +02:00
Jupeyy 6f01de1193 Fix modern GL graphic settings for the multi backend 2021-05-02 23:21:00 +02:00
Jupeyy fc1b87785f make pixel alignment numerical more robust 2021-05-02 10:35:46 +02:00
Jupeyy b8f96ce500 Allow GLES3 coexists with OpenGL on Linux 2021-05-02 04:39:02 +02:00
Jupeyy e05abbaa91 Remove GL includes from headers 2021-05-01 23:56:30 +02:00
Jupeyy ecc5a7af81 Make GLES3 only makros 2021-05-01 21:21:09 +02:00
Jupeyy f5f05f3dcb make screenshot work 2021-05-01 01:39:37 +02:00
Jupeyy c0d6ce6d25 Add GLES support 2021-05-01 01:39:37 +02:00
Freddie Wang 00540deaef initialize CClient::m_HasPersistentData 2021-04-21 15:45:58 +08:00
Panagiotis Vasilopoulos 6c02076c05 Copied Teeworld patches for the Haiku operating system
Co-authored-by: Gerasim Troeglazov <3dEyes@gmail.com>
2021-04-17 20:10:56 +02:00
ChillerDragon 67f4944630 Fix auto reconnect while in game 2021-04-15 12:44:24 +02:00
Jupeyy ec03261aa5 Refactor add command in graphics_threaded class 2021-04-07 19:03:07 +02:00
Jupeyy 8eac8b0afc Only remove windowed fullscreen and restore mouse focus loss behavior 2021-04-02 22:45:49 +02:00
Jupeyy a293470e89 Different screenshot console color(by Ravie) 2021-03-30 11:39:38 +02:00
bors[bot] 73b62cbb1e
Merge #3577
3577: Differenciate better between window modes r=def- a=Jupeyy

Yeah no idea, without dropdown it looks weird xd, so more of an idea:

hopefully fixes #3571 by making it clear what borderless is intended to be(not fullscreen)

![screenshot_2021-01-31_21-55-43](https://user-images.githubusercontent.com/6654924/106397735-213f0f80-640f-11eb-8f0f-3394834209f0.png)

## 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>
2021-03-30 08:10:52 +00:00
Jupeyy f0160b5313 Differenciate better between window modes 2021-03-30 10:07:41 +02:00
def 50d08036e2 Lower save/swap delay 2021-03-28 11:27:51 +02:00
Jupeyy c23f1e51be Print GPU info into console 2021-03-26 11:38:03 +01:00
bors[bot] 23a6c6e206
Merge #3718
3718: No negative count in server browser r=Jupeyy a=def-

With "Count playery only" and "Filter connecting players" both activated

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-03-23 12:59:15 +00:00
bors[bot] 027e1d8b14
Merge #3654
3654: Added swap functionality to server client: r=def- a=houseme-kyle

Added a new chat command /swap based on the discussion in the associated issue: 
https://github.com/ddnet/ddnet/issues/1103

Swaps the character's position with another tee using the existing Save/Load functionality. 

Restrictions:
- Has to be in a team similar to the save/load feature

Possible additions:
- Time penalty

**Disclaimer**
This is my first contribution to the project. I tried my best to apply the correct coding standards and understand the purpose of each class/method. Please do provide feedback if used incorrectly. 

![Initiate Swap](https://user-images.githubusercontent.com/25198124/109426245-46ff0a80-79f5-11eb-935a-2b228a72695e.JPG)
![Pre-Acceptance](https://user-images.githubusercontent.com/25198124/109426249-4bc3be80-79f5-11eb-986a-eea9c6b84334.JPG)
![Post-Swap](https://user-images.githubusercontent.com/25198124/109426251-4e261880-79f5-11eb-80a3-772e23a23013.JPG)

## 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: Kyle Bradley <kyle@house.me>
Co-authored-by: houseme-kyle <kyle@houseme.co.za>
Co-authored-by: def <dennis@felsin9.de>
2021-03-21 09:04:21 +00:00
Kyle Bradley 23c36e637f Reverted test config 2021-03-20 18:09:43 +02:00
Kyle Bradley decaeb8934 PR feedback:
- Changed names of variables
- Changed config descriptions
- Fix for perma timeout
2021-03-20 18:08:54 +02:00
def ae34e2df6f Banned for life -> Banned
Since we mostly use them for limited global bans
2021-03-19 15:02:28 +01:00
def ac6ae40806 No negative count in server browser
With "Count playery only" and "Filter connecting players" both activated
2021-03-19 11:46:02 +01:00
houseme-kyle e11345807f
Merge pull request #5 from ddnet/master
Merge
2021-03-17 19:07:18 +02:00
Arda Demir 2aefdf2a5e Add dummy_reset and remove +resetdummy 2021-03-17 18:09:39 +03:00
Kyle Bradley 4afe62a596 Updated to include penalty, cooldown and timeout 2021-03-17 00:31:16 +02:00
bors[bot] 46864c0e08
Merge #3683 #3684
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>
2021-03-09 21:41:23 +00:00
def 5261764fb0 Free Client.m_PersistentData
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)
2021-03-09 11:44:20 +01:00
Jupeyy af2e19c4e7 Add color for non chat(binds, ghost, client, demo) 2021-03-08 18:39:25 +01:00
def 271ab5f9de Increase max ban duration from 1 month to 1 year
to show ban message more accurately when player gets globally banned
2021-03-08 18:15:00 +01:00
Jupeyy 853e00ed15 More colors from chat in console 2021-03-08 01:20:28 +01:00
bors[bot] 75e9b20e45
Merge #3680
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>
2021-03-07 23:49:17 +00:00
def b1ed91b835 Fix legacy serverinfo with reserved slots and num_players > 15 (fixes #3678) 2021-03-07 23:11:09 +01:00
heinrich5991 d6097cb64c Automatically use HTTPS compression if the server supports it
Our typical HTTPS answer is reduced by 85% by this. Our JSON seems to
compress really well.
2021-03-07 22:41:34 +01:00
def e5bcac3ca2 std::max -> maximum 2021-03-07 11:14:37 +01:00
bors[bot] f78bbb5864
Merge #3662
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>
2021-03-02 08:03:25 +00:00
bors[bot] 8e4e4940d2
Merge #3664
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>
2021-03-01 20:10:14 +00:00
Learath2 f1af68dff9 Add initial delay to talking in chat 2021-03-01 20:37:07 +01:00
Learath2 5f50d1dc57 Add a way to block people from chatting on vpns 2021-03-01 19:54:59 +01:00
Jupeyy c20b9801d4 Don't allocate the windows console default 2021-03-01 15:25:45 +01:00
heinrich5991 d7f0de3f29 Use ExecuteUpdate instead of Step for INSERT INTO
Forgot an instance of this in mysql.cpp in the previous commit.
2021-02-27 22:34:44 +01:00
bors[bot] 2fb1c723c9
Merge #3568
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>
2021-02-24 16:43:16 +00:00
heinrich5991 9568d1055a 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.
2021-02-24 17:39:48 +01:00
heinrich5991 d37b62e91d Get rid of unused IN_USE status for db connections 2021-02-24 17:39:45 +01:00
heinrich5991 d7019a244e Get rid of the MySQL C++ connector as a dependency
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.
2021-02-24 17:34:08 +01:00
heinrich5991 794d768ccb Bump version for the new protocol to DDNet 15.4
This fixes interoperability with DDNet 15.3 which did in the end not
support the new messages.
2021-02-24 17:09:39 +01:00
bors[bot] 908646eea5
Merge #3605
3605: Adopt some more refactoring from upstream r=heinrich5991 a=Kaffeine

- Backport 'Make spectators stay specs on map changed'
- Adopt upstream refactoring: Mark several functions as 'const'
- CGameContext::SendVoteStatus: Hide the trick for 64 clients
- GameController: Add OnPlayerConnect() like in the upstream
- Move DDRace-specific player initialization code to the Controller. Dependencies:
  - CGameControllerDDRace: Add Score() getter
  - Get rid of gamemode.h with confusing/conflicting definitions (re-defined `GAME_NAME`)
- Replace remaining int64_t by int64 for the sake of consistency

I checked the changes in-game (I ran a server and tested with two players)

## 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>
2021-02-23 18:22:28 +00:00
Alexander Akulich 6b49bf1388 Make spectators stay specs on map changed
Based on PRs to the upstream:
https://github.com/teeworlds/teeworlds/pull/2065
https://github.com/teeworlds/teeworlds/pull/2066

Co-authored-by: Jordy Ruiz <jordy.ruiz@univ-lille.fr>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-02-23 19:36:52 +03:00
Alexander Akulich 2790270abf Adopt upstream refactoring: Mark several functions as 'const' 2021-02-23 18:26:16 +03:00
def 7f9110b67c Remove fifo file on shutdown 2021-02-21 17:31:25 +01:00
bors[bot] a73bf0e9bd
Merge #3606 #3617 #3628 #3631
3606: Remove gfx_show_warnings 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)


3617: Update translations + update Brazilian Portuguese translation (supersedes #3616) r=heinrich5991 a=def-

Thanks to @rffontenelle for the Brazilian Portuguese translation update.

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


3628: Don't toggle Destructive in editor when pressing ctrl-shift-d r=heinrich5991 a=def-

As reported by texnonik 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)


3631: Prevent editor crash when setting image to None r=heinrich5991 a=def-

As reported by Anoian

<!-- 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: Rafael Fontenelle <rafaelff@gnome.org>
2021-02-20 16:46:00 +00:00
Jupeyy 50e6b3c4d8 Update missing file from dilate 2021-02-13 14:04:42 +01:00
def dd3062a61b Use same warning text for both warnings
so we only have to translate it once
2021-02-13 11:30:21 +01:00
bors[bot] e6846827cf
Merge #3614
3614: Mac OS X -> macOS r=heinrich5991 a=def-

Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that

> Apple shortened the name to "OS X" in 2012 and then changed it to "macOS" in 2016

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-02-12 13:49:29 +00:00
def e985632fae OSX -> macOS
Changing the filenames of the releases will be a bit more annoying, so
not sure we want to do that
2021-02-12 13:41:41 +01:00
bors[bot] d37baf9f1a
Merge #3611
3611: Don't try to update .so files on Windows r=Jupeyy a=def-

```
[2021-02-12 10:33:01][storage]: failed to rename: Z:\DDNet-15.2.5-win64/discord_game_sdk.dll -> Z:\DDNet-15.2.5-win64/discord_game_sdk.dll.old
[2021-02-12 10:33:01][storage]: failed to rename: Z:\DDNet-15.2.5-win64/discord_game_sdk.so -> Z:\DDNet-15.2.5-win64/discord_game_sdk.so.old
[2021-02-12 10:33:01][storage]: failed to rename: Z:\DDNet-15.2.5-win64/update/discord_game_sdk.so -> Z:\DDNet-15.2.5-win64/discord_game_sdk.so
[2021-02-12 10:33:01][updater]: replacing DDNet.exe
[2021-02-12 10:33:01][storage]: failed to remove: Z:\DDNet-15.2.5-win64/DDNet.old
[2021-02-12 10:33:01][updater]: replacing DDNet-Server.exe
[2021-02-12 10:33:01][storage]: failed to remove: Z:\DDNet-15.2.5-win64/DDNet-Server.old
```

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-02-12 09:37:43 +00:00
def 3b83a5d9bd Don't try to update .so files on Windows 2021-02-12 10:21:23 +01:00
def 28eb4b15af Remove gfx_show_warnings 2021-02-10 23:02:34 +01:00
Jupeyy 15129ad721 lower alpha threshold 2021-02-03 20:05:02 +01:00
heinrich5991 211b1d9155 Allow to dynamically load the Discord SDK on Linux
Set `-DDISCORD_DYNAMIC=ON` on the CMake command line to enable this
feature.

Fixes #3580.
2021-02-01 12:20:11 +01:00
bors[bot] 2b5723cdef
Merge #3492 #3559 #3561 #3565
3492: Support F-Client and replace non-extended extension messages r=Learath2 a=heinrich5991

This continues what #3439 started, and also replaces non-extended messages that are DDRace extensions with extended messages. The DDNet server still sends the old message to old clients and the DDNet client still understands the old messages.

Supersedes #3439.

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


3559: Don't highlight us if we have no name (alternative fix for #3554) 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
- [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)


3561: Fix input message position in teehistorian files r=heinrich5991 a=Zwelf

Previously the message was recorded when incoming. But the time when the input should apply wasn't recorded. Now inputs are recorded right before they get applied in the game world.

And record exact tick where load/save result is returned.

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


3565: Add Arabic language translation by .Yukki r=heinrich5991 a=def-

![screenshot-20210131@093216](https://user-images.githubusercontent.com/2335377/106378755-747d7780-63a7-11eb-9553-6a1898907441.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
- [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: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Zwelf <zwelf@strct.cc>
2021-01-31 14:37:48 +00:00
def b3c93b091a Use map download url from info2.ddnet.tw (fixes #3546)
which info2.ddnet.tw provides using a geolite db to provide a better
server for players in China
2021-01-31 11:15:16 +01:00
heinrich5991 c2b28f124b Put the Discord stuff into its own file 2021-01-31 10:17:21 +01:00
Edgar 96db08b760 add discord rich presence 2021-01-31 10:17:21 +01:00
def 4bd3525b38 sv_reserved_slots: allow up to 64 2021-01-28 13:57:53 +01:00
heinrich5991 43998ce41a Replace projectile hack with a new extended snapshot object
Still send the old hack to old clients, still accept the old hack from
old servers. This is so F-Client can support DDNet servers without such
hacks.
2021-01-26 20:58:42 +01:00
bors[bot] 14e70506e1
Merge #3535
3535: Fix a possible race in load code  r=def- a=heinrich5991

Previously, a save could possibly be loaded twice given enough latency
discrepancy between servers. The server only verified that it deleted
*some* save with the given password, not *the* save it is trying to
load. This is fixed by also checking the SaveID column that is random
and globally unique (except for the old NULLs). Since users can't create
new saves with NULL SaveID, these pose no problem.

Also change the default UUID for saves without save ID to something
nonzero, so we can't accidentally hit it due to a bug.

## 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: heinrich5991 <heinrich5991@gmail.com>
2021-01-23 10:14:32 +00:00
heinrich5991 3539f2b183 Allow ParseUuid to report errors and add tests 2021-01-23 01:21:20 +01:00
bors[bot] 989d26bfec
Merge #3527
3527: Prevent OpenSSL SIGPIPE (fixes #3513) r=heinrich5991 a=def-

by making libcurl handle the signal itself

See https://curl.se/libcurl/c/CURLOPT_NOSIGNAL.html

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-01-22 17:41:04 +00:00
def 199da2410d Prevent OpenSSL SIGPIPE (fixes #3513)
by ignoring the signal ourselves

See https://curl.se/libcurl/c/CURLOPT_NOSIGNAL.html
2021-01-22 18:28:15 +01:00
bors[bot] 5d927f35b6
Merge #3502
3502: Some (mostly backported) refactor r=Learath2 a=Kaffeine

Port some cleanup and refactoring from the upstream and add some custom refactoring.

Changes overview:
- Backported angle() and direction() functions (upstream commit 7735557aa5)
- Backported vector math cleanup (remove some pointless templates, refactor other functions; upstream commit bdaabc10bc)
- `ddracechat.h` (used by both client and server) moved to a shared dir next to `ddracecommands.h`
- Backport `IGameController::DoActivityCheck()`
- Backport `IGameController::DoTeamChange()`
- Backport `IGameController::OnPlayerDisconnect()`
- Refactor Emote-related code (decouple the code and hide the details in CPlayer class)
- Fix: restore default emote on the emote override ended over.
- CCharacter::HandleTiles(): Move a part of DDRace-specific code to the DDRace GameController
- Add `IGameController::GetMaskForPlayerWorldEvent()` to port classes away from direct `CGameControllerDDRace/CGameTeams` usage.

Result overview:
- CPlayer does not depend on CGameControllerDDRace nor CGameTeams anymore
- CCharacter does not depend on CGameControllerDDRace anymore

I'm not sure that `GetMaskForPlayerWorldEvent()` is a good name for that. The idea of the method is to abstract the users of `CreateExplosion`, `CreatePlayerSpawn`, `CreateDeath`, `CreateSound`, and other world events from thinking about the player team.

I checked that the client and server work (didn't do deep testing though).

## Checklist

- [x] Tested the change ingame
- Provided screenshots if it is a visual change (no visual changes)
- Tested in combination with possibly related configuration options (no related 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: Alexander Akulich <akulichalexander@gmail.com>
Co-authored-by: BeaR <cinaera@web.de>
2021-01-21 10:56:38 +00:00
bors[bot] 29fbaddce4
Merge #3520
3520: Fix median calculation r=Learath2 a=def-

as reported by I.K.U 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: def <dennis@felsin9.de>
2021-01-21 10:05:32 +00:00
def b3062d04a0 Fix median calculation
as reported by I.K.U on Discord
2021-01-21 11:02:01 +01:00
Zwelf cf80ace45a Remove locking from database interface 2021-01-20 21:55:22 +01:00
Zwelf bad2d71d77 Add ExecuteUpdate to database interface reporting affected rows 2021-01-20 21:42:25 +01:00
bors[bot] cdb5a5c280
Merge #3519
3519: Send logout packet after using timeout protection r=def- a=heinrich5991

Only send the logout packet if you're actually logged in.

Fixes #3490. Supersedes #3495.

<!-- 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>
2021-01-17 18:00:00 +00:00
heinrich5991 91b1f62fa0 Send logout packet after using timeout protection
Only send the logout packet if you're actually logged in.

Fixes #3490. Supersedes #3495.
2021-01-17 17:44:48 +01:00
bors[bot] 174eeab80d
Merge #3504
3504: Display median time instead of average (fixes #3399) r=heinrich5991 a=def-

Do we want average too or just median?

## 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: def <dennis@felsin9.de>
2021-01-17 16:40:50 +00:00
bors[bot] 2363efbed5
Merge #3514
3514: Also display DDNet version for 0.7 clients r=def- a=heinrich5991

<!-- 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>
2021-01-17 14:14:07 +00:00
Alexander Akulich 59deb42252 CConfig: Use str_escape in EscapeParam() 2021-01-16 03:20:57 +03:00
heinrich5991 c2ed416f43 Fix clang-style 2021-01-15 23:59:48 +01:00
heinrich5991 b66e090425 Also display DDNet version for 0.7 clients 2021-01-15 22:39:18 +01:00
nobody-mb 46387373d1
show sixup in status (#3512)
* show sixup in status

* format sixup in status

* str_copy
2021-01-15 19:26:40 +01:00
Dennis Felsing c0cbef731b
Merge pull request #3506 from heinrich5991/pr_ddnet_moreprotocolex
Send the NETMSG_ITIS/NETMSG_IDONTKNOW from the correct connection
2021-01-15 15:03:43 +01:00
Edgar 4344f46d1c
only delete it if exists 2021-01-15 12:27:01 +01:00
Edgar 98554be75d
move tmp file deletion before the break 2021-01-15 12:14:14 +01:00
Edgar 066b3a3f78
remove ddnet info tmp file always when quitting 2021-01-15 12:07:16 +01:00
Zwelf 0aed8cf8eb Fix memory leak in SQLite3 print statement
https://www.sqlite.org/c3ref/expanded_sql.html
2021-01-14 19:47:01 +01:00
heinrich5991 802a5439c2 Send the NETMSG_ITIS/NETMSG_IDONTKNOW from the correct connection
Noticed after #3505, thanks @fokkonaut.
2021-01-13 17:15:24 +01:00
fokkonaut 7e169d92e5 Fix dummy not sending DDNet version 2021-01-12 16:57:53 +01:00
def 39d06c5e85 Display median time instead of average (fixes #3399) 2021-01-12 14:24:38 +01:00
heinrich5991 9784726683 Replace remaining non-extended extension messages
Add backward compatibility stuff, but this allows newer clients to only
care for new messages.
2021-01-12 01:48:10 +01:00
heinrich5991 0d916e2ef6 Remove F-Client-specific messages
The PLAYERFLAG_AIM can now be set directly on DDNet servers via the 0.7
bridge and will be sent to clients identifying themselves as DDNet
clients.

Add a new extended message that mirror the old `Sv_TeamsState`.
2021-01-12 01:38:23 +01:00
fokkonaut 9940a806fa Support for F-Client 2021-01-12 01:38:23 +01:00
bors[bot] 40a36c2dfc
Merge #3377 #3487
3377: Add Thread Safety Analysis r=heinrich5991 a=def-

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

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


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

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [ ] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-01-10 15:00:19 +00:00
Alexander Akulich c2f276cee1 Port CConfig API from the upstream (0.7.5)
The old (g_Config) API is kept to not break the stuff.

See commits:
    de5859b371
    78076761eb
2021-01-10 17:10:19 +03:00
Alexander Akulich 09c05ab99f Port CConsole::Init() from the upstream code
Partial port of upstream commit c0bf37fb48
2021-01-10 16:51:18 +03:00
def 2e5a13ec09 Fix client crash with too many items (fixes #3479) 2021-01-06 10:02:39 +01:00
bors[bot] 871fd94531
Merge #3448 #3449
3448: Same default map as in autoexec_server.cfg 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)


3449: Fix x of y servers r=Jupeyy 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>
2020-12-29 15:11:47 +00:00
Jupeyy 288a18fa95 Don't render fully transparent quads 2020-12-29 14:59:17 +01:00
Jupeyy 54d937d88d Fix quad shader 2020-12-29 03:40:35 +01:00
def f1358b537e Same default map as in autoexec_server.cfg 2020-12-27 23:19:28 +01:00
def e592afc98c Add Thread Safety Analysis
and annotate some code: https://clang.llvm.org/docs/ThreadSafetyAnalysis.html
2020-12-23 18:13:21 +01:00
bors[bot] e9b174a00f
Merge #3389
3389: Alternative alternative fix for malloc of size 0 r=def- a=heinrich5991

Has a short diff to the original code before a4f13ed4a8.
Supersedes #3353. Thanks for the idea, @timakro.

<!-- 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>
2020-12-22 11:23:40 +00:00
heinrich5991 bd1c133fa1 Work around clang-analyzer-unix.Malloc false positive 2020-12-22 12:17:50 +01:00
Jupeyy fb74bcbb55 Don't sort on entry adding 2020-12-22 11:30:20 +01:00
def 7260dec878 Don't print name change message when trying to change to banned name
Introduced in https://github.com/ddnet/ddnet/pull/3095/files?w=1
2020-12-19 11:21:15 +01:00
bors[bot] 5fa2e04c97
Merge #3410
3410: Color picker r=def- a=Banana090

Kinda lost track of all the updates this PR contains, so... It's just huge.
For in-game changes it changes HUD settings tab and adds Color Picker UI feature with preview, editboxes on RMB and so on...

https://cdn.discordapp.com/attachments/295908390956433410/787843848810135582/unknown.png

(Github does not want to upload my image here...)

## 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
- [ ] 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: Дядя Женя <spy090@yandex.ru>
Co-authored-by: def <dennis@felsin9.de>
2020-12-18 22:07:56 +00:00
def fc75e95e35 Merge branch 'master' into pr_color_picker 2020-12-18 19:13:51 +01:00
Дядя Женя 095727e8c3 Fixed mouse jumping 2020-12-18 16:50:45 +03:00
bors[bot] c564d788ad
Merge #3402
3402: Move PNG loading in SkinDL to fetch thread (fixes #3398) r=Jupeyy a=def-

Sorry for the trouble, seems to work.

<!-- 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
- [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>
2020-12-15 15:09:44 +00:00
Дядя Женя 9b4dfc142a Merge branch 'master' into pr_color_picker
# Conflicts:
#	src/game/client/components/chat.h
#	src/game/client/components/menus_settings.cpp
2020-12-13 20:40:33 +03:00
Jupeyy cafd1a4e8f Allow windows resizing 2020-12-13 00:52:57 +01:00
def 3c9d1ab804 No need to call png_init every time 2020-12-13 00:08:49 +01:00
def cd00c4c04b Move PNG loading in SkinDL to fetch thread (fixes #3398)
Sorry for the trouble, seems to work.
2020-12-13 00:08:46 +01:00
Zwelf b256250b7b Synchronize database thread via atomic_bool instead of use_count from shared pointer 2020-12-08 18:11:00 +01:00
heinrich5991 e805e42a94 Alternative alternative fix for malloc of size 0
Has a short diff to the original code before a4f13ed4a8.
Supersedes #3353. Thanks for the idea, @timakro.
2020-12-08 12:29:10 +01:00
Jupeyy 7c4f7cd265 Increase Intel driver blocklist range 2020-12-03 16:42:50 +01:00
Edgar 105b049497
Rename lock and semaphore classes to match current naming 2020-11-29 18:12:58 +01:00
Jupeyy c0dbd4a6f5 Fix leak, initialize UI Element Rect 2020-11-25 13:11:34 +01:00
bors[bot] 1883546939
Merge #3201
3201: Map optimizer r=def- a=Jupeyy

Wrote a map optimizer(very aggressive, explain later why).
It reduces map sizes by ~40% (optimized the whole ddnet-maps repo and it was around 40% smaller afterwards)

Test and idea by mind, credits to him

What it does, and why I called it aggressive:

- It removes all unused tiles from embedded images
- It clears transparent pixels and dilates them as 2D array textures, instead of simple 2D textures.
- It uses zlibs best compression

So yeah, it changes the output map(keeps the source file working, output is in "out" dir), its not the same as before, it's a nice tool for optimizing size with a lot of embedded images as a final release, or when using higher resolution textures.

Co-authored-by: jupeyy <jupeyy@am-6036ddb5ef41.intern>
2020-11-21 11:19:29 +00:00
jupeyy 259629db9f Map optimizer 2020-11-21 12:10:20 +01:00
def b70a59d112 Add benchmark command for pts 2020-11-19 16:46:21 +01:00
bors[bot] a74af2523c
Merge #3331
3331: Allow utf8 ban reasons (fixes #3329) r=heinrich5991 a=def-

![screenshot-20201118@143227](https://user-images.githubusercontent.com/2335377/99536634-e9e1ca80-29aa-11eb-92f2-6ee306a8439e.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>
2020-11-18 23:16:55 +00:00
def d99f1b9340 Allow utf8 ban reasons (fixes #3329) 2020-11-18 14:42:12 +01:00
bors[bot] 078247dd3e
Merge #3327
3327: Check skin/sprite images for correctness r=def- a=Jupeyy

I hope this helps with downloading things at wrong resolution again.

Note that this commit is smaller than it seems, bcs of renaming files and moving code to it.
Also this requires new translations.

In the skin database are invalid skins too:

![screenshot_2020-11-18_07-51-02](https://user-images.githubusercontent.com/6654924/99495409-e7637e80-2972-11eb-91ec-f8bb02a80e83.png)
![screenshot_2020-11-18_07-51-05](https://user-images.githubusercontent.com/6654924/99495410-e7fc1500-2972-11eb-94b8-aedc98e8ef67.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: Jupeyy <jupjopjap@gmail.com>
2020-11-18 12:27:47 +00:00
Jupeyy f38e4e133e Unlimited texture names 2020-11-18 12:50:53 +01:00
Jupeyy c989cd67f9 Check skin/sprite images for correctness 2020-11-18 07:59:15 +01:00
def f9be02c411 Version 15.2.1: Quick autoupdate fix 2020-11-17 17:04:21 +01:00
bors[bot] d80d1df0db
Merge #3297 #3305 #3307
3297: Fix memleak in CServer on instant shutdown r=Jupeyy a=def-

```
Direct leak of 566869 byte(s) in 1 object(s) allocated from:
    #0 0x4f28e3 in __interceptor_malloc (/home/teeworlds/servers/DDNet-Server-asan+0x4f28e3)
    #1 0x55b3c9 in CServer::LoadMap(char const*) /home/teeworlds/src/master/src/engine/server/server.cpp:2312:49
    #2 0x55bfdd in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2351:6
    #3 0x56add2 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3553:21
    #4 0x7f54401cd09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
```

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


3305: DemoRecorder: Only remove existing filenames r=Jupeyy a=def-

As noticed by Jupstar

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


3307: Don't crash with debug mode in demo r=Jupeyy a=def-

Since character doesn't exist then. Reported by murpi

Originally introduced in https://github.com/ddnet/ddnet/pull/2578

<!-- 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>
2020-11-13 10:31:20 +00:00
def 8c4beb987c DemoRecorder: Only remove existing filenames
As noticed by Jupstar
2020-11-12 14:53:42 +01:00
bors[bot] 11d5e87047
Merge #3255
3255: Add block list for drivers r=def- a=Jupeyy

Only briefly tested,
- the error message is bad
- the impl basically only works for the intel windows string, so its not really a generalized list

fixes #3234
## 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>
Co-authored-by: def <dennis@felsin9.de>
2020-11-12 07:40:10 +00:00
Zwelf 03179af14d Fix updating points on SQLite3 backend 2020-11-11 20:27:22 +01:00
bors[bot] a12ec3c9a8
Merge #3279
3279: Add a script to check for variable name style violations, fix some variable names r=def- a=heinrich5991

Didn't fix all variable names because there were far too many. Ideas? At least the second commit should probably go in.

## 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>
2020-11-11 17:42:12 +00:00
def 71674b13da Fix memleak in CServer on instant shutdown
Direct leak of 566869 byte(s) in 1 object(s) allocated from:
    #0 0x4f28e3 in __interceptor_malloc (/home/teeworlds/servers/DDNet-Server-asan+0x4f28e3)
    #1 0x55b3c9 in CServer::LoadMap(char const*) /home/teeworlds/src/master/src/engine/server/server.cpp:2312:49
    #2 0x55bfdd in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2351:6
    #3 0x56add2 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3553:21
    #4 0x7f54401cd09a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
2020-11-11 17:24:51 +01:00
Jupeyy a77e3ca842 Remove some "if" checks from shader(check at compile time) & cleanup 2020-11-10 04:39:13 +01:00
bors[bot] b7f9e7a277
Merge #3284 #3289
3284: play command: Only quit when demo exists (fixes #3283) 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)


3289: Fix server browser columns r=heinrich5991 a=Jupeyy

Fixes the wrong text calculation for playercount, ping, etc. as reported in #bugs on discord

## 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: Jupeyy <jupjopjap@gmail.com>
2020-11-09 21:24:52 +00:00
def 225787ea39 Fix invalid server-assigned utf8 names with (1) prefix (fixes #3269) 2020-11-09 18:10:55 +01:00
def e0f7a0d64f play command: Only quit when demo exists (fixes #3283) 2020-11-09 09:10:25 +01:00
Jupeyy a9631bf9cd Fix text color change 2020-11-08 19:43:01 +01:00
heinrich5991 7663641ed2 Fix some variable name's style 2020-11-08 17:15:48 +01:00
bors[bot] 848bbf543d
Merge #3268
3268: Fix ScaleFontSize with too long strings r=Jupeyy a=def-

Thanks to PopCorn181 for report
![screenshot_2020-11-08_00-03-19](https://user-images.githubusercontent.com/2335377/98453118-d1c1ae00-2155-11eb-97cf-cd5a455c00d3.png)

<!-- 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
- [ ] 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
- [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>
2020-11-07 23:07:38 +00:00
def 7c0e2212e2 Fix ScaleFontSize with too long strings
Thanks to PopCorn181 for report
2020-11-08 00:02:35 +01:00
bors[bot] be06146c49
Merge #3252
3252: cl_chat_tee + cl_chat_background => cl_chat_old (fixes #3106) r=Jupeyy a=def-

![screenshot-20201105@131601](https://user-images.githubusercontent.com/2335377/98240075-30760480-1f69-11eb-91ab-4be84ab84aab.png)
![screenshot-20201105@131537](https://user-images.githubusercontent.com/2335377/98240077-310e9b00-1f69-11eb-8454-71d2c6612a2a.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
- [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>
2020-11-07 21:27:19 +00:00
bors[bot] 556f64775e
Merge #3242
3242: Enable most clang-tidy bugprone-*, misc-*, performance-* checks r=Jupeyy a=def-

Fixes #3134

## 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>
2020-11-07 20:15:30 +00:00
Jupeyy 81a11532c5 Track the driver state 2020-11-07 07:01:12 +01:00
def 62e291b4d1 Allow opengl version 2.0 2020-11-06 19:00:23 +01:00
def 3b90f97aa5 Pull out blocklist_driver.cpp and unit test it 2020-11-06 19:00:14 +01:00
def 5c79e9aa80 Less deep nesting in ParseBlocklistDriverVersions 2020-11-06 17:15:47 +01:00
Jupeyy 54946518dc Add block list for drivers 2020-11-05 21:07:14 +01:00
def b03b75146c cl_chat_tee + cl_chat_background => cl_chat_old (fixes #3106) 2020-11-05 13:16:25 +01:00
def 7a9a67c5d7 Enable most clang-tidy misc-* checks 2020-11-05 12:03:14 +01:00
def 312b9d3bd8 Enable clang-tidy performance-* checks 2020-11-05 11:34:20 +01:00
def 5b5cfa7d9e nick name -> nickname 2020-11-05 09:32:14 +01:00
def 809ce102bd NOLINT bugprone-forward-declaration-namespace 2020-11-05 08:25:34 +01:00
def ed27c49eea Fix bugprone-unused-return-value 2020-11-05 08:25:34 +01:00
def bf8ae71b7d Fix and NOLINT bugprone-sizeof-expression 2020-11-05 08:25:34 +01:00
def 5e2776de0d Fix bugprone-misplaced-widening-cast 2020-11-05 08:25:34 +01:00
def ba53c7e20c Add most bugprone checks 2020-11-05 08:25:26 +01:00
def 27625832f7 Fix clang-tidy in text.cpp 2020-11-03 08:30:12 +01:00
def 165857a5a8 Fix variable names manually 2020-11-02 22:40:40 +01:00
def b1f0fd8969 Enable modernize-loop-convert clang-tidy check
and run clang-format afterwards

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2020-11-02 22:40:24 +01:00
bors[bot] 54b970b68b
Merge #3180
3180: Warn new players about name with points (fixes #3178) r=heinrich5991 a=def-

![screenshot-20201023@233252](https://user-images.githubusercontent.com/2335377/97056097-73f36a80-1588-11eb-8a43-dd42e4ef6e7d.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
- [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>
2020-11-02 20:34:49 +00:00
Дядя Женя 638a82b9bb Merge branch 'master' into pr_color_picker 2020-10-30 22:18:47 +03:00
bors[bot] 641d4db676
Merge #3171
3171: Some chat fixes r=def- a=Jupeyy

Very round:
![screenshot_2020-10-22_22-16-56](https://user-images.githubusercontent.com/6654924/96926091-6a4d0280-14b5-11eb-81bf-387019f29562.png)

bit round:
![screenshot_2020-10-22_22-17-33](https://user-images.githubusercontent.com/6654924/96926098-6de08980-14b5-11eb-8086-6b1ffc48bc86.png)

No rounding left:
![screenshot_2020-10-22_22-18-16](https://user-images.githubusercontent.com/6654924/96926111-72a53d80-14b5-11eb-93d3-cb3e4ff8b475.png)

No rounding at all:
![screenshot_2020-10-22_22-18-54](https://user-images.githubusercontent.com/6654924/96926120-76d15b00-14b5-11eb-8ab8-1cb1dfc8c1a8.png)

old chat:
![screenshot_2020-10-22_22-28-43](https://user-images.githubusercontent.com/6654924/96926568-04ad4600-14b6-11eb-92eb-ff3400edc499.png)


Just gave some examples so its easier to see what is nice

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-29 17:04:14 +00:00
Дядя Женя 94e227c8c3 Color picker: Settings UI + Picker Logic, Editboxes left 2020-10-29 03:55:01 +03:00
Zwelf 6eb95c6b96 Fix random_map and random_unfinished_map on SQLite server 2020-10-28 22:36:54 +01:00
Jupeyy 34d597f428 Always render line, if we already are on a new line 2020-10-28 15:57:08 +01:00
Dennis Felsing 23c005144b consistent formatting for dbg_msg
no capital letters, no spaces
2020-10-26 10:04:03 +01:00
bors[bot] b0803b26e0
Merge #3077
3077: UI Elements r=def- a=Jupeyy

Build will fail bcs of clang-format,
i'll update this comment to explain.

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-26 08:37:25 +00:00
bors[bot] b17fb2827c
Merge #3107 #3155
3107: Log close error to console r=Jupeyy a=def-



3155: Add memcheck/asan/ubsan to readme r=Jupeyy a=def-

To be linked from https://github.com/ddnet/ddnet/pull/3133

Co-authored-by: def <dennis@felsin9.de>
2020-10-26 02:42:03 +00:00
TsFreddie cc8fe178b5 Update DoEditBox logic to be the same as chat 2020-10-26 01:44:10 +08:00
TsFreddie f7ac41adeb Fix IME stuck when 0-len TEXTEDITING event is missing. 2020-10-25 23:48:12 +08:00
Jupeyy 13c5e039c9 Some chat fixes 2020-10-25 15:57:21 +01:00
bors[bot] bc5b19b644
Merge #3161
3161: Fix texture create with multi units r=def- a=Jupeyy

~Possibly `fixes` #3104~

Ravie can you test? 
Does not fix the issue.

[only affects gl 3.3]

Still is required, bcs that looks wrong

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-24 06:42:30 +00:00
trml 6fc1316d63 Fix combined player/ping sorting function 2020-10-24 01:17:03 +02:00
def b83b4c8e33 Warn new players about name with points (fixes #3178) 2020-10-23 23:37:49 +02:00
bors[bot] 2ba4d5d6cb
Merge #3136
3136: Fix some asan issues r=Jupeyy a=def-



Co-authored-by: def <dennis@felsin9.de>
2020-10-22 15:26:41 +00:00
bors[bot] 9832829633
Merge #3157
3157: Show option to disable system messages in settings r=Jupeyy a=def-

## Summary

Makes it a bit easier to find, prefer it on a busy server. Also clarified the friend message toggle is for highlighting only.

![screenshot-20201020@182835](https://user-images.githubusercontent.com/2335377/96615964-41d0d700-1302-11eb-910e-4c56f0c8451c.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 [does not apply]
- [x] Written a unit test if it works standalone, system.c especially [does not apply]
- [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>
2020-10-22 15:19:31 +00:00
Jupeyy dec7fd25fb Fix texture create with multi units 2020-10-21 00:57:20 +02:00
bors[bot] b014d6199c
Merge #3160
3160: Make gfx_quad_as_triangle 0 default r=def- a=Jupeyy

fixes #3097
I added a TrianglesBeing/End() instead for ingame quads
Let me quickly explain why #177 failed.

In the screenshots of #177 you already see the problem

the driver can built a quad like:
![image](https://user-images.githubusercontent.com/6654924/96621122-86f80780-1308-11eb-881a-eb51bdbe558c.png)

or like:

![image](https://user-images.githubusercontent.com/6654924/96621195-a131e580-1308-11eb-91c4-cc4cab96bdfd.png)

or somehow it wants, but it will always do them as triangles

And thats why the ingame quads were basically flipped in the screenshots of #177

But this almost never matters.
Tiles are single colored, text is single colored, ui elements are single colored.
So it only matters for ingame quads probably, which specify the color of each edge

Also even if it would matter, we can simply change the quads to triangles now.

Pro:
- Generally less vertices upload
- Less vertices building on CPU side

Cons:
- nothing



Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-20 20:53:54 +00:00
Jupeyy 6eacccfba6 Make gfx_quad_as_triangle 0 default 2020-10-20 19:11:19 +02:00
Jupeyy eb2689cf9e Rename QuadContainerAsSprite to QuadContainerEx, so its useful for all kind of rendering 2020-10-20 18:45:03 +02:00
def 3397869b31 Show option to disable system messages in settings 2020-10-20 18:27:58 +02:00
bors[bot] 3bdded3c4f
Merge #3122 #3137
3122: Fix arithmentic problems r=def- a=Jupeyy

The first three commits are safe

The ones i'll add later will be inside the gamecore, so might alter behaviour.

I'll see which ones are critical, but takes me some time

i fixed most in #3081

3137: Add gfx debug r=def- a=Jupeyy

If someone wants to try, you have to execute the client with a config that contains dbg_gfx 1
If opengl debug is supported it will show "Enabled OpenGL debug mode" in the console

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-20 16:19:55 +00:00
bors[bot] e5870ab06f
Merge #3113
3113: Visual Chat Update r=def- a=Banana090

https://github.com/ddnet/ddnet/pull/3093

Co-authored-by: Дядя Женя <spy090@yandex.ru>
2020-10-20 16:03:57 +00:00
bors[bot] 2709afb007
Merge #3095
3095: Disallow player name changes when the player is muted r=def- a=heinrich5991



Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2020-10-20 15:56:16 +00:00
Jupeyy 74515d4b95 UI Elements 2020-10-19 23:52:29 +02:00
bors[bot] c1dea54d80
Merge #3149
3149: Fix memory leak on team finish and read of uninitialized data r=def- a=Zwelf

Fixes #2522, fixes #3144 and fixes second leak from #3134.

Co-authored-by: Zwelf <zwelf@strct.cc>
2020-10-19 17:09:43 +00:00
bors[bot] dfe3bb44cb
Merge #3139
3139: Use NUM_DUMMYS for dummy array length r=def- a=ChillerDragon

Should make code more readable by explaining that the array is used for dummy. Also makes modders life easier if there is a need to scale up dummy count.

I left out two places that do not include client.h

3be8a592e5/src/game/client/prediction/gameworld.h (L92)

3be8a592e5/src/game/gamecore.h (L212)

Moving the enum to protocol.h for example is probably not nice.

Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
2020-10-19 16:37:22 +00:00
bors[bot] aca143cb7d
Merge #3129 #3138 #3143
3129: Editor: Fix selection of None value in auto rules (fixes #3013) r=Jupeyy a=def-

by starting the indexing at 0

3138: Fix out of bounds access in GetSolo r=Jupeyy a=def-

As discovered in #3135

3143: Ignore ddnet-info.json dl failure again r=Jupeyy a=def-

too aggressive, might just be bad internet at the moment

Co-authored-by: def <dennis@felsin9.de>
2020-10-19 12:46:44 +00:00
Zwelf aa53f28449 Fix memory leak in MySQL getBlob function
Direct leak of 768 byte(s) in 2 object(s) allocated from:
    #0 0x4e91ad in operator new(unsigned long)
    #1 0x7f0c54a3bf63 in sql::mysql::MySQL_Prepared_ResultSet::getBlob(unsigned int) const (/usr/lib/x86_64-linux-gnu/libmysqlcppconn.so.7+0x77f63)
2020-10-19 14:00:53 +02:00
def 709d700e5b Ignore ddnet-info.json dl failure again
too aggressive, might just be bad internet at the moment
2020-10-18 23:40:00 +02:00
ChillerDrgon f1bb5b5bd9 Use NUM_DUMMIES for dummy array length 2020-10-18 23:15:25 +02:00
Jupeyy bdb53e3dad Fix two more filter out of bounds 2020-10-18 18:41:18 +02:00
def c203d787d2 Free allocated data
Direct leak of 8 byte(s) in 2 object(s) allocated from:
    #0 0x4f08e3 in __interceptor_malloc (/home/teeworlds/servers/DDNet-Server-asan+0x4f08e3)
    #1 0x68c9d1 in CDataFileWriter::AddItem(int, int, int, void*) /home/teeworlds/src/master/src/engine/shared/datafile.cpp:666:33
    #2 0x5e4a3e in CGameContext::OnMapChange(char*, int) /home/teeworlds/src/master/src/game/server/gamecontext.cpp:3398:10
    #3 0x553473 in CServer::LoadMap(char const*) /home/teeworlds/src/master/src/engine/server/server.cpp:2235:16
    #4 0x55509e in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2440:8
    #5 0x561a56 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3537:21
    #6 0x7f2349f3809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
2020-10-18 16:39:08 +02:00
Jupeyy 5b4d99275f Add gfx debug 2020-10-18 14:38:19 +02:00
def 1081a6870c Put CLineReader on stack so we can't forget to delete it
Found in https://github.com/ddnet/ddnet/issues/3134

Direct leak of 360712 byte(s) in 11 object(s) allocated from:
    #0 0x51fb22 in operator new(unsigned long) (/home/teeworlds/servers/DDNet-Server-asan+0x51fb22)
    #1 0x561d77 in CServer::GetAnnouncementLine(char const*) /home/teeworlds/src/master/src/engine/server/server.cpp:3563:20
    #2 0x5c00a7 in CGameContext::OnTick() /home/teeworlds/src/master/src/game/server/gamecontext.cpp:971:32
    #3 0x556073 in CServer::Run() /home/teeworlds/src/master/src/engine/server/server.cpp:2544:19
    #4 0x561a56 in main /home/teeworlds/src/master/src/engine/server/server.cpp:3537:21
    #5 0x7f2349f3809a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
2020-10-18 12:57:36 +02:00
def ad3bc98578 Revert "Make GL 1.5 default"
As discussed with Lerath2, we should try to debug

This reverts commit 537f47d11d.
2020-10-17 23:34:16 +02:00
bors[bot] 54c7a5bba5
Merge #3108
3108: Make GL 1.5 default r=def- a=Jupeyy

If ppl see white textures its related to
#2125
and you need to revert it, bcs thats not fixable, there is no extension for GL_GENERATE_MIPMAP or smth

Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2020-10-17 21:09:11 +00:00
Learath2 ba7b95f7ad Revert #3066
This reverts commits:
	a2b3f45f8b
	26a07c804f
2020-10-17 17:32:52 +02:00
Дядя Женя 6708a7a69d Chat visual update 2020-10-17 15:50:35 +02:00
Jupeyy 186206d40c Fix and change text cursor 2020-10-17 15:26:33 +02:00
Jupeyy 537f47d11d Make GL 1.5 default 2020-10-15 18:47:06 +02:00
def 040876b0d3 Log close error to console 2020-10-15 17:48:22 +02:00
heinrich5991 a604d913ce Move ghost code to client
It's not used by the server, so there's no reason to put it into the
shared codebase.
2020-10-14 17:08:58 +02:00
heinrich5991 070504b5c8 Update ghost format to v6: Replace CRC with SHA256
To be friendly to other implementors of the format, the CRC field is now
zeroed out instead of completely gone.

Drop support for v2 and v3 of the ghost format, the ghost files should
have been automatically converted by the client already.
2020-10-14 17:08:58 +02:00
heinrich5991 6ff53358d3 Remove code for CRC in most places, except where needed for net compat
This should path the way to remove it altogether in the future.
2020-10-14 17:08:58 +02:00
heinrich5991 246d2ac3d6 Allow IServer users to check when client's names change
Use that available interface to process name change spam protection more
cleanly.
2020-10-14 16:42:35 +02:00
def 7f38bc0941 Fix clang-analyzer-core.uninitialized.Assign
/media/ddnet/src/engine/shared/dilate.cpp:32:22: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage [clang-analyzer-core.uninitialized.Assign]
2020-10-14 15:45:47 +02:00
def 6443e708b5 Fix clang-analyzer-core.CallAndMessage
/media/ddnet/src/game/editor/auto_map.cpp:94:17: warning: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage]
                                int RunID = pCurrentConf->m_aRuns.add(NewRun);
                                            ^
2020-10-14 15:45:47 +02:00
def 0867424749 Fix clang-analyzer-security.insecureAPI.strcpy
/media/ddnet/src/engine/server/sql_string_helpers.cpp:74:3: warning: Call to function 'strcpy' is insecure as it does not provide bounding of the memory buffer. Replace unbounded copy functions with analogous functions that support length arguments such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
2020-10-14 15:45:47 +02:00
def 5c1b8cd221 Fix clang-analyzer-deadcode.DeadStores
/media/ddnet/src/game/client/components/statboard.cpp:288:3: warning: Value stored to 'tw' is never read [clang-analyzer-deadcode.DeadStores]
2020-10-14 15:45:47 +02:00
def 7c86dd8e5c Fix external directory in .clang-tidy 2020-10-14 15:45:47 +02:00