Commit graph

11872 commits

Author SHA1 Message Date
Robert Müller a9787b15e3 Merge CRenderTools::DrawUIRect4NoRounding into DrawUIRect4
As this is a special case the methods can be merged to reduce the number of public methods.
2022-07-10 17:19:32 +02:00
heinrich5991 8996d152ab Allow multiple connect addresses
This allows the client to connect to servers that have both an IPv4 and
an IPv6 address, even if the client is only connected to one of the two.
The one faster to answer will be picked.

Timeout codes are now generated based on *all* of the server's
addresses.

Fixes #5158.
2022-07-10 16:57:10 +02:00
heinrich5991 89a4a0c5c6 Only compare with old STUN server address if we have any 2022-07-10 16:53:15 +02:00
heinrich5991 a9bf09f769 Move websocket address handling out of the client 2022-07-10 16:53:12 +02:00
heinrich5991 6600024f24 Allow multiple addresses per server in the serverbrowser
Support is incomplete for `leak_ip_address_to_all_servers` (will only
ping the first address of each server) and for the `leak_ip` setting
(which will also only ping the first address of each server).
2022-07-10 16:52:07 +02:00
heinrich5991 2e34cf4d4b Make NETADDR comparable and hashable 2022-07-10 16:39:29 +02:00
Robert Müller 0d29e6fe3f Rename variable HoverTime -> m_HoverTime 2022-07-10 15:40:17 +02:00
Robert Müller fb1919b9be Fix spaces around documentation comments in tooltip.h 2022-07-10 15:40:17 +02:00
Robert Müller 35483177e8 Use else-if instead of duplicating condition 2022-07-10 15:40:17 +02:00
def eb14755501 Fix compilation in video.cpp
/home/deen/isos/ddnet/ddnet-source/src/engine/client/video.cpp:829:9: error: ‘c’ was not declared in this s
cope
  829 |         c->thread_count = 1;
      |         ^
2022-07-10 01:08:33 +02:00
bors[bot] e9f95dbefd
Merge #5598
5598: Fix the HUD bug I intoduced with  #5592 r=def- a=C0D3D3V

The bug was, if you spectate other players, the jump display and weapon display was broken.

Use for weapon and jump display now render information instead of the predicted data, so that these Displays are also correct if you spectate other players.
This is necessary since with https://github.com/ddnet/ddnet/pull/5592 this information is no longer present in the predicted character (if the character is not predicted)

