Commit graph

12081 commits

Author SHA1 Message Date
Alexander Akulich ffe3f110eb GameController: Extract DoActivityCheck()
Apply refactoring from the upstream.
2021-01-16 03:20:57 +03:00
Alexander Akulich 242aa63178 ddracechat.h is used by the client, so move it to src/game
where ddracecommands.h already is.
2021-01-16 03:20:57 +03:00
Alexander Akulich dfd60e6668 CGameContext: Remove ugly CGameControllerDDRace::m_Teams.Reset()
We called CGameControllerDDRace constructor on the previous line.
The CGameControllerDDRace invokes CGameTeams constructor which calls
Reset() on his own.

There is no chance how this can change anything.
2021-01-16 03:20:57 +03:00
Alexander Akulich 5d0bb4cf3c Backport vector functions cleanup from the upstream
Keep closest_point_on_line() as-is.

(commit 6b69f94dc8)
2021-01-16 03:20:57 +03:00
BeaR 9f0b0af862 Add angle<->direction conversion functions to vector math (Cleanup)
Keep angle() (ex. GetAngle()) as-is.

(cherry picked from commit 7735557aa5)
2021-01-16 03:20:57 +03:00
Alexander Akulich 59deb42252 CConfig: Use str_escape in EscapeParam() 2021-01-16 03:20:57 +03:00
bors[bot] 88fb027cb2
Merge #3510
3510: Work around Pylint import problem (fixes #3507) 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-16 00:06:06 +00:00
Dennis Felsing b20014efd3
Merge pull request #3515 from heinrich5991/pr_ddnet_fixstyle
Fix clang-style
2021-01-16 01:00:44 +01:00
heinrich5991 c2ed416f43 Fix clang-style 2021-01-15 23:59:48 +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
Dennis Felsing cc7ed06b8a
Merge pull request #3511 from edg-l/pr-ddnet-info-tmp
remove ddnet info tmp file always when quitting
2021-01-15 15:03:16 +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
def 1728c88949 Work around Pylint import problem (fixes #3507) 2021-01-15 09:27:41 +01:00
Dennis Felsing b943ca1e0c
Merge pull request #3509 from Zwelf/pr-fix-memory-leak-sqlite3
Fix memory leak in SQLite3 print statement
2021-01-15 09:09:54 +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
Dennis Felsing 8c392ee51c
Merge pull request #3503 from def-/pr-hook-symbol
Differentiate hook number by showing symbol
2021-01-13 18:05:04 +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
bors[bot] bf1707274f
Merge #3505
3505: Fix dummy not sending DDNet version r=def- a=fokkonaut

<!-- 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: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
2021-01-12 16:13:08 +00:00
fokkonaut 7e169d92e5 Fix dummy not sending DDNet version 2021-01-12 16:57:53 +01:00
def dccbf26ca0 Differentiate hook symbol 2021-01-12 10:22:39 +01:00
bors[bot] 5d45f061fa
Merge #3498
3498: Make netclipping of entities and events respect shown distance (fixes #3420) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-01-11 22:21:01 +00:00
def cbda5b720a Make netclipping of entities and events respect shown distance (fixes #3420) 2021-01-11 23:11:28 +01:00
bors[bot] d0cdf23526
Merge #3493 #3497
3493: Keep showing last checkpoint after kill r=heinrich5991 a=def-

Some maps kill you quickly and you can't see how good your last run was,
for example "Buckle Up".

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


3497: No network clip in client prediction 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-11 20:21:44 +00:00
bors[bot] 3bc3a80556
Merge #3496
3496: Freeview mouse moves faster when zoomed out (fixes #3459) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-01-11 20:12:29 +00:00
def f9aae5d53a No network clip in client prediction 2021-01-11 18:02:52 +01:00
def 9033968518 Freeview mouse moves faster when zoomed out (fixes #3459) 2021-01-11 17:54:33 +01:00
bors[bot] 460f2190f5
Merge #3494
3494: Remove unused onChangeTeamState r=def- a=Zwelf

This function was never used and just disrupts the reading flow a bit.
<!-- 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
- [x] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Zwelf <zwelf@strct.cc>
2021-01-11 13:37:58 +00:00
Zwelf 87d422df5a Remove unused onChangeTeamState 2021-01-11 14:29:01 +01:00
def 95e4418026 Keep showing last checkpoint after kill
Some maps kill you quickly and you can't see how good your last run was,
for example "Buckle Up".
2021-01-11 14:09:37 +01:00
bors[bot] c8b4ce9c92
Merge #3465
3465: Reset practice after team saved and got killed r=Zwelf a=def-

As reported by Polector 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-11 13:09:18 +00:00
def 4520ea3bb7 Reset practice after team saved and got killed
As reported by Polector on Discord
2021-01-11 00:23:36 +01:00
bors[bot] e0d6fa4670
Merge #3476 #3484
3476: Indicate strength of hook in nameplates r=heinrich5991 a=def-

off by default, cl_nameplates_strong 1 to enable

also shown in debug mode (ctrl-shift-d)

![screenshot-20210105@142505](https://user-images.githubusercontent.com/2335377/103651612-2b7e0300-4f62-11eb-8b45-09b8b125f2a6.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
- [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)


3484: Fix up/down keys in demo browser r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-01-10 16:57:26 +00:00
bors[bot] 6f4fb1a926
Merge #3468
3468: Improve grammar when locking team (fixes #3467) 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 16:46:08 +00:00
bors[bot] 124c4b1acf
Merge #3463
3463: Dynamically size scoreboard title r=heinrich5991 a=def-

![screenshot_2020-12-31_10-01-53](https://user-images.githubusercontent.com/2335377/103403147-80c7a800-4b4f-11eb-90d3-90d032439cf3.png)
![screenshot_2020-12-31_10-13-23](https://user-images.githubusercontent.com/2335377/103403580-ed8f7200-4b50-11eb-9798-01fd4e283405.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: def <dennis@felsin9.de>
2021-01-10 15:46:11 +00: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
bors[bot] c6e2d42624
Merge #3489
3489: Port some refactor from teeworlds-0.7 r=heinrich5991 a=Kaffeine

Hi, devs.

I'm considering options to rebase another mod on the DDNet code and I found a lot of missing API.
I also think that it would be simpler for you to cherry-pick patches if DDNet will provide and use a similar API.

I ran the client and checked that the configuration save/load works correctly.

Backported changes overview:
- Extract some `CGameContext` code to methods (`SendMotd()`, `SendSettings()`)
- Provide getters for CEntity members and make some of them `private`
- Extract allocation macros from `entity.h` to `alloc.h` (to reduce includes)
- Extract / introduce `CConsole::Init()`
- Introduce CConfig API from commit de5859b371 (the old API is kept and still used in the codebase)

## 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: Alexander Akulich <akulichalexander@gmail.com>
2021-01-10 14:50:43 +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
Alexander Akulich 77b2b22dd2 Entity: Restrict the access to some (now) private members
Follow upstream commit e86a486688
2021-01-10 14:25:12 +03:00
Alexander Akulich b0db610a47 Entities: Get rid of direct m_ID access 2021-01-10 14:25:12 +03:00
Alexander Akulich 035a50dd0b Entities: Get rid of direct m_ProximityRadius access 2021-01-10 14:25:12 +03:00
Alexander Akulich b865306b56 Entity: Add API changes from the upstream
The upstream restricted access to the class member.
Keep the some protected API as public and some private API as protected
for now to avoid massive changes in a hundreds places (related to m_Pos).

See upstream commit e86a486688.
2021-01-10 14:25:12 +03:00
Alexander Akulich 476c2c60d7 Cleanup includes
See the upstream commit 24bda2faa0
2021-01-10 14:25:12 +03:00
Alexander Akulich f16937b361 gamecontext.h: Remove unused player.h include
See the upstream commit 24bda2faa0
2021-01-10 14:25:12 +03:00
Alexander Akulich 164cb9907a player.h: Remove unused character.h include
See the upstream commit 24bda2faa0
2021-01-10 14:25:12 +03:00
Alexander Akulich 8ee8351b68 Move WEAPON enum from character.h to player.h
See the upstream commit 24bda2faa0
2021-01-10 14:25:12 +03:00
Alexander Akulich dc5b9340d5 Extract allocation macros to alloc.h (mimic the upstream)
See the upstream commit 24bda2faa0
2021-01-10 14:25:12 +03:00