Commit graph

12302 commits

Author SHA1 Message Date
Kyle Bradley ecf70319fc Fixed formatting issues 2021-03-08 14:53:35 +02:00
= 380664aae4 PR feedback 2021-03-08 00:41:48 +02:00
= f6ddfe830d Added PR feedback:
- Server name included in output
- Better output for unranked local
2021-03-08 00:39:11 +02:00
Kyle Bradley f950f27424 Formatting fixes 2021-03-03 16:50:43 +02:00
Kyle Bradley 50966f04e1 Updates config variables 2021-03-03 16:49:11 +02:00
Kyle Bradley ef1b30661e Add local rank and top 5 2021-03-03 15:23:18 +02:00
houseme-kyle 724e4e4b63
Merge pull request #1 from ddnet/master
Merge
2021-03-02 16:39:11 +02: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
bors[bot] 7be0f30037
Merge #3665
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>
2021-03-01 19:27:43 +00:00
bors[bot] b2d4fd5908
Merge #3663
3663: Fix chat repeated messages r=def- a=Jupeyy

Pressing "U" to show all chat messages and make a message to appear repeating while holding U, makes it to create 2 instances, bcs another Line is allocated, when not returning for the log.

## 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-01 19:05:30 +00:00
Learath2 5f50d1dc57 Add a way to block people from chatting on vpns 2021-03-01 19:54:59 +01:00
Jupeyy 7e00407659 Fix chat repeated messages 2021-03-01 18:35:06 +01:00
Jupeyy c20b9801d4 Don't allocate the windows console default 2021-03-01 15:25:45 +01:00
bors[bot] 020d8c8913
Merge #3659
3659: Fix Insecure temporary file r=def- a=edg-l

<!-- What is the motivation for the changes of this pull request -->
Check out https://docs.python.org/3/library/tempfile.html#tempfile.mktemp


Co-authored-by: Edgar <git@edgarluque.com>
2021-03-01 08:32:10 +00:00
Edgar 6e76c46c4c
Fix Insecure temporary file 2021-03-01 09:14:25 +01:00
bors[bot] a6aa74f520
Merge #3658
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>
2021-02-28 23:53:24 +00:00
heinrich5991 9f41b5d910 Fix /mapinfo displaying a time when not having finished
The C API doesn't return 0.0f for NULL values, check for them
explicitly.

Fixes #3653.
2021-03-01 00:37:38 +01:00
bors[bot] 9556b4f59a
Merge #3657
3657: Don't leak memory on Windows in logger r=heinrich5991 a=def-

Thanks to 拓真 on Discord for report

<!-- 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: Vlad <51330274+gerdoe-jr@users.noreply.github.com>
Co-authored-by: def <dennis@felsin9.de>
2021-02-28 23:36:52 +00:00
def c92f818a3c Don't leak memory on Windows in logger
Thanks to 拓真 on Discord for report
2021-02-28 23:22:18 +01:00
Vlad a780dd691d Memory leak in system.c
> Here I get a memory leak
> https://github.com/ddnet/ddnet/blob/master/src/base/system.c#L167

Thanks to @kurosio
2021-02-28 23:22:15 +01:00
bors[bot] 7d3fdec98a
Merge #3652
3652: Fix two mistakes of the MySQL C API rewrite r=def- a=heinrich5991

Thanks to @Zwelf for help with debugging.

## 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-02-27 22:22:02 +00:00
heinrich5991 dd964316cb Fix duplicate teamranks getting inserted
There was a logic error that caused the loop to never execute.
2021-02-27 22:35:44 +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] f8ab680183
Merge #3651
3651: Fix ": " being included in "*** : abc" server messages r=def- a=heinrich5991

<!-- 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-02-27 15:56:13 +00:00
heinrich5991 bdcabe8a2d Fix ": " being included in "*** : abc" server messages 2021-02-27 16:21:42 +01:00
bors[bot] 52799435cc
Merge #3648
3648: Fix /times query by reordering fields r=def- a=heinrich5991

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.

<!-- 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-02-27 08:43:42 +00:00
heinrich5991 61b46746d7 Fix /times query by reordering fields
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.
2021-02-26 23:44:26 +01:00
bors[bot] c3ac693f62
Merge #3647
3647: Make statboard work with up to 32 players r=def- a=Jupeyy


![screenshot_2021-02-26_12-40-50](https://user-images.githubusercontent.com/6654924/109296061-0efa9a80-7830-11eb-8720-05ff0d27b764.png)

Current behavior is not showing it, so better than nothing.
Since FNG with over 16 players is quite a thing, its nice to have it working

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-02-26 12:34:47 +00:00
Jupeyy 33b75bde9a Make statboard work with up to 32 players 2021-02-26 12:46:32 +01:00
bors[bot] 3d86c76e5f
Merge #3642
3642: Forgot to actually send Sv_RecordLegacy to old clients r=def- a=heinrich5991

<!-- 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-02-24 22:49:38 +00:00
heinrich5991 35dca7e17d Forgot to actually send Sv_RecordLegacy to old clients 2021-02-24 23:40:11 +01:00
bors[bot] f006eee821
Merge #3641
3641: Fix errors introduced by the MySQL C API pull request r=Learath2 a=heinrich5991

For the first one, I'm not sure how this ever worked (the ranks did end up in the DB though). The other one was introduced by a rebase.

## 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-02-24 19:48:15 +00:00
heinrich5991 44437eed39 Fix return values for loading saves
Introduced by an incorrect rebase.
2021-02-24 20:43:07 +01:00
heinrich5991 83da81e8c3 Use ExecuteUpdate for SQL INSERT statements
Fixes
```
save score failed: (fetch:stmt:2014): Commands out of sync; you can't run this command now
```
2021-02-24 20:42:47 +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
bors[bot] 78041baf40
Merge #3640
3640: Bump version for the new protocol to DDNet 15.4 r=Learath2 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-02-24 16:14:51 +00: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
bors[bot] 0c1f4cbad4
Merge #3637
3637: Remove fifo file on shutdown r=heinrich5991 a=def-

Helps with the official servers.

## 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-02-23 18:12:41 +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
Alexander Akulich dfc75806c6 CGameContext::SendVoteStatus: Hide the trick for 64 clients
as an implementation detail. This way the caller is synced with the upstream
and does not care about 64 players.
2021-02-23 18:26:16 +03:00
Alexander Akulich 688f11ef34 Move DDRace-specific player initialization code to the Controller 2021-02-23 18:26:16 +03:00
Alexander Akulich b0c0fb316c Get rid of gamemode.h with confusing definitions
We also have GAME_NAME macro in game/version.h and the macros
from gamemode are not used anywhere else.
2021-02-23 18:26:16 +03:00
Alexander Akulich a6bdda60ed GameController: Add OnPlayerConnect() like in the upstream 2021-02-23 18:26:16 +03:00