## 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 (especially base/) or added coverage to integration test
- [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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-07-09 22:13:18 +00:00
Alexander Akulich 6d9284adc1 Port some code to str_copy() template 2022-07-09 19:40:58 +03:00
Alexander Akulich c4f188a0e7 system: Add str_copy() template for fixed array destinations 2022-07-09 19:19:21 +03:00
Alexander Akulich 0d72b62daf Replace 3.14159265f with 'pi' from math.h 2022-07-09 19:19:21 +03:00
Alexander Akulich 9db49d9f74 variables.h: Add stub macros definitions to enable code highlight 2022-07-09 19:19:21 +03:00
Alexander Akulich 9faea2ff6e client/menus_ingame: Fix a warning about struct padding
Excessive padding in 'struct CColumn' (8 padding bytes, where 0 is optimal).
2022-07-09 19:16:46 +03:00
Alexander Akulich dd94d662ca client/settings: Use CUI::CORNER enum keys where appropriate 2022-07-09 19:16:46 +03:00
c0d3d3v 57995693ad
Use for weapon and jump display now render information instead of the
predicted data, so that these display are also correct if you spectate
other players.
This is necessery since with https://github.com/ddnet/ddnet/pull/5592
this information is no longer present in the predicted character (if the
chracter is not predicted)
2022-07-09 16:03:16 +02:00
bors[bot] e2f7f53bc8
Merge #5591
5591: (A bit) safer interface for text containers r=def- a=Jupeyy

For #5143
Maybe it helps identifying the problem earlier, maybe not^^

## 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 (especially base/) or added coverage to integration test
- [ ] 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>
2022-07-09 09:47:48 +00:00
bors[bot] 5345e55b94
Merge #5545
5545: Format name accordingly r=heinrich5991 a=Chairn

I think i got almost all the misstyped name. I did let some because they made sense to me. I think, only generated code remains to be formatted (and src/base and websockets, but those seems to have an exception).

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [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: Chairn <chairn.nq@hotmail.fr>
2022-07-08 23:08:02 +00:00
Dennis Felsing fe5e0298fd Version 16.2.1 2022-07-09 00:06:49 +02:00
c0d3d3v 1dacb3366b
rename ReadCharacterCore back to Read; Do not overwrite predicted
CharacterCore with Snap Data
2022-07-08 21:47:51 +02:00
Jupeyy c6589f3a5e (A bit) safer interface for text containers 2022-07-08 19:19:37 +02:00
Chairn b8840c4571 Replaced magic number with MAX_CHECKPOINTS 2022-07-08 18:01:33 +02:00
Chairn a69dc599a9 Huge variable naming format
Fix pointer and pointer array variable naming

Huge renaming to match our rules

Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)[^a]\w+\[
            (?!(return|delete)\b)\b\w+ (?!(m_|ms_|g_|gs_|s_))[^a]\w+\[

Further format static variables

Format almost all pointer names accordingly

Used regex: (?!(return)\b)\b\w+
\*(?!(m_p|p|s_p|m_ap|s_ap|g_p|g_ap|ap|gs_ap|ms_ap|gs_p|ms_p))\w+\b[^:\(p]

clang-format

Fix CI fail

Fix misnamed non pointer as pointer and non array as array

Used regex: (?!(return|delete)\b)\b\w+ (m_|ms_|g_|gs_|s_)p\w+\b
            (?!return\b)\b\w+ (ms_|m_|g_|gs_|s_)a\w+\b[^\[]

clang-format

Revert to SCREAMING_SNAKE_CASE and reinstate dead code
2022-07-08 18:01:29 +02:00
Robert Müller 85c78a9149 Use for-each loop in CHud::ResetHudContainers to reduce duplicate code 2022-07-08 16:53:35 +02:00
bors[bot] 66ab84a5fa
Merge #5544
5544: Replaced float array with appropriate struct (vec or color) r=def- a=Chairn

I mostly touched the code in the graphic part for array of 2 floats into vec2.
For color, i replaced array of 4 floats with ColorRGBA where it made sense.

I had to change the logic order in `src/engine/client/graphics_threaded.cpp:1113` due to operator= from vec2 to vec3. I didn't see any visual change.

## 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: Chairn <chairn.nq@hotmail.fr>
2022-07-07 12:30:29 +00:00
bors[bot] e9eeb24c17
Merge #5345 #5519 #5572
5345: Add Integration test to pr template r=heinrich5991 a=def-



5519: Library updates (2022-06-27) r=heinrich5991 a=def-

Should probably wait until after 16.2 release with them.

Vulkan 1.3.204.1 -> 1.3.216.0
curl 7.81.0 -> 7.84.0
FFmpeg 5.0 -> 5.0.1
freetype 2.11.1 -> 2.12.1
SQLite3 3.37.2 -> 3.39.0

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


5572: Also make gameclient aware that snapshots have been purged (fixes #5571) r=heinrich5991 a=def-

Recreates SnapEntities internally

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-07-07 10:41:22 +00:00
bors[bot] 5ab2491c24
Merge #5574
5574: Only MySQL >= 8.0.1 removed my_bool (fixes #5573) 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: Dennis Felsing <dennis@felsin9.de>
2022-07-07 10:19:53 +00:00
bors[bot] 9e9024d449
Merge #5585
5585: Only announce birthday once (fixes #5576) r=heinrich5991 a=def-

No matter if you use /timecp or rename

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-07-07 09:35:05 +00:00
Dennis Felsing aa18c1ee78 Only announce birthday once (fixes #5576)
No matter if you use /timecp or rename
2022-07-07 10:24:41 +02:00
Dennis Felsing 439a725d3b Only MySQL >= 8.0.1 removed my_bool (fixes #5573) 2022-07-07 09:44:13 +02:00
Chairn 2e8c5b3914 Split screen pos in independent variable. Format function declaration 2022-07-07 04:51:17 +02:00
bors[bot] a591fea1b2
Merge #5550
5550: Time checkpoints changes r=def- a=C0D3D3V

Fixes #5348

The checkpoint mechanic was last time updated here af44a79b03 and CNetMsg_Sv_DDRaceTime was introduced here: 86365bedcd

The whole design of `CNetMsg_Sv_DDRaceTime` is basically pretty bad, and it was only tired to copy the old broadcast behaviour (that we still have for vanilla client).
We are basically only sending floats (multiplied by 100) instead of using our integer ticks.  

Thats also the reason why checkpoints, close to the start (closer than one second), were not displayed (because it was forgotten to multiply m_time by 100 and so it was rounded to 0).

This PR adds a workaround for the problems, but this Net message is just designed wrong and should maybe in the future get updated to use ticks instead of rounded floats.
 
This PR allows to trigger Time Checkpoints in arbitrary order.
 
 This PR does not make checkpoints unskippable, because we currently have no way to do this, and we have no effect tile that is not skippable (except probably solid blocks).
 
 
 
 
## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-07-06 15:49:59 +00:00
c0d3d3v e6f1ef90de
send correct time diff on finish
send record when player joins or changes name
minor cleanup
2022-07-06 17:43:20 +02:00
Dennis Felsing ef9299c88d Also make gameclient aware that snapshots have been purged (fixes #5571)
Recreates SnapEntities internally
2022-07-06 15:42:05 +02:00
c0d3d3v ae80287c1b
Update checkpoint diff display to use time format with hours:minutes:centisecs
Add time diff to finish display.
Increase time the finish time display is displayed to 6 sec.
Allow to trigger time checkpoints out of order
2022-07-06 15:14:29 +02:00
c0d3d3v 498c2dbbcf
Renamed some time checkpoint related variables.
Init some of the time checkpoint variables explicitly
2022-07-06 15:13:55 +02:00
Chairn 32318a7c90 Reworked color system
Removed duplicate structs. Replaced 4 floats array with appropriate
struct where applicable
2022-07-06 11:39:51 +02:00
Chairn 27da8391dc Replace 2 floats array with vec2 where it makes sense 2022-07-06 11:39:43 +02:00
Jupeyy b3699fe9bc Remove useless GL 3.3 config 2022-07-05 20:02:19 +02:00
heinrich5991 e026bce50f Fix out of bounds read in checksum stuff 2022-07-05 10:26:05 +02:00
Jupeyy edc79e48cc Fix skindownload by only allowing move assignments 2022-07-04 18:24:34 +02:00
c0d3d3v a961151b32
Show also +0.00 split, and checkpoints close to start (<1sec) 2022-07-03 13:31:54 +02:00
bors[bot] b79bb7e62a
Merge #5547
5547: Minor tweaks to keep ODR across translation units r=def- a=Jupeyy

<!-- 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>
2022-07-02 13:06:20 +00:00
Jupeyy 7250be6a95 Rename typedef 2022-07-02 14:43:41 +02:00
Jupeyy 50f8653c57 Minor tweaks to keep ODR across translation units 2022-07-02 14:25:16 +02:00
Robert Müller 8ee821c2f0 Remove unused #include <windows.h> in engine client 2022-07-02 14:02:42 +02:00
c0d3d3v f5519d1d88
Fix HUD on server we think that they are DDRace, but they are not 2022-07-01 13:13:06 +02:00
Robert Müller f3fbe891a6 Fix player input player flags translation with sixup
The sixup translated player flags were previously applied in `OnDirectInput` directly to the player input data.
However, the input data has already been copied at that point, so predicted inputs were using the incorrect flags.
This is fixed by moving the player flags translation to `OnClientPrepareInput`, which is called first and only once on each new player input before it is copied.
2022-07-01 00:00:17 +02:00
c0d3d3v 6869530314
Rename IsTCheckpoint to IsTeleCheckpoint and IsXCheckpoint to IsFTimeCheckpoint. And reduce code duplication 2022-07-01 00:00:03 +02:00
Robert Müller 6d0806f99d Fix engine client flags not being updated under some conditions
The flags were only being updated based on rather arbitrary conditions, so they could never reset to zero or reduced.
The flags are now always updated. The flags are only used in the output of the `status` command.
2022-06-30 23:55:03 +02:00
c0d3d3v 0bfb854a0e
Rename TILE_CHECKPOINT_XXX to TILE_TIME_CHECKPOINT_XXX 2022-06-30 23:41:40 +02:00
Robert Müller d9b0304adb Use sizeof instead of constant 2022-06-30 19:46:33 +02:00
Robert Müller d5594d8bd6 Fix variable name EntitesAreMasked -> EntitiesAreMasked 2022-06-30 19:45:10 +02:00
Robert Müller 3c7847a8d9 Fix variable name WasUnknwon -> WasUnknown 2022-06-30 19:44:29 +02:00
luk 1c340daeaa fix typo and comment 2022-06-30 17:04:29 +02:00
bors[bot] 5e7ec64292
Merge #5486
5486: Switch to loading screen, when map creation takes too long r=def- a=Jupeyy

Same as #4941 

It doesn't directly fix the issue described in #5478, it does however not trigger it anymore. it's still a bug in our code unrelated  to this. This just triggered the UB from the issue as  `@ardadem` confirmed, SDL received a SDL_QUIT (`[2022-06-23 20:26:31][test]: sdl closed my client, but why xd`)

Now we have a confirmed case that making the window unresponsive can create weird behavior. Similar to the other pr switch to a loading screen after 500ms (this time without menu background map tho, since the menu background map calls the same code).

We really need some fancy loading screen for such situations, even tho they are rare xD

## 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>
2022-06-30 14:36:58 +00:00
bors[bot] 5e0eada302
Merge #5517
5517: Add APPEARANCE Settings page r=def- a=C0D3D3V

This could potentially also be added to 16.2

I also renamed  `cl_ddrace_hud` to `cl_showhud_ddrace` and ` cl_show_jumps_indicator` to `cl_showhud_jumps_indicator` I guess that fits better the pattern of the other configs.

![grafik](https://user-images.githubusercontent.com/14315968/175836449-eb74410c-df35-4177-ad42-be13a9593af8.png)

![grafik](https://user-images.githubusercontent.com/14315968/175836467-0e2ff022-8da7-468f-9df5-bb564e0f15f5.png)

![grafik](https://user-images.githubusercontent.com/14315968/176675550-c7adde7b-1c3a-4a0c-bcd6-945c9115c771.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675586-8fb5645e-32a8-4276-ad6a-cac1dfbc3e67.png)

### for the following 3 tabs there is now room to add a preview in future
![grafik](https://user-images.githubusercontent.com/14315968/176675629-5470d864-c13d-492a-9064-3b5a3743253b.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675677-f973bea8-31b4-4a00-85a9-1175b8fdea2f.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675731-04ea48b2-ec18-4a0f-a4b5-48fe7c9dcd34.png)
![grafik](https://user-images.githubusercontent.com/14315968/176675779-70df98df-35da-4018-a81e-e26127492d36.png)

I changed some of the texts ... so please look at them carefully 

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-30 13:03:17 +00:00
c0d3d3v cee071e3f1
The appearance settings page has been revised to look more like the general and DDNet settings page 2022-06-30 14:17:07 +02:00
bors[bot] 2bd1273657
Merge #5514
5514: Update menu music state when the config variables change via console, various refactoring r=heinrich5991 a=Robyt3

Also update the background music when `snd_enable` or `snd_enable_music` change via console or bind. Closes #2911.

For this purpose, add `IsPlaying` method to engine sound and client sound component to check whether a specific sound sample is already playing.

Various refactoring in engine sound.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-30 11:07:07 +00:00
Chairn 96e9364fb0 Fix more unsafe define 2022-06-29 23:52:03 +02:00
c0d3d3v a26285c052
Add cl_nameplates_strong to settings page 2022-06-29 16:28:27 +02:00
c0d3d3v 281c766117
Add APPEARANCE Settings page 2022-06-29 16:28:19 +02:00
c0d3d3v 435b7ab489
revert to send server messages for now 2022-06-29 14:46:23 +02:00
bors[bot] 1743b7ce67
Merge #5210
5210: Move ddnet character display info in ddnet character r=def- a=C0D3D3V

- I also added the default value mechanic for Net Objects that have set `validate_size=False`
- I removed the ramp value from the snap, because currently all maps use the default tuning parameters for it
- I renamed `m_FreezeTick` to `m_FreezeStart` 

- Added Extended Net Objects to the debug HUD (Also added a Headline):
![grafik](https://user-images.githubusercontent.com/14315968/175284419-3014bc06-96a0-407d-b170-15e06350caa7.png)
(out of range) is in the screenshot the old DDNetCharacterDisplayInfo

fixes #5455

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-29 11:35:37 +00:00
Robert Müller 4534996fbc Fix movement of envelope points with Info (Ctrl+I)
Co-authored-by: oy <tom_adams@web.de>
2022-06-28 22:25:55 +02:00
Robert Müller a765abf8e6 Merge IgnoreGrid variable declarations and definitions 2022-06-28 22:06:24 +02:00
BeaR b25c094daa Envelope preview: make last point editable 2022-06-28 19:29:09 +02:00
Robert Müller 16d9a69dd5 Print font name instead of address in log message, pFont -> font 2022-06-28 17:48:41 +02:00
Robert Müller b8d6298e29 Rename OpusFile to pOpusFile 2022-06-28 17:38:38 +02:00
Robert Müller d8e72ad862 Handle op_read errors and EOF 2022-06-28 17:38:05 +02:00
Robert Müller ac40efa263 Only apply size and color if changed, when editing multiple layers
To prevent the color of all layers from being reset to zero when changing just the size.
2022-06-27 23:20:09 +02:00
Robert Müller 70866d6d0c Fix names of SCommonPropState member variables 2022-06-27 23:20:09 +02:00
bors[bot] c231084daf
Merge #5515
5515: Include config info in help r=heinrich5991 a=def-

So it is clear what the default is

![screenshot-20220627@000811](https://user-images.githubusercontent.com/2335377/175835563-dd2abc4f-df83-43a7-bb60-7597d498aab7.png)
![screenshot-20220627@000545](https://user-images.githubusercontent.com/2335377/175835566-c983aa93-4a1d-471a-b183-1068050d196f.png)
![screenshot-20220627@000519](https://user-images.githubusercontent.com/2335377/175835569-796bcc4c-f9d2-4949-b1d5-b6dbb03be6d9.png)


## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-06-27 17:41:08 +00:00
Chairn a9ee57aeb7 Fix unsafe defines 2022-06-27 18:51:02 +02:00
Robert Müller 2e200c834d Use consistent sizeof expression for Mix calls 2022-06-27 17:55:28 +02:00
c0d3d3v 2090178c8e
Set default of cl_freezebars_alpha_inside_freeze to 0 2022-06-27 12:20:09 +02:00
c0d3d3v 59436b5e6d
Add default values to extended Net Objects 2022-06-27 01:11:19 +02:00
c0d3d3v f819afed6c
Print also extended NetObj and NetMsg Names
Show External NetObjects in Snapshot stats
2022-06-27 01:10:37 +02:00
c0d3d3v 00f28f2c8e
Unpack all 64 Parts of a splitted Snapshot 2022-06-27 01:10:37 +02:00
c0d3d3v 07cfda5593
remove rampvalue from ddnetcharacter 2022-06-27 01:10:37 +02:00
c0d3d3v df52df9d4a
move DDNetCharacterDisplayInfo to DDNetCharacter
- add default value option to NetworkValues
- rename m_FreezeTick to m_FreezeStart
2022-06-27 01:10:25 +02:00
def 4733cdc769 Abort skin downloads too (fixes #5505) 2022-06-27 00:39:00 +02:00
def b89dccab15 Include config info in help
So it is clear what the default is
2022-06-27 00:06:56 +02:00
Robert Müller 9390ae99b2 Fix OOB access when stopping a sound that has invalid samples 2022-06-26 22:43:32 +02:00
Robert Müller 9932bd76fb Update menu music state when the config variables change via console 2022-06-26 22:43:32 +02:00
Robert Müller 525527feb7 Add IsPlaying to sounds client component 2022-06-26 22:43:32 +02:00
Robert Müller b4a82b1b87 Reduce visibility of engine sound members and methods 2022-06-26 22:43:32 +02:00
Robert Müller 757d7d0068 Change m_SoundEnabled from int to bool 2022-06-26 22:43:32 +02:00
Robert Müller 82425f20d7 Handle WavpackUnpackSamples failure 2022-06-26 22:43:31 +02:00
Robert Müller a8949cb96b Fix log message context 2022-06-26 22:43:31 +02:00
Robert Müller d3e4ebf66a Simplify loop body and reduce duplicate code
It's not necessary to handle both channels separately so the loop can be simplified. The function `Int2Short` is replaced with equivalent `clamp`.
2022-06-26 22:43:31 +02:00
Robert Müller 1fb46b760c Code style: rename variable id to NextID 2022-06-26 22:43:31 +02:00
Robert Müller 4bc88712b9 Refactoring: move variable declarations in engine sound 2022-06-26 22:43:30 +02:00
Robert Müller 3db3f0af9c Code style: remove unnecessary indentation 2022-06-26 22:43:30 +02:00
Robert Müller 939c51bae1 Add IsPlaying to engine sound
To check if a specific sample is currently being played back.
2022-06-26 22:43:30 +02:00
def fca6baed63 Rename cl_show_quads -> cl_showquads
To reenable quads for everyone who accidentally disabled it or has the
bind to accidentally disable them
2022-06-26 20:51:53 +02:00
Robert Müller 8eb1f6888d Refactoring: use CGameWorld::Clear in CGameWorld::CopyWorld 2022-06-26 12:51:17 +02:00
Jupeyy b62894dad4 Switch to loading screen, when map creation takes too long 2022-06-26 11:56:56 +02:00
Robert Müller 2df4c4c668 Fix heap-use-after-free in CGameWorld::RemoveEntity
Entities have a pointer to their parent entity. If the parent entity is freed first, then freeing the child will cause access to the already freed parent.

This is fixed by adding a child pointer and clearing the child and parent pointers when either child or parent is freed.
2022-06-26 11:28:23 +02:00
bors[bot] 1e31db257f
Merge #5420
5420: Improvments for new HUD r=def- a=C0D3D3V

for testing set `#define CLIENT_VERSIONNR 16020`
Some of the changes are only available in the next version

Impressions: https://youtu.be/E770vGp4KKY

Implements a few of the recommendations from https://github.com/ddnet/ddnet/issues/5159 and Discord
- removes all player capability messages send by the server, that are now displayed in the HUD
- ~~remove `cl_ddrace_hud` and cl_show_freeze_bars~~, 
- Added option `cl_freezebars_alpha_inside_freeze` setting to change the opacity if the player is inside a freeze tile (default visible 100%)
- Added option `cl_show_jumps_indicator`
- We send now the real weapon the player is holding if he is frozen
    -> for that we added a new particle "snow flakes" or frozen flakes :D that are spawned over the tees body, to indicate he is frozen.
    -> new extras.png asset (+ corresponding asset tab, that can potentially be used for all sorts of extras for our mod, e.g. material particles, but in the future maybe also for other mods using a similar structure like it is for entities)
- stars are no longer send to new clients, because it is duplication to the freezebar, and we decided to not allow to disable it 
- also ninja stars are no longer send. They are not vanilla, and we now have a ninja bar in the new HUD.
- display target angle from 0 to 360 (looks mirrored on the x-axis to the normal trigonometry circle, but that is just how the world coordinates are) 
- dummy action display is increased in size ( but only the border margin :D not the icons. so the icons are still the same size as the icons on the left side)
- allow the server to also show old HUD elements (see https://github.com/ddnet/ddnet/pull/5427 for screenshots)


fixes #5149
fixes #198
closes #5159

fixes #2252   ~~(But not clear if we should also display the weapon, still investigating)~~
- we do no longer display a weapon inside freeze, instead we have nice freeze particles

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-26 07:57:33 +00:00
Dennis Felsing fc2d419050 Version 16.2 2022-06-26 09:48:01 +02:00
bors[bot] 6315af0729
Merge #5504
5504: Remove useless typedef in c++ r=Jupeyy a=Chairn

## 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: Chairn <chairn.nq@hotmail.fr>
2022-06-26 06:49:01 +00:00
bors[bot] 0179dfd5e2
Merge #5499
5499: Use [[fallthrough]] attribute rather than comment r=def- a=Chairn

We could even add implicit fallthrough warning, but it is triggered in external json.c

## 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: Chairn <chairn.nq@hotmail.fr>
2022-06-25 21:49:43 +00:00
bors[bot] c5bf24692b
Merge #5502
5502: Add missing capability for GLES backend r=def- a=Jupeyy

<!-- 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>
2022-06-25 21:30:11 +00:00
Chairn a3a85bee5f Remove useless typedef in c++ 2022-06-25 21:05:54 +02:00
Robert Müller 42532f3149 Use CRenderTools::RenderIcon in editor file dialog 2022-06-25 17:16:20 +02:00
Robert Müller fb91881765 Move CMenus::DoIcon to CRenderTools::RenderIcon
As this method only renders and doesn't provide an interactive element, the naming `Render` as well as the placement in `CRenderTools` fits better.

This also allows the method to be used in the editor.
2022-06-25 17:15:55 +02:00
Robert Müller 25ad47bed2 Use DoIcon for ingame player GUI icons 2022-06-25 16:57:25 +02:00
Robert Müller 87cb948166 Clamp number of demo timeline markers to valid range 2022-06-25 16:57:25 +02:00
Robert Müller 5184cf5523 Add greyed out demo icon for invalid or not loaded demos 2022-06-25 16:57:24 +02:00
Robert Müller f727199060 Render demo file icon in name column, remove DoIcon centering 2022-06-25 16:36:09 +02:00
Jupeyy eb3406c4cf Add missing capability for GLES backend 2022-06-25 16:11:04 +02:00
c0d3d3v 706a06d4d4
clamp m_Armor, to prevent value correction on client side 2022-06-25 16:06:22 +02:00
c0d3d3v 4281df2429
Add new textures by ravie; Also add no gun hit for teleport gun 2022-06-25 16:05:38 +02:00
Chairn a50ddb75ff clang-format 2022-06-25 15:30:39 +02:00
Chairn 5f5b80ae57 Use [[fallthrough]] attribute rather than comment 2022-06-25 15:21:44 +02:00
Robert Müller 97e36fa4be Add optional color parameter to DoIcon 2022-06-25 13:43:40 +02:00
Robert Müller a530ce89d6 Rename DoButton_Icon to DoIcon and remove unused return value
As the function renders an icon and not a button.
2022-06-25 13:38:04 +02:00
c0d3d3v d78b3decd5
Revert to using conditions for the version check for capability chat messages; Remove ExcludeClientVersionAndHigher from CGameContext::SendChatTarget 2022-06-25 12:33:49 +02:00
c0d3d3v 6d098d866a
Remove ExcludeClientVersionAndHigher from CGameTeams::TeamMask; Add CGameContext::ClientsMaskExcludeClientVersionAndHigher 2022-06-25 11:16:59 +02:00
bors[bot] a62250792c
Merge #5490
5490: Try to fix dump_local_console (fixes #5488) r=heinrich5991 a=def-

Untested, but my hunch is that by not cutting off the last part the text
file will be correctly recognized as valid utf8

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-06-25 09:08:12 +00:00
bors[bot] 937a9cc0e2
Merge #5495
5495: Fix Android build r=heinrich5991 a=Jupeyy

- Video recorder off
- small fix in logger.cpp

Tested on Java-17

## 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>
2022-06-25 08:54:11 +00:00
Jupeyy a22a8dce1c Fix Android build 2022-06-25 10:43:24 +02:00
c0d3d3v dd1cdfcf2c
Add to some of the Sprite Arrays the array prefix 2022-06-25 10:39:39 +02:00
c0d3d3v ed2c514aa7
Change help text of cl_asset_extras 2022-06-25 10:28:54 +02:00
Dennis Felsing 4d43567948 Move twping to tools directory 2022-06-25 01:28:05 +02:00
Dennis Felsing 83267ed0a7
Update src/game/client/components/console.cpp
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-25 01:19:40 +02:00
Dennis Felsing 5dd2e5083b
Update src/game/client/components/console.cpp
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-25 01:19:32 +02:00
Dennis Felsing 8933ae8357 Try to fix dump_local_console (fixes #5488)
Untested, but my hunch is that by not cutting off the last part the text
file will be correctly recognized as valid utf8
2022-06-24 16:47:23 +02:00
bors[bot] 34da9f2282
Merge #5489
5489: Fix build with -DUPNP=ON r=def- a=ChillerDragon

We should have a CI that builds the same cmake settings as this arch package

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ddnet-git

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-06-24 13:58:00 +00:00
ChillerDragon 0163aa56ac Fix build with -DUPNP=ON 2022-06-24 14:16:29 +02:00
Dennis Felsing 805f6ac431 Fix win32 discord compilation
/home/deen/isos/ddnet/ddnet-source/src/engine/client/discord.cpp: In function ‘EDiscordResult (* GetDiscordCreate())(DiscordVersion, DiscordCreateParams*, IDiscordCore**)’:
/home/deen/isos/ddnet/ddnet-source/src/engine/client/discord.cpp:25:16: error: invalid conversion from ‘EDiscordResult (__attribute__((stdcall)) *)(DiscordVersion, DiscordCreateParams*, IDiscordCore**)’ {aka ‘EDiscordResult (__attribute__((stdcall)) *)(int, DiscordCreateParams*, IDiscordCore**)’} to ‘FDiscordCreate’ {aka ‘EDiscordResult (*)(int, DiscordCreateParams*, IDiscordCore**)’} [-fpermissive]
   25 |         return DiscordCreate;
      |                ^~~~~~~~~~~~~
      |                |
      |                EDiscordResult (__attribute__((stdcall)) *)(DiscordVersion, DiscordCreateParams*, IDiscordCore**) {aka EDiscordResult (__attribute__((stdcall)) *)(int, DiscordCreateParams*, IDiscordCore**)}
2022-06-24 10:06:04 +02:00
Robert Müller 52a78c45ef Fix memory leak of OpenGL 2 buffer object data
```
Direct leak of 216320 byte(s) in 3 object(s) allocated from:
    #0 0x7f5e05924808 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cc:144
    #1 0x559b8ca66278 in CCommandProcessorFragment_OpenGL2::Cmd_CreateBufferObject(CCommandBuffer::SCommand_CreateBufferObject const*) src/engine/client/backend/opengl/backend_opengl.cpp:1901
    #2 0x559b8ca47fe7 in CCommandProcessorFragment_OpenGL::RunCommand(CCommandBuffer::SCommand const*) src/engine/client/backend/opengl/backend_opengl.cpp:1107
    #3 0x559b8cdf811b in CCommandProcessor_SDL_GL::RunBuffer(CCommandBuffer*) src/engine/client/backend_sdl.cpp:248
    #4 0x559b8cdf4262 in CGraphicsBackend_Threaded::ThreadFunc(void*) src/engine/client/backend_sdl.cpp:77
    #5 0x559b8dfc58a5 in thread_run src/base/system.cpp:721
    #6 0x7f5e03bf6608 in start_thread /build/glibc-SzIz7B/glibc-2.31/nptl/pthread_create.c:477
```
2022-06-23 19:58:39 +02:00
bors[bot] 110eed9bae
Merge #5471
5471: map_replace_area: fixed implicit int to float conversions r=heinrich5991 a=sctt

fixes  #5469


Co-authored-by: f <scottistefano91@gmail.com>
2022-06-21 20:18:29 +00:00
f 222539e547 map_replace_area: removed standard inclusions 2022-06-21 21:21:49 +02:00
f 66099ab38d map_replace_area: fixed implicit int to float conversions 2022-06-21 21:04:54 +02:00
bors[bot] b75289df35
Merge #4829 #5343 #5465
4829: Added map_replace_area tool r=def- a=sctt

Motivation:
sometimes mappers need to copy a certain area from a map to another (but also to a different position of the same map).
that's very time consuming on complex maps, as tiles and quads layers have to be manually copied one by one.

map_replace_area is designed to automatically replace all the tiles and quads from a specific area to another.
`Usage: map_replace_area <from_map> <from_x> <from_y> <to_map> <to_x> <to_y> <width> <height> <output_map>`

PoW screenshots attached below.

note: for the moment map_replace_area suppose that you are working on the same map  (that's what i needed), that means source and destination maps must have the same layers structure, or else an error is returned.
but i understand it might be useful to also work on totally different maps, in that case users must be able specify layers they want to consider by associating source map layers to destination map layers (by using a config file maybe).
i'm probably going to make another PR to add this enhancement in the future.

PoW:
![Screenshot from 2022-03-16 18-08-12](https://user-images.githubusercontent.com/3328841/158650515-17c31639-28f7-4e19-954a-b5734ee82703.png)
![Screenshot from 2022-03-16 18-08-43](https://user-images.githubusercontent.com/3328841/158650512-6e21f2b4-538f-4974-aaa2-2983551d24b4.png)
![Screenshot from 2022-03-16 18-11-50](https://user-images.githubusercontent.com/3328841/158650510-d00a05a9-a2e8-4df2-8674-0c80fd894f66.png)

5343: Add rcon and chat to integration test r=def- a=ChillerDragon

Add more action to the integration test script: chat messages, chat commands, rcon commands.
This unlocks more code coverage at runtime to catch asan issues.

It adds a very restrictive regex on the log format. But I am happy to maintain that in case changes to the log output happen.
The current version is already supporting heinrichs refactor https://github.com/ddnet/ddnet/pull/5036

Also ensure chat messages arrive in the correct format. Would have catched the following issues:
https://github.com/ddnet/ddnet/issues/5342
https://github.com/ddnet/ddnet/issues/5340
https://github.com/ddnet/ddnet/issues/5302
https://github.com/ddnet/ddnet/pull/5126

DEPENDS ON:

https://github.com/ddnet/ddnet/issues/5342
https://github.com/ddnet/ddnet/issues/5340

5465: Change from pnglite to libpng for PNG reading r=def- a=heinrich5991

This is desirable mainly because libpng is maintained and pnglite is
not. pnglite was last updated in 2007 (15 years ago) and probably has a
lot of security vulnerabilities.

libpng is an actively maintained library also used by browsers like
Firefox or Chromium, so it's less likely to contain security
vulnerabilities, also it's more likely to be packaged by Linux
distributions.

This also refuses to load images of types not supported by pnglite,
which allows us to think about backward compatibility while also
introducing libpng.

## 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: sctt <scottistefano91@gmail.com>
Co-authored-by: term <term@term.sinervis.pri>
Co-authored-by: f <scottistefano91@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-06-21 16:21:47 +00:00
f 9b0396e470 map_replace_area: hopefully last last fixes to pass CI tests 2022-06-21 17:37:55 +02:00
Robert Müller 81e24ce8e8 Only enable UI editbox hotkeys when UI is enabled
Fixes hotkeys triggering console input and UI editbox input at the same time when the console is open and a UI editbox is selected.
2022-06-21 17:19:03 +02:00
f a9d4ae44f2 map_replace_area: hopefully last fixes to pass CI tests 2022-06-21 17:13:57 +02:00
heinrich5991 4625b55ad6 Move PNG handling to src/engine/gfx
This way, it's no longer compiled into the server.
2022-06-21 15:26:23 +02:00
heinrich5991 923e9acf9c Run scripts/fix_style.py 2022-06-21 15:21:33 +02:00
f 8c392c9437 map_replace_area: other minor fixes to pass CI tests 2022-06-21 15:02:26 +02:00
f ce3577dac6 map_replace_area: fixed indentation 2022-06-21 14:47:27 +02:00
f 2112426206 map_replace_area: minor fixes to pass CI tests 2022-06-21 14:35:55 +02:00
heinrich5991 955084693d Refuse to load images of types not supported by pnglite
This allows us to think about backward compatibility while also
introducing libpng.
2022-06-21 13:37:14 +02:00
Jupeyy 65ad57a448 Change from pnglite to libpng for PNG reading
This is desirable mainly because libpng is maintained and pnglite is
not. pnglite was last updated in 2007 (15 years ago) and probably has a
lot of security vulnerabilities.

libpng is an actively maintained library also used by browsers like
Firefox or Chromium, so it's less likely to contain security
vulnerabilities, also it's more likely to be packaged by Linux
distributions.
2022-06-21 13:37:14 +02:00
bors[bot] 29be9a79fd
Merge #5461
5461: add penatly to the whole team r=def- a=BloodWod-513

this should fix it #5460

## 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: BloodWod-513 <dayn_2013@mail.ru>
2022-06-20 22:20:32 +00:00
Dennis Felsing af1f0de5fb
Merge pull request #5453 from Robyt3/Joystick-Close-Before-SDL-Quit
Fix segfault in `SDL_JoystickClose` on client quit
2022-06-20 23:47:59 +02:00
BloodWod-513 d7b5921759 refactoring pPlayer to pPrimaryPlayer 2022-06-20 22:01:10 +05:00
BloodWod-513 d58c5dfc9d add penatly to the whole team 2022-06-20 22:01:10 +05:00
term 46b500efef map_replace_area: handled layergroups parameters (offset/clip/parallax) with adaptation between source and dest map 2022-06-20 11:55:55 +02:00
sctt e207fa5c9f
Merge branch 'ddnet:master' into sctt-map_replace_area 2022-06-20 11:38:53 +02:00
Robert Müller 3f1f94c9d8 Fix segfault in SDL_JoystickClose on client quit
Instead of closing the joysticks manually, use `SDL_QuitSubSystem(SDL_INIT_JOYSTICK)` to quit the entire subsystem, which will also close all joysticks correctly.

The engine input destructor is replaced with a `Shutdown` method so we can control when it is called, i.e. before calling `SDL_Quit`, which forcefully quits all subsystems.

`CJoystick::Close` is removed as we don't need to close joysticks manually anymore.
2022-06-18 11:57:57 +02:00
Robert Müller 352734de56 Organize game-server includes 2022-06-17 20:32:56 +02:00
Robert Müller 2add5d5c3c Organize game-client and editor includes 2022-06-17 20:32:56 +02:00
Robert Müller a1851ed4e4 Organize engine-server includes 2022-06-17 20:32:56 +02:00
Robert Müller 23cce5415e Organize engine-client includes 2022-06-17 17:46:43 +02:00
Robert Müller 32707f6354 Remove unused CVideo constructor argument, organize includes 2022-06-17 17:39:26 +02:00
Robert Müller 2c9696cefd Use existing typedef instead of duplicating arguments 2022-06-17 17:39:26 +02:00
Robert Müller 4949645663 Organize game-shared includes 2022-06-17 17:39:25 +02:00
Robert Müller 0813fbb537 Move android log include to correct file 2022-06-17 17:39:25 +02:00
Robert Müller 557ee84001 Organize base includes 2022-06-17 17:39:25 +02:00
Robert Müller 4048bbbf5c Organize engine-shared includes 2022-06-17 17:39:24 +02:00
Robert Müller 0a4b1b9a7b Organize generated protocol includes 2022-06-17 17:39:24 +02:00
Robert Müller da5ec5a0d2 Include <iterator> instead of <array> for std::size
As `std::size` nominally resides in `<iterator>`.
2022-06-17 17:39:24 +02:00
bors[bot] d4f0e5cf5e
Merge #5445
5445: Fix editor value scrollers not working and panning being slow r=heinrich5991 a=Robyt3

Accumulate the mouse deltas and reset them at the end of the frame to fix editor panning being slowed down and value scrollers (layer width etc.) not working anymore.

Closes #5441.

And minor cleanup.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-17 03:01:14 +00:00
effyn 6691d71da7 Gender-neutral language 2022-06-16 15:12:25 -07:00
Robert Müller c318dca703 Remove accidentally added double type 2022-06-16 21:01:51 +02:00
Robert Müller d9f4e1475e Update comment 2022-06-16 21:01:23 +02:00
Robert Müller 405ae97203 Fix editor value scrollers not working and panning being slow 2022-06-16 20:47:59 +02:00
Robert Müller 82e8ab5236 Fix shader code vector size not being updated after copy 2022-06-16 19:54:27 +02:00
bors[bot] 79de5409a5
Merge #5424
5424: no-goalshud r=heinrich5991 a=luk51

<s>do it using getgameinfo from gameclient introducting a new flag for ddrace</s>
use the same conditions as in the goalshudrender function, so don't render when empty

<!-- 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: Lukas Kitsche <lukaskitsche@posteo>
2022-06-16 14:33:56 +00:00
Lukas Kitsche 379d93ae7b no goals hud when empty 2022-06-16 16:28:50 +02:00
Robert Müller dc52377fc5 Use ReadFile to read shader 2022-06-16 10:19:38 +02:00
Robert Müller de2744cb2a Use ReadFile to read opus sounds in editor 2022-06-16 10:19:37 +02:00
Robert Müller 0a463320cf Use ReadFile to load server maps 2022-06-16 10:19:37 +02:00
Robert Müller 5d49ee3684 Use ReadFile to load updater index json 2022-06-16 10:19:37 +02:00
Robert Müller ceca44ea23 Use io_read_all to load icon font 2022-06-16 10:19:37 +02:00
Robert Müller 74d7d4fe78 Use ReadFile to load wv/opus sound files 2022-06-16 10:19:37 +02:00
Robert Müller 7050022b08 Use ReadFile in CServerBrowser::LoadDDNetInfoJson 2022-06-16 10:19:36 +02:00
Robert Müller 93536b8977 Use io_read_all to load font files 2022-06-16 10:19:36 +02:00
Robert Müller c1c8797f84 Add IStorage::ReadFile and ReadFileStr:
Storage wrappers around `io_read_all` and `io_read_all_str`.
2022-06-16 10:19:36 +02:00
Robert Müller c7fb013607 Add io_read_all, io_read_all_str and mem_has_null:
- `io_read_all` reads all bytes from a file handle into a new buffer. It should only need one allocation per file in cases where the actual file size matches the expected file size. Otherwise it falls back to doubling the buffer size if the actual file size is larger than expected to avoid TOCTOU problems.
- `io_read_all_str` reads all bytes from a file handle into a new buffer and also ensures that the buffer is null-terminated and contains no other null-characters.
- `mem_has_null` is a utility used by `io_read_all_str` to ensure that no null-characters exist in the bytes read from the file.
2022-06-16 10:19:36 +02:00
c0d3d3v 781f2e7b57
add cl_show_jumps_indicator option 2022-06-15 22:05:44 +02:00
c0d3d3v f28b71d5cc
allow the server to also show old HUD elements (by @fokkonaut) 2022-06-15 22:05:43 +02:00
c0d3d3v 977d7d952c
Increase the size of dummy actions 2022-06-15 22:05:43 +02:00
c0d3d3v 6e8efa9204
Use 0 to 260 degree in Angle display, and do not display decimals of speed in debughd 2022-06-15 22:05:43 +02:00
c0d3d3v 44478b13ba
Add Opacity option for freeze bars inside freeze 2022-06-15 22:05:43 +02:00
c0d3d3v 51133dee2e
Add freezing snow flakes effect and fix 50HZ timer + add 10Hz Timer to particle system 2022-06-15 22:05:40 +02:00
c0d3d3v 2475e844e0
Add extras texture + asset tab 2022-06-15 22:03:52 +02:00
c0d3d3v 5cd0cc6040
send the weapon the player is really holding (except for ninjajetpack)
and render ninja skin in client if player is frozen

Do stll change the emote if a player with normal emote is freezed
2022-06-15 22:01:46 +02:00
c0d3d3v bba5027cea
show freezebar also inside freeze 2022-06-15 22:01:45 +02:00
c0d3d3v 167f2afc11
remove tile info messages and freeze/ninja stars for new clients using version checking 2022-06-15 22:01:35 +02:00
Chairn b80af9beb3 Fix wrongly corrected naming introduced in #5391 2022-06-15 21:09:57 +02:00
bors[bot] b8a82f71aa
Merge #5429
5429: More vector naming format r=heinrich5991 a=Chairn

Following of https://github.com/ddnet/ddnet/pull/5391

## 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: Chairn <chairn.nq@hotmail.fr>
2022-06-15 17:41:08 +00:00
Chairn c9345e7d32 More vector naming format 2022-06-15 19:37:37 +02:00
Robert Müller eb7e210fc1 Separate editor update and render to fix slow joystick input 2022-06-15 17:37:22 +02:00
ChillerDragon 2cc54c55de '*Char' -> '*pChr' 2022-06-15 14:39:13 +02:00
Dennis Felsing 34d3ddd9c2 Rename joystick to controller (settings, configs) (fixes #5419)
Also added one Localize
2022-06-15 13:05:14 +02:00
Robert Müller 7472e99dcf Add missing CursorType != IInput::CURSOR_NONE check in editor 2022-06-15 12:08:20 +02:00
bors[bot] 9bac36f87c
Merge #5415
5415: Also set mouse settings to defaults r=def- a=Robyt3



## 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: Robert Müller <robytemueller@gmail.com>
2022-06-14 22:15:37 +00:00
Robert Müller 518bed35ab Also set mouse settings to defaults 2022-06-14 23:41:21 +02:00
Robert Müller 1a04efe180 Use DoScrollbarOption for mouse sens., name settings consistently 2022-06-14 23:27:42 +02:00
bors[bot] 89e0450359
Merge #5374
5374: Joystick support 🕹️ r=def- a=Robyt3

Port all the joystick support from vanilla:

- Joystick controls
  - support for up to 12 axis (we are using the low level SDL interface so we don't differentiate between X/Y axis, sliders etc.)
  - two axis can be used for X and Y cursor movement
  - cursor input ingame can be relative or absolute
  - support for binding up to 12 joystick buttons
  - support for binding up to 2 hats (each has 8 directions)
  - support for binding axis movement to controls (so you can move with one control stick and aim with the other)
  - multiple joysticks can be connected at the same time, but only one can be actively used, the selected joystick will be remembered based on a GUID
- Joystick UI integration
  - allow moving the UI cursor with the specified joystick axis
  - change `CComponent::OnMouseMove` to `OnCursorMove` to handle joystick separately with its own sensitivity settings
  - remove premultiplied mousesens everywhere
- Joystick settings menu (also: separate mouse and movement settings)
![screenshot_2022-06-08_22-46-08](https://user-images.githubusercontent.com/23437060/172713929-9db75dfe-8408-4d06-827d-cdb162872514.png)
![screenshot_2022-06-08_22-46-10](https://user-images.githubusercontent.com/23437060/172713932-8945feb3-5f41-434c-b555-f92beb22db58.png)
![screenshot_2022-06-08_22-46-11](https://user-images.githubusercontent.com/23437060/172713935-19bb5a47-97dd-4a1e-86e9-a3569bd557ff.png)

Other changes:

- Remove the old unused joystick implementation (with config variable `inp_joystick`).
- Remove an unused parameter.
- Add `CUIEx::DoScrollbarOption` and `IScrollbarScale`
  - renders label, current value and scrollbar
  - with linear and logarithmic scale implementations
  - used for the sensitivity and tolerance settings
  - could eventually be used for most scrollbar settings to reduce duplicate code
  - has flags for:
     - `SCROLLBAR_OPTION_INFINITE`: The scrollbar can be moved all the way to the right for another value that represents ∞. Internally this value is 0.
     - `SCROLLBAR_OPTION_NOCLAMPVALUE`: The scrollbar allows values outside the specified min/max range, e.g. the sensitivity settings can technically be as high as 100000 when set with the console.
- Add `CUIEx::DoScrollbarOptionLabeled`
  - a `DoScrollbarOption` for selecting from a finite number of options with a scrollbar
  - used for switching between relative and absolute input
  - might see more use in the future

Reference: https://github.com/teeworlds/teeworlds/pulls?q=is%3Apr+joystick

## 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
- [X] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-06-14 18:01:11 +00:00
bors[bot] caf889d04a
Merge #5406
5406: Remove namespace tw r=Jupeyy a=heinrich5991

It didn't have a clear role, it just acted as a distinguisher between
two functions with the same name.

Rename `tw::time_get` to `time_get_nanoseconds` and delete the old
`time_get_nanoseconds`. Move `CCmdlineFix` and the typed
`net_socket_read_wait` function to the global namespace.

## 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>
2022-06-14 17:46:17 +00:00
bors[bot] bbc447a995
Merge #5405
5405: mastersrv: Small convenience function r=def- a=heinrich5991

## 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>
2022-06-13 22:30:35 +00:00
bors[bot] 28ce480baa
Merge #5404
5404: Always send all tunings r=def- a=heinrich5991

It doesn't hurt since tunings after the last one are simply ignored.
This also stops future coders from introducing more and more cases in
this `if` chain.

## 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>
2022-06-13 22:10:51 +00:00
bors[bot] 1f4aa60391
Merge #5410
5410: Add `log_set_loglevel` instead of depending on engine config r=heinrich5991 a=Robyt3

Lets the logger have its own loglevel, which is set by the server and client initially after loading the config and when the `loglevel` config variable changes.

The default logger loglevel is `LEVEL_INFO`, so this fixes the log output not working when the config is not initialized (in tools). Closes #5349. Supersedes #5350.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-13 21:33:37 +00:00
Robert Müller 92699de86c Add log_set_loglevel instead of depending on engine config 2022-06-13 23:21:41 +02:00
Robert Müller ac543deabd Remove cl_nameplates_ha and cl_nameplates_ha_size 2022-06-13 22:05:36 +02:00
Robert Müller e72e276e35 Allow out of range (joystick sens.) values with DoScrollbarOption 2022-06-13 20:41:49 +02:00
Robert Müller 58e1e3981c Add joystick settings to menu, split mouse and movement settings 2022-06-13 20:41:19 +02:00
Robert Müller 8f5dc3fa01 Add CUIEx::DoScrollbarOptionLabeled 2022-06-13 20:41:19 +02:00
Robert Müller 08edc457aa Add CUIEx::DoScrollbarOption and IScrollbarScale 2022-06-13 20:41:17 +02:00
Robert Müller 0cbd2ab4df Remove unused DoSettingsControlsButtons parameter ScopeView 2022-06-13 20:40:37 +02:00
Robert Müller 55d48db711 Integrate joystick with game controls and menus/editor UI 2022-06-13 20:40:37 +02:00
Robert Müller 8757b1f41e Add joystick support to engine 2022-06-13 20:40:36 +02:00
Robert Müller de76fbfb6a Remove existing joystick implementation 2022-06-13 20:40:36 +02:00
ChillerDragon 3667061b68 Use nullptr in generated and editor
-Wzero-as-null-pointer-constant
2022-06-13 18:28:13 +02:00
heinrich5991 b3a3604c36 Remove namespace tw
It didn't have a clear role, it just acted as a distinguisher between
two functions with the same name.

Rename `tw::time_get` to `time_get_nanoseconds` and delete the old
`time_get_nanoseconds`. Move `CCmdlineFix` and the typed
`net_socket_read_wait` function to the global namespace.
2022-06-13 18:07:29 +02:00
heinrich5991 135577b7f6 mastersrv: Small convenience function 2022-06-13 17:00:54 +02:00
heinrich5991 bc1d293e30 Always send all tunings
It doesn't hurt since tunings after the last one are simply ignored.
This also stops future coders from introducing more and more cases in
this `if` chain.
2022-06-13 17:00:09 +02:00
heinrich5991 cedb3a90f9 Only re-send tunings for old versions
Newer clients send their version early in the connection establishment,
so we don't have to re-send tunings after we learn their version number.
2022-06-13 17:00:09 +02:00
bors[bot] 5a7fa108a6
Merge #5393
5393: Remove `ui_scale`: r=def- a=Robyt3

- remove config variable `ui_scale`
- remove `CUI::Scale`
- remove `CUI::SetScale`
- remove `CUI::DoLabelScaled`
- remove `CUIRect::Scale`
- use `CUI::DoLabel` instead of `CUI::DoLabelScaled`
- remove usages of `CUI::Scale()` and `CUIRect::Scale()`, or use 1.0f instead

Closes #5062. Closes #5358. Closes #5390.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-13 13:02:21 +00:00
bors[bot] 5f6e5323da
Merge #5397
5397: Add community skin option to client r=def- a=Jupeyy

I think this was requested in the client too,
rn I dont get any skins, maybe cloudflare caching or smth. Will test the days or if someone can test it go ahead

## 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>
2022-06-13 12:42:19 +00:00
Jupeyy 2710fe85be Add community skin option to client 2022-06-12 18:21:29 +02:00
bors[bot] ae1876d141
Merge #5388
5388: Remove obsolete AfkTimer function r=def- a=ardadem

It does the same job with: 425f07c03d/src/game/server/gamecontroller.cpp (L48)

## 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: Arda Demir <ddmirarda@gmail.com>
2022-06-12 11:26:06 +00:00
bors[bot] 40dfc06d50
Merge #5387
5387: Some qol changes for practice r=def- a=kiw-q

Some quality of life changes for practice
- Unfreezes when "rescued"
- Resets speed when teleporting

## 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: kiw-q <kiw-q@fedora.email>
2022-06-12 09:19:53 +00:00
Robert Müller ffff4435c4 Remove ui_scale:
- remove config variable `ui_scale`
- remove `CUI::Scale`
- remove `CUI::SetScale`
- remove `CUI::DoLabelScaled`
- remove `CUIRect::Scale`
- use `CUI::DoLabel` instead of `CUI::DoLabelScaled`
- remove usages of `CUI::Scale()` and `CUIRect::Scale()`, or use 1.0f instead
2022-06-12 10:40:19 +02:00
bors[bot] 47b9bccd38
Merge #5391
5391: Format vector variables names (fixes #5209) r=Jupeyy a=Chairn


## Checklist

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


Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-06-12 05:24:56 +00:00
def b8e83674eb /cptime fix 2022-06-12 00:55:11 +02:00
Chairn 14f7f2e041 Remaining formatting and fix github code scanning 2022-06-11 22:03:23 +02:00
kiw-q 6725c367c9 Some qol changes for practice 2022-06-11 21:46:49 +02:00
Chairn e265a9f0a1 Remove useless float vector in vulkan backend 2022-06-11 21:43:45 +02:00
Chairn 01edaec628 Format vector variables names (fixes #5209) 2022-06-11 21:38:49 +02:00
Arda Demir c4492c27ea Move/rename AfkVoteTimer to AfkTimer 2022-06-11 21:11:28 +03:00
Arda Demir 18ab88d33e Remove obsolete AfkTimer function 2022-06-11 21:11:25 +03:00
c0d3d3v 24e1fa9a73
change m_ZeroEnergyBounceInLastTick to bool 2022-06-10 17:46:32 +02:00
c0d3d3v c579e2637f
let lasers bounce with zero energy for one tick 2022-06-10 15:16:41 +02:00
bors[bot] 37780cbe6f
Merge #5106
5106: Fix dummy intended tick sent to server r=def- a=sjrc6

fixes https://github.com/ddnet/ddnet/issues/5044

Currently the dummy gives the server the wrong IntendedTick aka PredTick which (I think) makes it impossible for the server to correctly order inputs if they come early (i.e. if you're playing with high prediction margin).

Currently with dummy copy if you switch dummy with high prediction margin it will almost always desync, with this change it doesn't desync. 

The only reason dummy works at all is because it relies on this code in the server to change the tick that was sent to be the current game tick, if you remove it then dummy hammer and dummy copy breaks but normal players are unaffected.

e9b59e72ff/src/engine/server/server.cpp (L1632-L1633) 

I marked this PR as draft because it seems to cause some unexpected side effects:

with this change if you use dummy copy in solo part your dummy will be visually delayed, this doesn't change anything but it's different from how it was before and I don't understand why. 

the sound effects from hooking with dummy copy are also not as synced as they are with the wrong tick being sent (not sure why) 

I also didn't test all dummy mechanics or any advanced dummy binds which might somehow rely on the broken behavior. 


With wrong tick sent to server:

https://user-images.githubusercontent.com/22122579/168413464-92a3a44b-3b75-4894-8fb0-54e64ff421fa.mp4

With correct tick:

https://user-images.githubusercontent.com/22122579/168413459-eb6f299c-260a-4ddb-9972-3dea504aef41.mp4






## 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: Tater <Mr.Potatooh@gmail.com>
2022-06-09 21:52:19 +00:00
Dennis Felsing d6e6599c8f Minor improvement for pagination
I thought I had committed this for #5375, but forgot
2022-06-09 11:24:19 +02:00
bors[bot] 16b8806302
Merge #5375
5375: Paginate bans (partially fixes #3691) r=Learath2 a=def-

20 elements per page, we have too many bot bans
![Screenshot 2022-06-08 at 23 53 16](https://user-images.githubusercontent.com/2335377/172724048-70d99f57-4e3c-451a-ada3-96affdf7cd6c.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: Dennis Felsing <dennis@felsin9.de>
2022-06-09 09:03:16 +00:00
Dennis Felsing 2fceb1aa27 Paginate bans (partially fixes #3691)
20 elements per page, we have too many bot bans
2022-06-08 23:48:32 +02:00
Dennis Felsing 1e94d1fa79 Remove sv_checkpoint_save 2022-06-08 21:10:40 +02:00
Dennis Felsing 7686dcc921 Add /timecp command to get another players time checkpoints
Useful to compare your performance against another player. Currently can
only be done by renaming yourself to the player's name
2022-06-08 21:10:36 +02:00
Dennis Felsing a2cd441d1c Get best Time Checkpoints back if map has one
Even if you made a better finish without time cps before. Can happen now
that we add Time CPs to existing maps:
https://docs.google.com/spreadsheets/d/1yMMBLSbS2cOSYsbIMkDZpMLaV6k930mXj5yVZF0Uuaw/edit#gid=0
2022-06-08 15:37:50 +02:00
def 5768e52a13 Minor fixes 2022-06-07 00:33:01 +02:00
Robert Müller 86e2d6791f Fix memory leak of CInput clipboard text 2022-06-06 22:14:05 +02:00
Robert Müller ec84e81e17 Replace Android-specific member variables with static variables 2022-06-06 22:14:05 +02:00
Robert Müller ff43b32257 Extract UpdateMouseState function 2022-06-06 22:06:56 +02:00
Robert Müller 9a17617a28 Let IInput::MouseRelative return true if mouse was moved 2022-06-06 22:06:56 +02:00
Robert Müller 92503fccec Add comments, order functions, fix parameter names in engine input 2022-06-06 22:06:55 +02:00
bors[bot] 3ddc4d500b
Merge #5361
5361: Refactoring: Extract CLayerTiles::ShiftImpl, BrushFlipXImpl and BrushFlipYImpl to reduce duplicate code r=heinrich5991 a=Robyt3

There is still more duplicate code but it's tricky to extract.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-06 12:00:09 +00:00
Robert Müller de199d08c0 Fix doxygen comments 2022-06-06 12:50:08 +02:00
Robert Müller e6bd84d4fd Extract CCmdlineFix to call cmdline_fix and cmdline_free automatically 2022-06-06 12:46:58 +02:00
Robert Müller e0e1f49530 Extract BrushFlipXImpl and BrushFlipYImpl 2022-06-06 11:29:52 +02:00
Robert Müller 19e97829ce Extract CLayerTiles::ShiftImpl 2022-06-06 10:59:36 +02:00
bors[bot] d49b7b1561
Merge #5351
5351: Refactoring: Use MultiByteToWideChar instead of str_utf16le_encode r=heinrich5991 a=Robyt3



## 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: Robert Müller <robytemueller@gmail.com>
2022-06-06 08:41:14 +00:00
Robert Müller fca867702e Add error messages when log message encoding cannot be converted 2022-06-06 10:28:47 +02:00
bors[bot] 62c13f2504
Merge #5360
5360: Don't write null byte r=heinrich5991 a=def-

Thanks to heinrich5991 for noticing: https://github.com/ddnet/ddnet/pull/5341#pullrequestreview-996061345

<!-- 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>
2022-06-06 08:22:34 +00:00
def 8623381529 Don't write null byte
Thanks to heinrich5991 for noticing
2022-06-06 09:47:12 +02:00
trml 2b48c376d6 Fix input getter for dummy 2022-06-06 04:17:55 +02:00
bors[bot] ef5501c4da
Merge #5332
5332: Pass output parameter to WriteFile that is required on Windows 7 r=heinrich5991 a=Robyt3

Maybe closes #5322. I can't reproduce the crash. Can you try if this fixes it, `@Chairn?`

Looks like Windows 7 needs this parameter.

Alternative to #5331.

## 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: Robert Müller <robytemueller@gmail.com>
2022-06-05 20:52:42 +00:00
bors[bot] eb92852adf
Merge #5344
5344: Log rcon messages (fixes #5342) 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>
2022-06-05 20:32:12 +00:00
def de55d49c72 Fix motd undef behavior
Conditional jump or move depends on uninitialised value(s)
   at 0x2158DA: int IServer::SendPackMsg<CNetMsg_Sv_Motd, 0>(CNetMsg_Sv_Motd*, int, int) (server.h:73)
   by 0x1FE02F: CGameContext::SendMotd(int) (gamecontext.cpp:538)
   by 0x20A874: CGameContext::ConchainSpecialMotdupdate(IConsole::IResult*, void*, void (*)(IConsole::IResult*, void*), void*) (gamecontext.cpp:3124)
   by 0x145A23: CConsole::Con_Chain(IConsole::IResult*, void*) (console.cpp:1202)
   by 0x132086: CConsole::ExecuteLineStroked(int, char const*, int, bool) (console.cpp:528)
   by 0x1323A7: CConsole::ExecuteLine(char const*, int, bool) (console.cpp:582)
   by 0x1326B1: CConsole::ExecuteFile(char const*, int, bool, int) (console.cpp:625)
   by 0x1C60E9: main (server.cpp:3874)
 Uninitialised value was created by a heap allocation
   at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x1C5900: CreateServer() (server.cpp:3755)
   by 0x1C5C4C: main (server.cpp:3818)
2022-06-05 20:52:04 +02:00
Robert Müller 3dd2df285a Use MultiByteToWideChar instead of str_utf16le_encode 2022-06-05 20:51:56 +02:00
def 735b0bdf4a fifo: read() doesn't null-terminate!
valgrind found this with ChillerDragon's integration script extension
2022-06-05 20:15:55 +02:00
def 1db79fb493 Log rcon messages (fixes #5342) 2022-06-05 19:26:39 +02:00
bors[bot] 152ee93e16
Merge #5347
5347: Fix deleting envelopes not updating sounds r=def- a=C0D3D3V

Original fix by Ravie... updated to latest code

I do not really know how to trigger the bug, but for me adding and deleting sounds to the map, worked.... Since it is only the updated version from Ravie I think it works
`@HiRavie` maybe you can test it again

## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-05 15:20:58 +00:00
c0d3d3v 52b717f848
Fix deleting envelopes not updating sounds 2022-06-05 15:21:00 +02:00
def af3b1bb0e7 Log rcon messages (fixes #5342) 2022-06-05 12:44:15 +02:00
def ea5999d1da Don't write aAnsi when it's not filled (fixe #5340) 2022-06-05 11:30:54 +02:00
bors[bot] b554039740
Merge #5320
5320: Fix prediction input timing r=def- a=trml

Fixes #5307 by updating the prediction to use the new input handling from #5032, and also removed some now no longer used code.

## 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: trml <trml@users.noreply.github.com>
2022-06-04 22:37:03 +00:00
Robert Müller fda98a3ef4 Rename variables and use class in crapnet tool 2022-06-04 17:21:27 +02:00
Robert Müller 7fa3bb0842 Rename variables and use class in config_common.h 2022-06-04 17:21:26 +02:00
Robert Müller 8258effb33 Move/rename variable declarations in config_store 2022-06-04 17:21:26 +02:00
Robert Müller e8bd26857b Move/rename variable declarations in config_retrieve 2022-06-04 17:21:26 +02:00
Robert Müller 081881efcc Move variable declaration in dilate tool 2022-06-04 17:21:26 +02:00
Robert Müller 1f51e6e06a Fix variable name in dummy_map tool, add storage check 2022-06-04 17:21:26 +02:00
Robert Müller fbfbc78be4 Move/rename variable declarations in map_extract tool 2022-06-04 17:21:25 +02:00
Robert Müller 4bc1aeeb7a Move/rename variable declarations in map_convert_07 tool 2022-06-04 17:21:25 +02:00
Robert Müller d9848728e3 Move/rename variable declarations in map_diff tool, add checks 2022-06-04 17:21:25 +02:00
Robert Müller de3bb1ca8c Move/rename variable declarations in map_replace_image tool 2022-06-04 17:21:25 +02:00
Robert Müller 3003608e40 Move/rename variable declarations in map_resave tool 2022-06-04 17:21:25 +02:00
Robert Müller 1505fbe026 Move/rename variable declarations in map_optimize tool 2022-06-04 17:21:24 +02:00
hus3h db529318ab Unfreeze character after teleporting in practice 2022-06-03 21:31:30 +03:00
bors[bot] 36d0c0dcb4
Merge #5334
5334: fix pixel porridge in freeze and ninja bar r=Jupeyy a=C0D3D3V

fixes #5319

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-03 16:31:26 +00:00
c0d3d3v c33e0c124e
fix pixel porridge in freeze and ninja bar 2022-06-03 18:27:30 +02:00
bors[bot] 4ead727692
Merge #5330
5330: Actually fix capital /WHISPER r=Jupeyy a=def-

As reported by kiwq

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-06-03 14:55:30 +00:00
Robert Müller e5d2b815eb Pass output parameter to WriteFile that is required on Windows 7 2022-06-03 15:55:57 +02:00
Dennis Felsing 9807625ca4 Actually fix capital /WHISPER
As reported by kiwq
2022-06-03 15:26:35 +02:00
bors[bot] 537be53fc2
Merge #5329
5329: Let the names in the mini score hud overflow to the left r=def- a=C0D3D3V

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-06-03 12:48:50 +00:00
c0d3d3v 090ae5e170
Let the names in the mini score hud overflow to the left 2022-06-03 13:57:39 +02:00
bors[bot] ce795572d2
Merge #5327
5327: Add CLockScope r=heinrich5991 a=def-

Remove unused lock and scope in threading.h

Not sure if this is preferred

We could also try switching to std::mutex and lock_guard

<!-- 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: Dennis Felsing <dennis@felsin9.de>
2022-06-03 10:58:17 +00:00
bors[bot] 6b7554f306
Merge #5325
5325: Reset colors at end of line (fixes #5324) r=heinrich5991 a=def-

`@ChillerDragon` Can you test this?

## 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: Dennis Felsing <dennis@felsin9.de>
2022-06-03 10:32:26 +00:00
Dennis Felsing 129205d6b9 Reset colors at end of line (fixes #5324) 2022-06-03 12:22:37 +02:00
Dennis Felsing 51909c19ab Add CLockScope
Remove unused lock and scope in threading.h

Not sure if this is preferred

We could also try switching to std::mutex
2022-06-03 12:21:23 +02:00