Commit graph

8424 commits

Author SHA1 Message Date
Dennis Felsing c174274edc Fix tooltip locations after window resize (fixes #5026) 2022-04-27 01:00:23 +02:00
Jupeyy b23e60c077 Allow onfly FSAA change under Vulkan 2022-04-26 21:09:55 +02:00
c0d3d3v bc80d83ec9
fix WalkTime for negativ positions 2022-04-26 09:58:31 +02:00
c0d3d3v 68036e6a19
remove cl_predict_ddrace 2022-04-25 15:57:10 +02:00
bors[bot] 1dea02d456
Merge #5018
5018: fix dummy hammer interval, this became incorrect after a few days r=def- a=C0D3D3V

Reported by Konsti here: https://discord.com/channels/252358080522747904/293493549758939136/967073772836376586
I have tested the change on Justfly with my dummy :D since it is exactly the same interval as before it should not change any Physics. 

## 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-04-25 13:17:01 +00:00
c0d3d3v 2f4ccb94de
fix dummy hammer interval, this became incorrect after a few days 2022-04-25 14:10:32 +02:00
bors[bot] 9be59a990b
Merge #4678
4678: Ignore F5 key press when ingame menu is open r=heinrich5991 a=def-

Since ghost menu and browser use F5 already to refresh, and having a
bind on it, would cause both actions at once.

I believe it makes sense to have this special handling only for F5,
other F-keys don't have this problem since we don't use them in any
menus.

<!-- 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-04-24 23:04:58 +00:00
Dennis Felsing 394b2a02e0 Remove cl_show_quads bind 2022-04-24 12:28:04 +02:00
heinrich5991 103b663662 Rename ActCur, some "actual" → "current"
Seems like it got introduced by means of the false friend "actual" ≠
"aktuell" = "current".
2022-04-23 00:42:37 +02:00
bors[bot] e06b3d9579
Merge #5007
5007: Get rid of optional, not available on Debian9 build r=edg-l a=def-

Since we don't have full C++17 support with the GCC version there.

## 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-04-19 07:57:40 +00:00
Dennis Felsing 4e3d5c5626 Get rid of optional, not available on Debian9 build 2022-04-19 09:56:28 +02:00
bors[bot] 08f856d741
Merge #5004
5004: add livefreeze commands to rcon r=def- a=edg-l

<!-- 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: Edgar Luque <git@edgarluque.com>
Co-authored-by: Edgar <git@edgarluque.com>
2022-04-19 07:35:42 +00:00
Edgar 6b15abeeae
put it above left up down 2022-04-19 08:58:26 +02:00
Edgar 50e6744d91
fix typo 2022-04-18 16:38:17 +02:00
Edgar b9fc6bc8a4
add livefreeze commands to rcon 2022-04-18 16:37:35 +02:00
Edgar 646162eb09
make super ignore livefreeze, fix #4973 2022-04-18 15:40:39 +02:00
bors[bot] c39448ca53
Merge #5000
5000: Inform about client restart when changing GPU r=Jupeyy 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-04-18 08:22:18 +00:00
def 87b7550a4a Inform about client restart when changing GPU 2022-04-18 10:16:24 +02:00
bors[bot] fdcb1576bd
Merge #4946 #4993 #4998 #4999
4946: Better forced viewport handling r=def- a=Jupeyy

For #4939

For the performance warnings refering `vkCmdClearAttachments` ignore them, because this function is only called when:
- clear color is changed(open/close editor, switch between entities) to directly flush a clear with the new color
- ~~a viewport is used that is "worse" than 5:4 (I don't really want to switch to non renderpass clear completly, since it *can* improve performance -- https://community.arm.com/arm-community-blogs/b/graphics-gaming-and-vr-blog/posts/vulkan-samples "Therefore, avoid using LOAD_OP_LOAD and vkCmdClearAttachments and use LOAD_OP_CLEAR or LOAD_OP_DONT_CARE whenever possible.")~~
thinking about it, maybe i can also drop this call now, since its dynamic viewport anyway

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


4993: Unselect text after ctrl-u r=Jupeyy 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)


4998: Refactor tooltips and add some more r=def- a=edg-l

Refactored tooltips so they render last, otherwise stuff rendered after the call is overlapped.

Also renamed "Alpha" to "Opacity" which is more clear to non-devs.

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


4999: Respect GPU type better r=def- a=Jupeyy

fixes #4994

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Edgar Luque <git@edgarluque.com>
2022-04-18 08:06:49 +00:00
Edgar eba7a14cb4
add missing end new lines 2022-04-18 09:55:50 +02:00
Edgar fbbcbb6d2f
remove designated initializers because we live in 2017 2022-04-18 09:44:13 +02:00
Edgar 74286d1dd4
format code 2022-04-18 09:34:21 +02:00
Edgar faab2ded74
Refactor tooltips to render last, add some tooltips 2022-04-18 09:34:05 +02:00
def 041c565534 Unselect text after ctrl-u 2022-04-18 00:22:11 +02:00
Zwelf 887e6673fe Initialize CCharacter::m_NumInputs of game server 2022-04-17 23:06:35 +02:00
Noa 482d45484b fix gun sounds for blockworlds servers 2022-04-16 19:36:25 +02:00
bors[bot] e81ebfb0bb
Merge #4964 #4984 #4985
4964: allow freecam to center on world border r=def- a=C0D3D3V

fixes #4953

I think the 200 units or 6.25 blocks more should not bother anyone. 
![fix 2022-04-09_15-14](https://user-images.githubusercontent.com/14315968/162576159-7d73eb8c-b9c9-471b-bed0-7477568376d6.png)
under some circumstances, it will only move to x=1 (or in blocks 0.03) but this should be negligible.  

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


4984: Don't read from backend if Init failed r=def- a=Jupeyy

fixes #4981 

This `bug` should not create any uninitended behavior, since these values get reinitialized after the backend creation worked

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


4985: Close sockets r=def- a=ChillerDragon

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

Fixes

```
 Direct leak of 205848 byte(s) in 1 object(s) allocated from:
    #0 0x4a200d in malloc (/home/runner/work/ddnet/ddnet/san/DDNet-Server+0x4a200d)
    #1 0xc7fe3f in net_udp_create /home/runner/work/ddnet/ddnet/src/base/system.cpp:1640:41
    #2 0xbf2d0b in CNetServer::Open(NETADDR, CNetBan*, int, int) /home/runner/work/ddnet/ddnet/src/engine/shared/network_server.cpp:55:13
    #3 0x568cdc in CServer::Run() /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:2448:60
    #4 0x5a922b in main /home/runner/work/ddnet/ddnet/src/engine/server/server.cpp:3718:21
    #5 0x7ff75f52c0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b2)
```

## 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
- [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>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
2022-04-15 20:37:18 +00:00
bors[bot] 740a18436d
Merge #4988
4988: Update voting.cpp r=def- a=bencie

fix console help text for callvote parameters

<!-- 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: bencie <78111412+bencie@users.noreply.github.com>
2022-04-15 20:18:25 +00:00
bencie 5401364813
Update voting.cpp
fix console help text for callvote parameters
2022-04-15 18:16:28 +02:00
Jupeyy d892de2b03 Fix editor animation offset time being affected by the animation speed factor 2022-04-15 10:05:39 +02:00
c0d3d3v 9dc2141ded
remove shadow variables
fix GetDigitsIndex Parameters
remove unused y addidion in debughud
2022-04-14 14:46:22 +02:00
c0d3d3v a9c8b344a2
Player position, speed and angle can now be displayed in the HUD.
- Added RenderMovementInformation() to the HUD
- Use m_Width instead of recalculating the display width each time in hud.cpp
- Reworked Debug HUD:
    - Display velspeed.x*ramp and velspeed.y instead of velspeed*ramp
    - Show unit of speed
    - The graph for the velspeed.x*ramp behavior (if dbg_tuning is active) is now nicer and usable. A second graph zooming in on the turning point has been added.
    - The velspeed.x*ramp graph will be redrawn only when new tuning parameters are added
- The target angle used to draw the tees is now calculated using the m_TargetX, m_TargetY in DDNetCharacterDisplayInfo if available.
- Added m_TargetX, m_TargetY and m_RampValue to DDNetCharacterDisplayInfo Snap (m_RampValue has a precision of one thousandth)
- Added CGraph::InsertAt() to create static Graphs
- Added "assets/hud" to initial created Directories
- Added Settings to hide Dummy Action HUD and Player Movement HUD cl_showhud_dummy_actions, cl_showhud_player_position, cl_showhud_player_speed, cl_showhud_player_angle
- Added Pointer to m_PrevExtendedDisplayInfo, for calculation of interpolated Angle in Player Rendering
- Added GetDigitsIndex(int Value, float Max); to hud.cpp
2022-04-14 13:42:19 +02:00
c0d3d3v be75b80520
Render Dummy Actions on the right side of the screen
- Render Practice Mode next to the other player effects
- Make Recording Notification Position more symetric
2022-04-14 13:40:45 +02:00
c0d3d3v 940047fb8e
Add Practice Mode Symbol next to the timer
- Add new hud.png
- expand DDNetCharacterDisplayInfo with m_IsInPracticeMode
2022-04-14 13:40:45 +02:00
c0d3d3v ef468e8181
remove constant scaling factors and constant y offset
- move weapons above jumps
- move effects up if no jumps are available
2022-04-14 13:40:45 +02:00
c0d3d3v 6159b181e3
use QuadsSetSubsetFree also for freeze bar
- set the proportions of the used area of the end pieces for the progress indicator as constants.
- do not manipulate the position and length within the render function
2022-04-14 13:40:44 +02:00
c0d3d3v 670da66ec1
add vertical ninja bar 2022-04-14 13:40:44 +02:00
c0d3d3v a4b6558ff6
load CNetObj_DDNetCharacterDisplayInfo into CCharacter 2022-04-14 13:40:44 +02:00
c0d3d3v 09bd10666c
increase height of freeze bar
- cut of 10% of top and bottom of progress bar sprites
2022-04-14 13:40:44 +02:00
c0d3d3v e71578e468
Add DDNetCharacterDisplayInfo NetObj
- Show all components of new HUD also in Spectator (Ninja Bar, Freeze
  Bar and Jumps)
- hide freeze bar if you sit in freeze
2022-04-14 13:40:40 +02:00
c0d3d3v b403f474a0
Add Freeze Bar 2022-04-14 13:40:05 +02:00
c0d3d3v 78a0a3d31e
add deep and live frozen display 2022-04-14 13:38:56 +02:00
c0d3d3v 63d4591fe5
Make Ninja Bar Smooth
- Added new version of hud.png
2022-04-14 13:38:56 +02:00
c0d3d3v b942b7a72a
Show weapon no hit only if the tee got the weapon
make ninja sword bigger
show negative jumps correct
move icons up if there is an empty space
2022-04-14 13:38:56 +02:00
c0d3d3v de750e81d4
display ninja Bar 2022-04-14 13:38:55 +02:00
c0d3d3v 3957a7404e
move m_Ninja in Character Core 2022-04-14 13:38:55 +02:00
c0d3d3v 320e9e030f
Rename Read() function to avoid equal naming 2022-04-14 13:38:55 +02:00
c0d3d3v 5ac46f9bd5
Many new indicators have been added to the HUD
- A display of the weapons available to the player
- The weapon the player is carrying is highlighted
- Indicators for the special abilities of the player
- Indicators for abilities taken away from the player
- Control indicators for dummy controls
- The jump indicator has been slightly adjusted
2022-04-14 13:38:55 +02:00
c0d3d3v 7abeaf0cd7
Preparations for the new HUD
- add pickup sprites to 0.6 data source
- New Enum for the 4 pickup categories
- Remove the unnecessary access to client_data7 for the pickup sprites
- Use the correct sprite set for the HUD sprites
- Read existing weapons into m_Predicted so that this information matches the last snap if the CCharacter is not predicted
- Move m_aWeapons from CCharacter to CCharacterCore for a more consistent data model since it was previously defined twice in the server and client (further so that it can be accessed with m_Predicted)
- Read CNetObj_Character into m_Predicted so that this information matches the last snap if the CCharacter is not predicted.
2022-04-14 13:38:55 +02:00
c0d3d3v b23811b197
show local available and used jumps, in spec only available jumps 2022-04-14 13:38:54 +02:00
c0d3d3v a0164df3da
Small cleanup of HUD + comment on distance calculation at sound 2022-04-14 13:38:54 +02:00
Jupeyy 53e121841e
Return the quad offset of the first added quad, when adding new quads 2022-04-14 13:38:54 +02:00
c0d3d3v 755c260401
Add HUD Sprites, LoadHudSkin() and HUD Assets Tab 2022-04-14 13:38:42 +02:00
bors[bot] f60ae47be1
Merge #4976
4976: fix rendering of nameplates for spectating tees r=def- a=C0D3D3V

bug was introduced by #4870

## 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-04-12 21:48:45 +00:00
c0d3d3v e65bfa6350
fix rendering of nameplates for spectating tees (bug introduced by #4870) 2022-04-12 23:30:26 +02:00
bors[bot] c16ad24bec
Merge #4974
4974: Its is not ctrl+leftclick but ctrl+rightclick r=def- a=ChillerDragon

Thanks to `@c0d3d3v` for debugging my left right weakness lmao.

I initially intended left click but that was conflicting with navigation already so I switched it. But not the description.

Co-authored-by: ChillerDrgon <ChillerDragon@gmail.com>
2022-04-11 22:27:17 +00:00
Tater 712b3f041d fix local hookline direction when mouse is exactly center 2022-04-11 06:32:02 -05:00
ChillerDrgon 39be867e7b Its is not ctrl+leftclick but ctrl+rightclick 2022-04-11 11:28:05 +02:00
c0d3d3v 5ba4ddd6dc
fix calculation of m_Angle of CCharacterCore 2022-04-10 19:12:56 +02:00
c0d3d3v aeaaa67581
allow freecam to center on world border
fixes #4953
2022-04-09 15:24:57 +02:00
bors[bot] b12d334063
Merge #4960
4960: fix #4956 r=def- a=C0D3D3V

if the snapshots are in a different order than predicted SPEC_FREEVIEW was forced although a different ID is desired in NETOBJTYPE_SPECTATORINFO.


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] Written a unit test if it works standalone, system.c especially
- [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-04-08 15:07:40 +00:00
c0d3d3v 97d2de7af8
fix #4956
if the snapshots are in a different order than predicted SPEC_FREEVIEW was forced although a different ID is desired in NETOBJTYPE_SPECTATORINFO.
2022-04-08 16:38:37 +02:00
ChillerDrgon d1798d23da Advertise ctrl+left mouse in tooltip 2022-04-08 15:38:38 +02:00
Dennis Felsing 8ef1f35f89 Revert "CGameClient::LoadMapSettings: Load the default tuning params by default"
This reverts commit 754562ce0b.

This breaks rendering for ddnet mode, thanks to cheeser0613 for report
2022-04-08 15:05:53 +02:00
ChillerDrgon fe712214a9 Editor: ctrl+leftclick tile to select layer 2022-04-08 14:59:33 +02:00
Dennis Felsing 2eb403be93
Merge pull request #4895 from def-/pr-practice-load
Reset practice when loading team (fixes #4894)
2022-04-08 01:37:17 +02:00
Edgar 3c904ffbb4
fix conflict 2022-04-07 09:46:02 +02:00
Edgar 0b8152f6e3
add 1 second delay to tooltips 2022-04-07 09:43:49 +02:00
Edgar 527835e171
fix style 2022-04-07 09:43:49 +02:00
Edgar 17d93f63e3
implement DoTooltip 2022-04-07 09:43:47 +02:00
Dennis Felsing 070975a174 Version 16.0.3 2022-04-05 17:43:31 +02:00
bors[bot] 34993f020c
Merge #4952
4952: Fix missing renamed shadowed variable r=def- a=Jupeyy

Caused by commit 8134f9fa55

Reported by Silex on discord:

https://user-images.githubusercontent.com/6654924/161612015-a04d6479-ac37-465e-929f-2cf5b7264103.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: Jupeyy <jupjopjap@gmail.com>
2022-04-04 20:45:21 +00:00
Jupeyy cd1a34c411 Fix missing renamed shadowed variable 2022-04-04 20:51:19 +02:00
Dennis Felsing 6caa29df7c Only try joining tutorial once we have server list
Otherwise quickly pressing enter you end up not joining tutorial
2022-04-04 10:17:39 +02:00
bors[bot] 4c1f60acfd
Merge #4854
4854: Replace static const in header with extern r=def- a=Chairn

This should prevent symbols from being demultiplied in different translation unit even if they are not used. Difference in size is as follow using a release build and no option set with cmake. With clang, difference is inferior to 1kB for any executable. With gcc, client size is reduced by 3.5kB.

I couldn't run the test suite (see https://github.com/ddnet/ddnet/issues/4853)

## 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-04-03 08:34:48 +00:00
Chairn 1f7b3159af ms_Pool* --> gs_Pool* 2022-04-03 01:30:00 +02:00
Chairn 21e64cbdcb Added external linkage instead of static const 2022-04-03 01:12:27 +02:00
def 04f51a55bb Version 16.0.2 2022-04-02 21:23:47 +02:00
bors[bot] 2be8dc69cb
Merge #4941
4941: Keep DDNet window responsive for loading tasks r=def- a=Jupeyy

This will keep the DDNet window responsive, especially when loading the client the first time this is important, so that SDL2 events aren't lost.

Menu's RenderLoading allows up to 60 frames per second, so calling it too often cannot really happen.

For reloading (skins&assets) / demo loading etc. it only swaps to the render screen after half a second passed. Even if this might not be the nicest, it's still better than just freezing the window.

I hope this addresses issues from #4936



## 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-04-02 15:19:26 +00:00
Jupeyy f7e3662cd7 Keep DDNet window responsive for loading tasks 2022-04-02 17:03:23 +02:00
c0d3d3v 549fd7c784
fix color of ghost 2022-04-01 23:48:25 +02:00
Dennis Felsing 27488f042f Fix IME issue (fixes #4888)
by terminating string instead of assuming that rest of chars are \0,
which was just luckily true before.
2022-03-31 12:52:24 +02:00
Dennis Felsing 2c1dfb3684 m_DisplayStr -> m_aDisplayStr 2022-03-31 12:52:24 +02:00
bors[bot] f953a9850e
Merge #4930
4930: Adjustable hook collision line alpha r=def- a=sjrc6

Suggested by louis in https://github.com/ddnet/ddnet/issues/4928


![image](https://user-images.githubusercontent.com/22122579/160996132-68fe36c1-7e64-4b7e-b1d7-f41c11d69e51.png)
![image](https://user-images.githubusercontent.com/22122579/160996410-3447bc23-73e3-4f99-a22e-cfa8486582d1.png)


- [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: Tater <Mr.Potatooh@gmail.com>
2022-03-31 07:45:20 +00:00
bors[bot] 11af040689
Merge #4927
4927: Revert "Revert "Update players.cpp"" (fixes #4926) r=Jupeyy a=def-

This reverts commit 36bfe24522.

Tested and couldn't reproduce the original problem with this.

<!-- 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-03-31 07:08:36 +00:00
Tater 3a197aa3da Hook collision line alpha 2022-03-30 20:15:27 -05:00
bors[bot] ebb092211a
Merge #4924
4924: fix gohst transparency of hook hand and ninja skin r=def- a=C0D3D3V

 https://streamable.com/oquu51
 
 reported by lomination 
fixes #4207 again

## 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
- [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-03-30 21:35:20 +00:00
Dennis Felsing 68c7044912 Revert "Revert "Update players.cpp"" (fixes #4926)
This reverts commit 36bfe24522.
2022-03-30 23:29:35 +02:00
c0d3d3v 005667b99c
fix gohst transparency of hook hand and ninja skin 2022-03-30 20:40:46 +02:00
bors[bot] c592e71353
Merge #4917
4917: Use std::size instead of sizeof(a) / sizeof(a[0]) r=Jupeyy 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: Dennis Felsing <dennis@felsin9.de>
2022-03-30 17:08:27 +00:00
Dennis Felsing 843acf6a5a Use std::size instead of sizeof(a) / sizeof(a[0]) 2022-03-30 18:55:04 +02:00
Dennis Felsing 36bfe24522 Revert "Update players.cpp"
This reverts commit ccc23161f6.

Caused inaccuracies. I tried checking what calculations the server does,
but couldn't figure it out quickly.
2022-03-30 17:41:59 +02:00
Dennis Felsing 3d67ccfa1b Version 16.0 2022-03-30 14:58:58 +02:00
srdante ddba1dfdc2 Fix styles 2022-03-29 17:39:16 -03:00
srdante b642f519c1 Fix whisper sending/receiving differentiation 2022-03-29 17:35:50 -03:00
srdante b98a137064 Always show /top local records 2022-03-28 20:20:23 -03:00
srdante 3ee8070a46 Fix SQL duplicated top and PlayerTeamTop5 2022-03-28 16:53:35 -03:00
srdante dba7889399 Differentiate team top 5 from player team top 5 2022-03-28 16:51:50 -03:00
bors[bot] 404d9ecb7f
Merge #4900
4900: Super: Don't send sounds to self r=heinrich5991 a=def-

As reported by louis on Discord

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-03-28 18:17:40 +00:00
Dennis Felsing 751a828109 Fix team not started message (fixes #4884)
Thanks to c0d3d3v for noticing
2022-03-28 16:29:23 +02:00
def 46f20754d5 Super: Don't send sounds to self
As reported by louis on Discord
2022-03-26 16:49:46 +01:00
bors[bot] ea852d8f1c
Merge #4852
4852: Fixed some useless double promotion r=def- a=Chairn

Double promotion occurs quite often when an operator is an hidden double, like constants written without the 'f' at the end. We might get a tiny micro improvement. Unfortunately, we can't do anything for all the double promotion occurring in printf like functions as it is the default for both C and C++.

Only this line might change physics:
4d47fcda09 (diff-d76009083687ba43c59dc7bb2c7357457c999c2eb9d913967d598e913c6fd01fR406)

## 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: Chairn <chairn.nq@hotmail.fr>
2022-03-25 18:29:02 +00:00
Dennis Felsing 939d5436b0 Retry tutorial join after 5 seconds 2022-03-25 17:37:55 +01:00
Dennis Felsing ebd76d9db5 Add tutorial button in main menu
As suggested by cheeser0613
2022-03-25 17:14:47 +01:00
Dennis Felsing b96b23d9cb Reset practice when loading team (fixes #4894)
I hope this doesn't give a chance to cheat. We also reset practice when
killing a team, so loading can be considered as similar to killing?
2022-03-25 10:09:47 +01:00
bors[bot] e8fc1758a7
Merge #4885 #4889
4885: Add dropdown icon r="def-" a=Jupeyy

![image](https://user-images.githubusercontent.com/6654924/159912581-f382179d-9d66-41f8-8a41-647e4e34edf5.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)


4889: Fix text texture name Texture -> TextureOutline r="def-" a=Jupeyy



## 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-03-24 21:26:33 +00:00
Chairn 3778e0ff6b Format member variable's name correctly 2022-03-24 19:30:26 +01:00
Chairn 5fe3e9af85 clang-format 2022-03-24 17:59:49 +01:00
Chairn 6086893fa6 Renamed all shadowing/shadowed variables 2022-03-24 17:59:49 +01:00
bors[bot] 309283d551
Merge #4870
4870: Don't render tees or nameplates offscreen r=def- a=sjrc6

It seems difficult to measure the fps from the ingame graph or fps counter so these numbers are from NVidia fps overlay

FPS on full multeasymap server, fullscreen, vulkan renderer
/showall 0 - 4500
/showall 1 - 2100
/showall 1 (after preventing offscreen render) - 4200

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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-03-24 14:44:26 +00:00
Tater 5c29456dd8 Improve nameplate boundary and clarify comments 2022-03-24 15:43:58 +01:00
bors[bot] b1e88dd9fa
Merge #4872
4872: Support uppercase commands for /r and /w r=Jupeyy a=def-

As reported by  perrodecerro 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: Dennis Felsing <dennis@felsin9.de>
2022-03-24 12:15:18 +00:00
Jupeyy 5459895dc0 Add dropdown icon 2022-03-24 13:05:21 +01:00
Chairn e0c6106930 Revert time to double type 2022-03-23 19:34:51 +01:00
Chairn 49dd2b9ced Revert possible physic change 2022-03-23 18:30:18 +01:00
Chairn d4aac67929 Fixed some useless double promotion 2022-03-23 18:22:08 +01:00
Tater abaf216f5c Seperate hook collision line from player rendering 2022-03-22 19:19:44 -05:00
Dennis Felsing 252110a66b Support uppercase commands for /r and /w 2022-03-22 23:39:58 +01:00
Jupeyy afb205cf6f Check pTexName for nullptr, fix wrongly height->width 2022-03-22 20:28:33 +01:00
Tater 54e8b64136 Don't render tees or nameplates offscreen 2022-03-22 11:20:21 -05:00
bors[bot] 43882604e8
Merge #4849
4849: Fix queries for MySQL 8.0 r=def- a=srdante

Fixes #4815 

**What was changed:**
- All Rank columns name were scapped since MySQL 8.0 interprets the word "Rank" as a internal function or constant (A good practice would be if all column names were escaped).
- All group by have been modified to have all columns that need to be grouped, in order to respect the `ONLY_FULL_GROUP_BY` flag set by default on MySQL 8.0. On these group bys were also included the columns that are used in the `window`, since are also required by the same tag.

**What is missing on this pull request:**
- "Add a mysql installation in .github workflow so we test this in addition to mariadb, then we don't break it again so easily."

**The behavior of all queries remains the same.**

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

## Checklist

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


Co-authored-by: srdante <minidantebtc@gmail.com>
2022-03-21 23:13:52 +00:00
srdante 402387095d Fix ShowRank() ranking order by 2022-03-21 20:05:28 -03:00
srdante 2edeb21d34 Change scaped Rank name to Ranking 2022-03-21 20:04:05 -03:00
bors[bot] e632859707
Merge #4687
4687: Add Vulkan backend r=def- a=Jupeyy

This adds a Vulkan 1.0 backend and new features to the graphic settings to select the GPU(if multiple Vulkan GPUs are supported, and a new list for renderers (see screenshot below))

Mutleasy benchmark (CPU bound):
Vulkan multithreaded, single threaded vs OpenGL
(lower graphs are histograms, code by `@Chairn` )

Y = Frametimes in microseconds
lower graphs = amount of frametimes that happened (histogram)
(since the renderer speed differs, you should look at it more like a spread of values rather than the actual values)
![Figure_1](https://user-images.githubusercontent.com/6654924/153448356-941222a3-8bd3-424d-8685-a43389a4f691.png)

Vulkan is especially good in these scenarios, beating OpenGL 3.3 almost 3x with my setup (~600-700 FPS vs. ~1700-1800FPS)


Remaining TODO list:
- [x] compile shaders in cmake ( e.g. `https://gist.github.com/evilactually/a0d191701cb48f157b05be7f74d79396` )
- [ ] needs windows vulkan libraries
- [x] add build instructions (packages)
- [x] get away from coherent memory even for staging buffers (flushing memory just seems to be faster)
- [ ] a lot of testing :P

![screenshot_2022-02-10_17-13-46](https://user-images.githubusercontent.com/6654924/153449066-38d8741b-60c1-4c0c-ba50-57cc07aa2f9d.png)

![screenshot_2022-02-10_17-13-50](https://user-images.githubusercontent.com/6654924/153449075-91ef3b7b-7238-4cad-9a4c-aeb2d784238b.png)


If there are bugs and it's crashing inside the driver the best you can do is to start the client with `dbg_gfx 4` which will (if supported) add Khronos standard validation layers + verbose debugging information + validation layer extensions, e.g. a synchronization validation layer and validation errors reported by the GPU driver directly.
(setting for dbg_gfx (0: none, 1: minimal, 2: affects performance, 3: verbose, 4: all))

edits:
fixes #3547 (probably fixes it, fixed some data races)

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-21 14:20:54 +00:00
Jupeyy fbeba9eb5f Add Vulkan backend 2022-03-21 12:39:51 +01:00
Chairn bd5bfa453d clang-format 2022-03-21 05:55:01 +01:00
Chairn 4cc815711b Added direction enumeration for the editor 2022-03-21 05:53:36 +01:00
srdante 22f2f8b396 Fix Top command showing multiple ranks for the same player 2022-03-21 00:15:29 -03:00
srdante 29726dc0cb Fix queries for MySQL 8.0 2022-03-20 23:48:59 -03:00
Jupeyy 14ac5cf297 lazy load editor textures
improve entities texture flags
2022-03-20 18:03:33 +01:00
Jupeyy e54da1b396 Cleanup backend a bit for vulkan 2022-03-20 18:03:25 +01:00
bors[bot] 564a59d603
Merge #4845
4845: Enable -Wshadow=local r=Jupeyy a=def-

> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code

<!-- 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-03-20 16:45:22 +00:00
ChillerDragon b34302238f Do not mute if spamprotection is off (closed #4816) 2022-03-20 14:12:19 +01:00
def 8134f9fa55 Enable -Wshadow=local
> Warn when a local variable shadows another local variable or parameter.

Found one actual bug in graphics_threaded.cpp

Should reduce confusion in the future when reading source code
2022-03-20 13:24:34 +01:00
bors[bot] 12b7ff3d4c
Merge #4842
4842: Replace browser icons with font icons r=def- a=Jupeyy

Replace and remove the menu icons and use the font icons instead.
Personally i find them more attractive, and objectivly they are resolution indepentent.

Opinions?

before:
![screenshot_2022-03-19_11-26-51](https://user-images.githubusercontent.com/6654924/159117535-6e027259-b7bc-43ff-b87b-80aabc368e97.png)

![screenshot_2022-03-19_11-31-02](https://user-images.githubusercontent.com/6654924/159117539-a0617fe6-4d30-407e-9b5c-588bd27c6834.png)

after:
![screenshot_2022-03-19_11-45-24](https://user-images.githubusercontent.com/6654924/159117919-d0deb3c7-2631-4233-a7e0-2b1e83362248.png)

![screenshot_2022-03-19_11-30-41](https://user-images.githubusercontent.com/6654924/159117546-db8f68d7-253c-4b99-9a8d-9f6668d0cb11.png)

![screenshot_2022-03-19_11-44-16](https://user-images.githubusercontent.com/6654924/159117880-0523ee15-e5f0-495c-9f5b-fe3e897efe79.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: Jupeyy <jupjopjap@gmail.com>
2022-03-20 10:51:14 +00:00
bors[bot] f49afca3dc
Merge #4818
4818: Add str_startswith_nocase and str_endswith_nocase r=def- a=ChillerDragon

Gets rid of the more complex str_comp_nocase_num usage

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] Written a unit test if it works standalone, system.c especially
- [ ] 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: ChillerDragon <ChillerDragon@gmail.com>
2022-03-20 10:27:18 +00:00
def 3d47274f28 Add tutorial joining code and tutorial map 2022-03-19 23:35:27 +01:00
Jupeyy daea2feca9 Switch to Font-Awesome 2022-03-19 19:14:30 +01:00
Jupeyy 343a5291e5 Replace browse icons with icon font 2022-03-19 18:35:43 +01:00
srdante 216accbe73 Fix style warning 2022-03-18 20:37:20 -03:00
srdante 9dc944ab03 Fix player death effect color 2022-03-18 20:31:49 -03:00
bors[bot] 3fa7edcf41
Merge #4837 #4838
4837: Fix demo render menu r=Jupeyy a=def-

As reported by bencie on Discord

Old:
![Screenshot 2022-03-18 at 14 23 53](https://user-images.githubusercontent.com/2335377/159011986-de9028dc-8c76-40d6-9449-93d05ca8a781.png)
New:
![Screenshot 2022-03-18 at 14 30 44](https://user-images.githubusercontent.com/2335377/159011980-b8e3c260-8439-4e09-a4da-384458abc27a.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)


4838: Update Korean language file (by 車魄) r=Jupeyy a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-18 18:14:09 +00:00
Dennis Felsing 71432bd19d Fix demo render menu 2022-03-18 16:28:47 +01:00
Dennis Felsing 748fb0ea5f Add contributor 2022-03-18 14:41:48 +01:00
bors[bot] 971f839c17
Merge #4832
4832: Add further contributors, thanks to all! r=Jupeyy a=def-

I hope I didn't miss anyone.

## 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-03-17 18:06:38 +00:00
Dennis Felsing 1501c28c1d Add further contributors, thanks to all! 2022-03-17 18:09:36 +01:00
bors[bot] c712b756ab
Merge #4826
4826:  Improvement of the automatic completion of player names in chat r=def- a=C0D3D3V

This should fix #659 or just improve the order of player names if you use automatic completion. 

So far it was so that first at the beginning of the name was searched for the input and then there was a second iteration through the alphabetically sorted list with names where the input does not appear at the beginning.

Now it is so that the position of the input in the name is used as an evaluation criterion to determine the position in the suggestion list. If the input is found at the beginning of the name, the score is 0 and the name is suggested first. If the input is found at position 6 in the name, the score is 6 and the name appears later in the suggestion list. If two names have the same score, the alphabetical sorting remains.


## 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-03-16 15:32:49 +00:00
c0d3d3v 92eaccfcb2
Improvement of the automatic completion of player names in chat 2022-03-16 15:25:56 +01:00
bors[bot] d172a7fd2a
Merge #4802
4802: make the vanilla teams independent from the ddrace teams r=def- a=C0D3D3V

Fixes #259
Because my changes have some effects on the display and thus people who like it as it was could bother, I have described my changes in detail here.

Until now it was the case that players who are in /spec (while sv_pausable is activated) or the own active player who is in /pause or /spec are in the Spectators team.

With this change this is no longer the case. I took the opportunity to make a few adjustments in the display logic. 

On the server side nothing had to be adjusted, because there was already a separation of the normal and the ddnet teams. 


1. Regarding the specators component:

I intentionally did not adjust the conditions in the OnRender function (lines 224, 306, 325 and 338) so that you can manually select players who are in /spec to watch as well.
I find this helpful, because it has often annoyed me not to be able to quickly find players who are in /spec on the map.

This also allows the selection of players that are in spec in demos. The only problem is that in demos the information about sepc players is missing (The same as in Game, only in Game the information is provided as soon as you spectate). However, until now this was also the case for players who are not in their own team. I find it handy to also have Spec players selectable, so that when they become active, the camera follows them directly.

In addition, you can spectate yourself in demos as well as in the game.
In demos this was already possible, as long as the own player in the demo is not currently in pause, at that moment you could only follow the recorded spectating camera. 

However, I have kept that in SpectateNext, SpectatePrevious and SpectateClosest the own player is not included. However, it is also possible to jump here in spectating to players in /spec.  


2.  Regarding the scoreboard component:

Now only real spectators are displayed under the scoreboard in the spectators team. No longer players who are in /spec or the own player who is currently paused.
So I did not adjust line 125, 341, 354, 367.

Line 724 would not need to be adjusted anyway since it only affects vanilla team games. If the function GetClanName is used for DDnet, this has the effect that paused players are also included.

I have adjusted the active condition of the scoreboard so that it is not automatically displayed when the player is spectating (that's the way it used to be).

Since now the own player is shown in the scoreboard even if he is paused, I have removed the marking of the own player when following another player (line 416).


3.  Regarding the menus_ingame component:
I left the behavior as it was, since we are talking about dangerous commands here (join spectator team and commit suicide) I think it is quite good that these are hidden when the player is paused.

To maintain this behavior, when creating the kill button, we must also check if we are not in pause or spec.
Actually we could check here m_pClient->m_Snap.m_SpecInfo.m_Active just like I did in the scoreboard, but since the code was already created I kept it.


4.  Regarding the IsOtherTeam function in gameclient:
This function is used to determine if the transparency m_ClShowOthersAlpha should be applied to players and nameplates of other teams and if entities of other teams should be predicted.

So I left the behavior as it was, i.e. if you pause via /pause or /spec the transparency is not applied, because then False is returned.

5. Regarding the HUD component:
I have not adjusted any condition here (line 310, 319 and 323). So far the behavior was that when the player went on pause (/pause /spec), in the small time display at the bottom right the top2 players were displayed and otherwise the best and the own player.
Now it is so that the own player is also displayed when he is paused, but not when he is a real spectator.
I personally find it strange why the display should change just because you pause. 

6. Regarding the chat component:

If the dummy paused is in the same team as the player and then a team message arrives, it will no longer be double logged.
Until now, when a player is in the same team in /spec and sends a message, his name was displayed in the Spectators team color and not in the team color. Since I have not adjusted the condition in line 803, the player names are also displayed in the team color for such messages.


7. Regarding the items component:

Here it is determined whether the local player is in the game and depending on that other GameTicks are used and ReconstructSmokeTrail is not canceled. 
Here I could not work in so exactly, no idea what consequences this has that I have not adjusted the conditions in line 47 and 560.  
I noticed at least when testing no difference, maybe someone who knows about it can explain to me what that has for effects.


About all changes I made we can discuss I am ready to undo them or restore the behavior as it was before.  But please justify with arguments.


Independently:
I added a -1 check for the m_LocalClientID to the Strong Week indicators in the Nameplates. So that with server demos the array is not accessed outside of the array range. For demos there are currently no predicted characters and therefore no strong week indicators, so it doesn't change anything.


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change  
I can provide screenshots to compare before after, but it's best to test it yourself.

- [ ] 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-14 13:06:42 +00:00
c0d3d3v 4619e825f3
make spectators team independent 2022-03-14 13:25:47 +01:00
bors[bot] 8ea73b7800
Merge #4822
4822: Auto select search string on hot key r=def- a=Jupeyy

Pressing CTRL+F should select the current search string, like basically every text editor and browser does

## 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-03-13 18:23:02 +00:00
Jupeyy cce42d41de Auto select search string on hot key 2022-03-13 19:12:06 +01:00
ChillerDragon 99b0eb2819 Add str_startswith_nocase and str_endswith_nocase 2022-03-13 11:42:45 +01:00
bors[bot] e91a4d4910
Merge #4817
4817: Don't mute for 0 seconds (fixes #4816) r=Jupeyy 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-03-13 10:11:25 +00:00
def eab52b3378 Don't mute for 0 seconds (fixes #4816) 2022-03-13 11:09:06 +01:00
bors[bot] a1668e0a5b
Merge #4812
4812: Full size sound settings r=Jupeyy a=def-

Old:
![screenshot-20220312@234506](https://user-images.githubusercontent.com/2335377/158037595-d3a6affc-3092-4b6c-9668-aab13f66801c.png)
New:
![screenshot-20220312@234420](https://user-images.githubusercontent.com/2335377/158037596-06889367-93d9-4c92-891b-c380653d8a3d.png)

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-03-13 07:23:57 +00:00
def 6b497afba4 Don't allow infinite shotgun bounce (fixes #4809) 2022-03-13 00:02:42 +01:00
def 9518e4413e Full size sound settings 2022-03-12 23:45:21 +01:00
bors[bot] d140e05a2c
Merge #4811
4811: fix bug that sneaked in during refactoring (in #4775) r=def- a=C0D3D3V

Was detected by missing hammer animation at very high ping by texnonik and bencie


## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-12 19:01:34 +00:00
c0d3d3v 50eb249686
fix bug that sneaked in during refactoring (in #4775)
- was detected by missing hammer animation at very high ping
2022-03-12 18:48:04 +01:00
oy 9277e3cbeb Fix laser clipping. Closes #2176
(cherry picked from upstream commit f3a1e68df9)
2022-03-12 15:30:41 +03:00
bors[bot] f89142b433
Merge #4790
4790: Don't print binds into F1 by default (fixes #4789) 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-03-12 11:31:48 +00:00
Tater 3b93e656a0 Make hook collision line size adjustable 2022-03-11 21:19:17 -06:00
Jupeyy 95fe457abb Auto font size 2022-03-11 17:34:48 +01:00
Robert Müller 74f87ee604 Remove unnecessary trailing semicolons after method declarations 2022-03-08 20:01:26 +01:00
bors[bot] 849513f9ed
Merge #4787
4787: Fix some spacing in settings with German r=heinrich5991 a=def-

Reported by Izanagi on Discord
Old:
![screenshot-20220305@100323](https://user-images.githubusercontent.com/2335377/156877157-53e59c1c-455c-4ee1-ae44-14099c58d68d.png)
New:
![screenshot-20220305@102430](https://user-images.githubusercontent.com/2335377/156877213-92be8b48-9844-4095-adc7-6d70f203e63e.png)

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-03-08 16:07:00 +00:00
Alexander Akulich d4dbceea6c CPlayers::RenderPlayer: Stop overriding the Tee size
Tee size is already set to this value (64px) 372 lines above.

(Setting this value again makes it harder to customize this value)
2022-03-08 14:24:37 +03:00
Alexander Akulich 754562ce0b CGameClient::LoadMapSettings: Load the default tuning params by default
The code which changes the default settings ruins demo playback for
default modes.
2022-03-08 14:24:37 +03:00
Alexander Akulich 0a30d8a058 Apply snd_gun and snd_long_pain options only to DDRace and FNG games
On 'traumatic' game types (e.g. vanilla dm, tdm, ctf) it is critical to
hear SOUND_GUN_FIRE (because someone seems to shooting at you).

It is not any less important to head SOUND_PLAYER_PAIN_LONG which takes
its place whenever the character taken damage > 2 (because you need to
know whether someone was hit).
2022-03-08 14:24:37 +03:00
Alexander Akulich e140d4c82e CBinds: Change 'no modifiers' value from '1' to '0'
The default bindings are set up via calls like Bind(KEY_A, "+left"); which
expands to Bind(KEY_A, "+left", /* FreeOnly */ false, /* ModifierCombination */ 0);

On the other hand, CMenusKeyBinder code does this: if(!Mask) Mask = 1 << MODIFIER_NONE;

This leads to a bug — binds which just set from the user input events are saved
in e.g. m_aapKeyBindings[1]['a'], and the default binds are still there
in m_aapKeyBindings[0]['a'] which leads to binds duplication in the UI.
2022-03-08 14:13:46 +03:00
c0d3d3v e01b1c5b3d
use TEAM_SPECTATORS and SPEC_FREEVIEW instead of -1 2022-03-07 22:16:28 +01:00
bors[bot] b0faac4a98
Merge #4784
4784: fix 4781 and refactor of the client id for server demos r=def- a=C0D3D3V

#Fixes #4781

I took the opportunity and directly refactored the code a bit, to be exact I replaced the -1 with the enum `SERVER_DEMO_CLIENT`, I can also change the identifier if we want to call it something else. Further I normalized the corresponding `>= 0` conditions to `> SERVER_DEMO_CLIENT`.


## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-07 18:08:32 +00:00
c0d3d3v 3438642dd8
fix 4781 and refactor of the client id for server demos 2022-03-07 19:03:43 +01:00
bors[bot] 2c4c858c24
Merge #4775
4775: Refactoring of players OnRender function r=def- a=C0D3D3V

Does anyone else feel that the code here: ff085a4545/src/game/client/components/players.cpp (L660-L709) is somewhat obfuscated? I do not think that the compactness of the code at this point increases the readability :D


## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-07 10:36:48 +00:00
def 6c0a564733 Don't print binds into F1 by default (fixes #4789) 2022-03-06 12:22:29 +01:00
def 729303822c Fix some spacing in settings with German 2022-03-05 10:24:26 +01:00
c0d3d3v e36363c2e2
deobfuscate players OnRender function 2022-03-04 20:03:24 +01:00
bors[bot] 237a9170bd
Merge #4778 #4780
4778: More space for players in server browser (fixes #4777) r=Jupeyy a=def-

Old:
<img width="920" alt="Screenshot 2022-03-03 at 20 23 38" src="https://user-images.githubusercontent.com/2335377/156637630-a68291e3-7859-46b0-9a7c-249629d5a875.png">
New:
<img width="898" alt="Screenshot 2022-03-03 at 20 21 28" src="https://user-images.githubusercontent.com/2335377/156637402-6a8669bd-331d-402f-888c-97e2f3f189a6.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)


4780: Update Korean translation by CHaBek r=edg-l 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-03-04 09:09:21 +00:00
c0d3d3v 8ddd53ab62
add enum for ShowOthers value 2022-03-03 22:56:32 +01:00
Dennis Felsing c7e1cf7d7a More space for players in server browser (fixes #4777) 2022-03-03 20:22:02 +01:00
c0d3d3v eda6ef899f
SV_TEAM enum was labeled 2022-03-03 15:36:06 +01:00
bors[bot] e215aeb232
Merge #4768
4768: Videorecorder on by default (also for github builds) r=Jupeyy a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-02 08:02:32 +00:00
bors[bot] ac05c14c78
Merge #4771
4771: fix Alpha of Muzzle r=def- a=C0D3D3V

In principle https://github.com/ddnet/ddnet/issues/4207 has already been fixed with https://github.com/ddnet/ddnet/pull/4770
But I don't know if the bug has influence on another part. The faulty animation code is hereby fixed. The problem is that when you shoot with the Rifle or the Shotgun the Muzzle animation is executed. This manipulates Alpha, Alpha itself is actually redefined in the condition, but apparently it overwrites the Alpha used for RenderHand since it is in the same code block (from line 279 to 537).  


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-03-01 22:55:49 +00:00
c0d3d3v e376eb995d
fix Alpha of Muzzle 2022-03-01 23:47:47 +01:00
bors[bot] 3a28f5fc6e
Merge #4769
4769: Fix integer overflow in CHud when server time exceeds around 248 days r=def- a=Robyt3

Fixes the server timer in the HUD showing 00:00 when the server time exceeds around 248 days.

Tested on "Vanilla Teeworlds Server - CTF":

![303d](https://user-images.githubusercontent.com/23437060/156249076-d3f20853-cd0a-4545-a459-493f123eb5bc.png)

Otherwise connecting to this server causes:

```
/src/game/client/components/hud.cpp:128:17: runtime error: signed integer overflow: 26254443 * 100 cannot be represented in type 'int'
    #0 0x55c8b6722e7d in CHud::RenderGameTimer() /src/game/client/components/hud.cpp:128
    #1 0x55c8b675cdfc in CHud::OnRender() /src/game/client/components/hud.cpp:855
    #2 0x55c8b6babec7 in CGameClient::OnRender() /src/game/client/gameclient.cpp:598
    #3 0x55c8b62b0330 in CClient::Render() /src/engine/client/client.cpp:1179
    #4 0x55c8b6301a62 in CClient::Run() /src/engine/client/client.cpp:3155
    #5 0x55c8b635fc34 in main /src/engine/client/client.cpp:4427
    #6 0x7f581a6150b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2)
    #7 0x55c8b60f478d in _start (/build-asan/DDNet+0x1bd978d)
```

## 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: Robert Müller <robytemueller@gmail.com>
2022-03-01 22:38:43 +00:00
Robert Müller f89e6b6599 Fix integer overflow in CHud when server time exceeds around 248 days 2022-03-01 23:22:06 +01:00
Dennis Felsing 687f3e6160 Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
bors[bot] 3f36041c9c
Merge #4770
4770: Allow the ghost to carry any weapon r=def- a=C0D3D3V

I tried to reproduce another bug (https://github.com/ddnet/ddnet/issues/4207) and I noticed that ghosts are not allowed to carry any other weapons except grenade launcher and pistol. This is no longer necessary since we have been using the general renderer for players for a long time. We don't create projectiles for Ghosts, but it's always been like that and doesn't look worse than before.
![image](https://user-images.githubusercontent.com/14315968/156250428-3d8105d6-cf4a-4dd1-bf5c-cf1b9cab81d3.png)
![image](https://user-images.githubusercontent.com/14315968/156250490-02ac6d31-9146-47ff-89ac-9f4153d327a8.png)

So now you can see at least when the tee was frozen (before he was as seen in the linked issue with pistol in the freeze and alive)
![image](https://user-images.githubusercontent.com/14315968/156250525-857ca975-922f-48db-b38b-08ca86f5bd29.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
- [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-03-01 21:57:58 +00:00
Dennis Felsing c92423362e Videorecorder on by default (also for github builds) 2022-03-01 22:56:24 +01:00
c0d3d3v 5a621522b0
Allow the ghost to carry any weapon 2022-03-01 22:14:02 +01:00
bors[bot] 9d8e5f7957
Merge #4751 #4765
4751: Don't try to send messages outside of sv_max_clients (fixes# 4750) r=Jupeyy 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)


4765: Show correct server address when connecting r=Jupeyy a=def-

This just saved the secret server for BiT3 streaming, but still a bug ;)

## 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-03-01 14:39:05 +00:00
bors[bot] 4533a3541a
Merge #4763
4763: Quad knife tool r=def- a=HiRavie

A new way to slice quads that doesn't make mappers pull their hair out.
To use it, open the quad context menu and click the _Slice_ button, check out the tooltip for more instructions.
Snaps automatically to corners and edges if close enough or to grid.

![gif](https://user-images.githubusercontent.com/65019210/155854241-9e07a5b2-1915-41d4-86c9-b2084ff6b929.gif)

## 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
- [ ] 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: Ravie <65019210+HiRavie@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-01 10:34:34 +00:00
Dennis Felsing c75139a1ad Fix clang-format and clang-tidy 2022-03-01 11:33:53 +01:00
Ravie 41ea78ac56 Simpler visuals code 2022-02-28 23:45:57 +01:00
Tater 959e7c2763 Fixed specteam 1 not showing teammates while spectating/freecam in solo 2022-02-28 12:47:01 -06:00
Dennis Felsing 3cd7058fe6 Show correct server address when connecting 2022-02-28 19:38:59 +01:00
Ravie 603089754f Some fixes 2022-02-27 00:44:34 +01:00
Ravie 2745c1a694 Knife tool 2022-02-26 18:49:06 +01:00
Tater ccc23161f6 Update players.cpp
Local Hook Collision line updates every frame instead of every tick
2022-02-25 06:22:51 -06:00
Chairn c0d398df38 CheckImageFormatRGBA --> IsImageFormatRGBA 2022-02-23 00:39:31 +01:00
Chairn 0ea66bca57 Clang format 2022-02-22 20:21:43 +01:00
Chairn 76064bd1c8 Drop non RGBA images 2022-02-22 20:21:34 +01:00
Dennis Felsing e2c48ec47e Don't try to send messages outside of sv_max_clients (fixes# 4750) 2022-02-21 16:33:53 +01:00
Robert Müller 9ebb85f520 Fix listbox item double click behavior 2022-02-20 19:58:24 +01:00
def cf23a73891 Fix style 2022-02-20 10:41:06 +01:00
simpygirl 4e7b82a3fd Fix broken checkbox 2022-02-20 04:04:47 +01:00
c0d3d3v eac2d731b6
Refactoring of g_Config.m_SvTeam, See #4601 2022-02-19 18:11:15 +01:00
bors[bot] e79c166259
Merge #4697
4697: Show key presses in nameplates r=def- a=C0D3D3V


As described in [x](https://github.com/ddnet/ddnet/issues/4589) the arrows that show the key presses of the players are not visible in many situations, this is now my attempt to fix this by including the arrows in the nametags.

~~Also, I created a new option called `cl_show_direction_below` to show the arrows below the player. We can discuss whether this is useful, or whether it should simply be displayed as before only above the player.~~

## Checklist

- [x] Tested the change ingame
- [x] Provided screenshots if it is a visual change
https://streamable.com/czk2ht
See also https://github.com/ddnet/ddnet/issues/4589
- [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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-02-19 12:36:50 +00:00
c0d3d3v d43ed14897
render key presses independent of m_ClNameplates 2022-02-19 13:31:34 +01:00
Dennis Felsing bc0bf4e549 No chat messages for live freeze
Since you have visual indication already, as suggested by fokkonaut and
Konsti
2022-02-18 13:02:03 +01:00
Dennis Felsing 18ee351247 Version 15.9.1 2022-02-15 21:20:31 +01:00
c0d3d3v 94c1d7fe66
remove m_ClShowDirectionBelow
Show keystrokes always above the players
2022-02-15 11:59:07 +01:00
Dennis Felsing 18d9997348 Fix clang-format 2022-02-15 00:32:04 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing 7da9f1b93b Add modernize-use-equals-delete 2022-02-15 00:20:34 +01:00
Dennis Felsing b58470fda4 Add modernize-use-equals-default 2022-02-15 00:17:57 +01:00
Dennis Felsing 2da5d7d289 Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
Dennis Felsing 62756dbda0 Enable modernize-make-unique clang-tidy check 2022-02-15 00:05:46 +01:00
Dennis Felsing 1afd1a32d1 Fix Linux build with C++20
src/game/client/components/chat.cpp: In lambda function:
src/game/client/components/chat.cpp:686:33: error: implicit capture of ‘this’ via ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  686 |  auto &&FChatMsgCheckAndPrint = [=](CLine *pLine) {
      |                                 ^
src/game/client/components/chat.cpp:686:33: note: add explicit ‘this’ or ‘*this’ capture
2022-02-14 19:19:20 +01:00
Dennis Felsing 4c8e33ee8e Fix MSVC build
src\game\gamecore.cpp(185,36): warning C5055: operator '*': deprecated between enumerations and floating-point types [D:\a\ddnet\ddnet\debug\game-shared.vcxproj]
2022-02-14 19:19:20 +01:00
def 75c7303c66 Version 15.9 2022-02-13 00:00:18 +01:00
bors[bot] 22a5bb9826
Merge #4695
4695: Always destroy bullets/lasers on kill when in practice team (fixes #4694) r=heinrich5991 a=def-

to prevent /teleporting back to start line and cheating

Any thoughts on whether to include this for 15.9? I'd say yes.

<!-- 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-02-11 16:04:07 +00:00
Dennis Felsing 3650281cf0 Always destroy bullets/lasers on kill when in practice team (fixes #4694)
to prevent /teleporting back to start line and cheating
2022-02-11 16:58:04 +01:00
bors[bot] f1c77fc8f6
Merge #4698
4698: Close wordlist.txt file handle after use r=def- a=ChillerDragon

<!-- 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: ChillerDragon <ChillerDragon@gmail.com>
2022-02-11 15:38:27 +00:00
ChillerDragon 0a3c75b925 Close wordlist.txt file handle after use 2022-02-11 16:30:18 +01:00
c0d3d3v 724a49dc59
Show keystrokes in the nametag and new option cl_show_direction_below to show the keypresses below the players 2022-02-11 14:05:37 +01:00
Robert Müller 6d15f360c1 Delay double click handling one frame after item activation 2022-02-10 17:40:03 +01:00
bors[bot] 007e632530
Merge #4675
4675: Remove the totally unsafe editor undo r=heinrich5991 a=def-

Since it causes crashes because another thread just accesses the data.

No one has wanted to fix this, so maybe we should just remove it instead
of having clients crash in editor. I'm wondering how much effort it
would be to make this safe. Would we just have to lock for a short part
or is it basically the entire threaded undo operation that has to be
serialized? (No need for a thread then)

<!-- 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-02-09 17:11:03 +00:00
bors[bot] 0d3234e316
Merge #4684
4684: Init m_NonEmptySince r=def- a=ChillerDragon

<!-- 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: ChillerDrgon <ChillerDragon@gmail.com>
2022-02-09 16:30:08 +00:00
ChillerDrgon 7bcb9fa9ca Init m_NonEmptySince 2022-02-09 17:18:43 +01:00
bors[bot] 0c5d5e1a7a
Merge #4683
4683: Init m_pNextTraverseEntity r=heinrich5991 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-02-09 14:36:20 +00:00
Jupeyy ea2102efcb Init m_pNextTraverseEntity 2022-02-09 15:26:50 +01:00
Chiller Dragon d27a3303c4
Remove commented out OnEntity call
Was added by GreYFoX in some big merge commit

f7f6058a92 (diff-aba621fd6688d4086ab40e58808cc12fdf591fdedf0d6c58cde2312b68cea5e0R1737)
2022-02-09 10:17:45 +01:00
Dennis Felsing e428f6ab5d Ignore F5 key press when ingame menu is open
Since ghost menu and browser use F5 already to refresh, and having a
bind on it, would cause both actions at once.

I believe it makes sense to have this special handling only for F5,
other F-keys don't have this problem since we don't use them in any
menus.
2022-02-08 00:38:05 +01:00
bors[bot] d2045b5d78
Merge #4676
4676: Record player_ready event in teehistorian r=heinrich5991 a=Zwelf

Allows reproducing teehistorian files without lookahead and without relying on PlayerNew messages.

## Checklist

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


Co-authored-by: Zwelf <zwelf@strct.cc>
2022-02-07 23:11:17 +00:00
Zwelf 3ea55dcc0e Record player_ready event in teehistorian 2022-02-07 23:31:46 +01:00
Dennis Felsing fe1b86b173 Remove the totally unsafe editor undo
Since it causes crashes because another thread just accesses the data.

No one has wanted to fix this, so maybe we should just remove it instead
of having clients crash in editor. I'm wondering how much effort it
would be to make this safe. Would we just have to lock for a short part
or is it basically the entire threaded undo operation that has to be
serialized? (No need for a thread then)
2022-02-07 15:57:27 +01:00
heinrich5991 7aafc78622 Fix evolve limit
Mixed up previous and current. This did not show up in testing, because
these two were always true at the same time. I've now debugged it and
manually made specific conditions false to verify that it's working.

Sorry for the mess.
2022-02-07 14:29:49 +01:00
heinrich5991 a203478809 Make the evolve limit more visible
This is to make sure that modders don't start to rely on the fact that
we clamp the evolve duration to 3 seconds.
2022-02-07 12:16:39 +01:00
bors[bot] 4d2505284b
Merge #4624
4624: Limit evolving to 3 seconds r=heinrich5991 a=ChillerDragon

Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)

Fixes client freezes if the server sends funny ticks

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-02-07 10:50:02 +00:00
bors[bot] 3025bb0036
Merge #4668
4668: Fix bindings with modifiers r=def- a=Kaffeine

I work on a client for InfClass mod and it is important to have bindings for many situations, so we have to use modifiers (one modifier per bind).

It turned out that bindings (with a modifier) are broken in DDNet since commit 4326d00df9 which changes the implementation to support modifier combinations but it messes up the UI part.

I've considered options to revert the commit or to fix the combined modifiers and bravely 😅  choose the latter way. The code had at least five bugs and fixing e.g. four of them does not help much, making it really hard to say if the fix is correct or not. I had to rename some vars first to make the code readable and now (with the correct names) each fix should seem reasonable.

`Modifier` was confused with `ModifierCombination` in so many places. I do not like the idea of deviating from the `teeworlds` codebase but we already did it here by introducing of combined modifiers. We do not use a stronger type system (enum classes and flag classes) but one thing we can do to give a developer the idea of what is going on is to use the correct variable and argument names at least.

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

I checked the follow cases:
- Binding of a normal key (e.g. `t`)
- Binding of a sole modifier (e.g. `lctrl`)
- Binding of a key combined with a modifier (e.g. `ctrl+t`)
- Binding of a key combined with many modifier (e.g. `ctrl+alt+t`)

### Before
Bindings with `Shift` modifiers displayed as `Ctrl+`, bindings with `Ctrl` or `Alt` are not displayed at all.
![image](https://user-images.githubusercontent.com/374839/152705632-42668ec2-a424-4dfa-99ff-250e146da5ea.png)

### After
All bindings displayed correctly
![image](https://user-images.githubusercontent.com/374839/152706393-08c36e36-1200-482a-9eb3-dc0d96185cdd.png)

but also it is possible to set any crazy binding from UI
![image](https://user-images.githubusercontent.com/374839/152706406-b1e18139-16a3-451e-9ac9-702b0aac4d2e.png)



Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
2022-02-07 09:24:02 +00:00
Alexander Akulich 9a5b7339cf Client: Fix projectiles rendering for demo playback
The playback timing leads to always negative client time for projectiles
fired on the current game tick.
2022-02-07 02:41:21 +03:00
Alexander Akulich 17222d67bf Binds: Reorder modifiers according to the convention
The modifiers order in the UI and console follows the order
of modifier enum items.

The conventional order of the modifiers is: Ctrl, Alt, Shift, GUI (Win, Meta).

Place Shift after Alt to get proper order, e.g.:
Alt+Shift+R (conventional) instead of Shift+Alt+R (weird)
2022-02-07 01:54:12 +03:00
Alexander Akulich 7d1595f06f Client/CMenus: Actually process and show all bindings with modifiers 2022-02-07 01:54:12 +03:00
Alexander Akulich e0876960fc CBinds: Remove unused ModifierMatchesKey() 2022-02-07 01:54:12 +03:00
Alexander Akulich fff597cd2a CMenusKeyBinder: Fix binding in cases with only a modifier key pressed 2022-02-07 01:54:12 +03:00
Alexander Akulich 2233ca98c1 CBinds::GetModifierMask: Make the method actually returning the mask
... instead of the modifier enum value.

This fixes CMenusKeyBinder which now saves the bindings into the right slot.
2022-02-07 01:54:12 +03:00
Alexander Akulich ae482d018f CMenus::DoKeyReader: Fix the UI text for binds with a modifier(s) 2022-02-07 01:50:14 +03:00
Alexander Akulich db1d136006 client/menus: Fix variable names 2022-02-07 01:50:14 +03:00
Alexander Akulich 343b2543cc Client/CBinds: Rename arguments which refers to the ModifierCombination
The first dimention of m_aapKeyBindings is ModifierCombination
since commit 4326d00df9.

Rename the arguments to make it clear when the arg is a combination
(e.g. the arg value '2' refers to '1 << MODIFIER_SHIFT' instead of 'MODIFIER_CTRL')

This is needed to make the code cleaner and the bugs more obvious.
2022-02-07 01:50:14 +03:00
Alexander Akulich 68b1afce0e client/menus_settings: Replace hardcoded config name with a macro 2022-02-06 22:44:21 +03:00
Alexander Akulich ac61a38afe CPlayers::RenderPlayer: Consistently use Alpha variable
We already use Alpha to render the weapon, Tee hand, and emoticon.
We also rendered ghost Tee with the same Alpha value.
2022-02-06 22:29:27 +03:00
bors[bot] 00f93da936
Merge #4661
4661: Make spawn position independent of players in other teams r=heinrich5991 a=def-

As suggested by Rockus, should help speedrunners who get followed by
other players

<!-- 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-02-06 12:50:04 +00:00
bors[bot] f654b1a12c
Merge #4665
4665: Support saving any size binds (fixes #4660) r=heinrich5991 a=def-

Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file

<!-- 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-02-06 11:43:30 +00:00
def db4d9f9a47 Support saving any size binds (fixes #4660)
Since we store the bind with malloc, we also need to use malloc here to
allow any size when saving the binds in config file
2022-02-06 12:01:46 +01:00
bors[bot] 90944e0cac
Merge #4654
4654: Add a groundjump-only tile r=def- a=heinrich5991

Implements a new mode of jumping: "you only have ground jump".  This differs from "you only have one jump" in that it doesn't allow you to air-jump, even if you haven't jumped to get off the ground. To access this mode, it reuses the "air-jump tile" in the switch layer with the number of jumps set to 255.

This tile is planned to be used in tutorial developed by unique2 and Alisa.

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-02-06 09:23:14 +00:00
def d96f354b28 Make spawn position independent of players in other teams
As suggested by Rockus, should help speedrunners who get followed by
other players
2022-02-06 00:01:50 +01:00
heinrich5991 620d611521 Add "groundjump-only" tile
Works by setting the airjump tiles' jumps to 255.
2022-02-05 23:53:32 +01:00
heinrich5991 87df5b8c14 newJumpsNewJumps 2022-02-05 22:32:55 +01:00
Jupeyy 338b6b2238 Add windowed fullscreen ( a special case for Windows ) 2022-02-04 11:14:10 +01:00
bors[bot] f15b3afd95
Merge #4648
4648: Add some checksum functions to the client r=def- a=heinrich5991

Let's see if it works out, if not, we can revert it.

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-01-31 22:42:24 +00:00
bors[bot] c9cecaa6e2
Merge #4580
4580: Add teleport/tp chat command to teleport yourself r=edg-l a=def-

to another player or spectated location. Requires /practice mode

As suggested by Rockus on Discord

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-01-31 21:29:14 +00:00
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00
Dennis Felsing 3aa29a9ea3 Don't clamp team quietly, but crash on invalid team 2022-01-31 13:29:11 +01:00
def 3078d9dcfc Transfer super state to client and predict properly 2022-01-31 13:22:44 +01:00
def d31f1c6554 Make super player sounds always appear 2022-01-31 13:22:44 +01:00
def c5d0b984df Ignore start line warning in practice mode 2022-01-31 13:21:26 +01:00
def 1bdf960945 Add teleport/tp chat command to teleport yourself
to another player or spectated location. Requires /practice mode

As suggested by Rockus on Discord
2022-01-31 13:21:04 +01:00
heinrich5991 9ef3c8c94a Mark all component functions overrides with override 2022-01-31 00:53:12 +01:00
Robert Müller 4f653cfcda Use H/VSplitMid where possible 2022-01-26 20:41:08 +01:00
Robert Müller f341e96689 Use Spacing parameter where possible 2022-01-26 20:41:08 +01:00
Robert Müller 4fbca828f4 Add optional Spacing parameter to H/VSplitMid 2022-01-26 20:41:05 +01:00
bors[bot] 155a922d47
Merge #4628 #4639
4628: Disable or fix some spammy new clang-tidy 13 warnings r=heinrich5991 a=def-

```
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
```
<!-- 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)


4639: Fix SendStartWarning() to only warn every 3 seconds r=heinrich5991 a=def-

Thanks for Skeith for report

<!-- 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-01-26 13:17:54 +00:00
Dennis Felsing 0374ddac72 Don't clamp "zoom" command, we already clamp in ChangeZoom
Thanks to chillerdragon for noticing
2022-01-26 12:54:19 +01:00
Dennis Felsing 087a9a8235 Fix SendStartWarning() to only warn every 3 seconds
Thanks for Skeith for report
2022-01-26 12:24:56 +01:00
Dennis Felsing 5cc8eb979d Better fixes 2022-01-26 11:01:11 +01:00
heinrich5991 b92f794e3e Fix old-style DDNet version message sending
Forgot to invert a condition in
49bc150afd.

Fixes #4629.
2022-01-24 15:29:04 +01:00
Dennis Felsing 827ebf1ce6 Emote -> Emoticon 2022-01-23 19:16:23 +01:00
Dennis Felsing 4da76e0e7d Fix any_of 2022-01-23 18:56:37 +01:00
def 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +01:00
def 3f7befdd8b Add some further readability checks, mostly redundancy
/media/ddnet/src/engine/server/databases/sqlite.cpp:232:55: warning: the address of ‘char* sqlite3_expanded_sql(sqlite3_stmt*)’ will never be NULL [-Waddress]
  232 |         if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
2022-01-22 17:22:01 +01:00
def bc78ba57b9 Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
def 7aac8b5386 Add readability-container-size-empty 2022-01-22 13:54:25 +01:00
def bcb50c1b29 Enable readability-const-return-type, readability-container-data-pointer, readability-delete-null-pointer 2022-01-22 13:49:14 +01:00
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +01:00
def f3796e5455 Disable or fix some spammy new clang-tidy 13 warnings
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
2022-01-22 13:35:52 +01:00
bors[bot] 623d8af04c
Merge #4623
4623: Refactor: Distinguish between two concepts previously called "Dummy" r=def- a=heinrich5991

On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

Also fix a few bugs in dummy handling.

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-01-21 21:26:21 +00:00
heinrich5991 d2bf8d6513 Rename Client to Conn (suggestion by deen) 2022-01-21 22:13:35 +01:00
bors[bot] 390e54f627
Merge #4625
4625: Use ETextAlignment enum for UI r=def- a=ChillerDragon

Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

`@cinaera` added alignment enums
	04ee8b20a1

`@TsFreddie` renamed them
	67651e8122

## 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: ChillerDragon <ChillerDragon@gmail.com>
2022-01-21 15:39:36 +00:00
ChillerDragon b770bc6988 Use ETextAlignment enum for UI
Replaces the magic numbers -1/0/1 for left/center/right

Based on the work done in upstream:

@cinaera added alignment enums
	04ee8b20a1

@TsFreddie renamed them
	67651e8122
2022-01-21 16:26:19 +01:00
ChillerDragon 41fd1639d9 Limit evolving to 3 seconds
Took from upstream
5d44714e92 (diff-597779b4eb51af9adfedd04b8a235afff01091a4ba741daa604cb5cbeda4e3daR1306-R1321)
2022-01-21 11:30:31 +01:00
heinrich5991 49bc150afd Refactor: Distinguish between two concepts previously called "Dummy"
On the one hand variables called "Dummy" would tell us whether the
current action refers to the currently inactive tee ("dummy"). On the
other hand, these variables could tell us whether the current action
refers to the main connection to the server, or the secondary one. The
latter use case is now renamed to "Client", with the choices
`CLIENT_MAIN`, `CLIENT_DUMMY` (and `CLIENT_CONTACT`).

Perhaps better names could be found, especially since `Client` also
refers to the engine client class in the game code.

I tried to not fix bugs unless it would complicate the code.
2022-01-21 01:54:14 +01:00
bors[bot] 6d3aaaeff9
Merge #4622
4622: Refactoring: move RenderTilemapGenerateSkip to CLayers, Add CLayers::NumLayers r=def- a=Robyt3

- Move `CRenderTools::RenderTilemapGenerateSkip` to `CLayers::InitTilemapSkip`, as it can be a private function in `CLayers`.
- Add missing `CLayers::NumLayers` accessor.
- Improve code style.

## 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: Robert Müller <robert.mueller@uni-siegen.de>
2022-01-20 21:54:42 +00:00
ChillerDragon e4be3f5241 Shutdown components 2022-01-20 12:20:29 +01:00
Robert Müller 4791bc4cd8 Remove unnecessary trailing semicolons 2022-01-19 22:44:20 +01:00
Robert Müller e9293877ca Add CLayers::NumLayers 2022-01-19 22:44:16 +01:00
Robert Müller 6c558c2138 Improve code style of InitTilemapSkip 2022-01-19 22:27:59 +01:00
Robert Müller 1810ff3949 Move InitTilemapSkip to CLayers 2022-01-19 22:22:31 +01:00
Robert Müller 39b716d5ab Fix double clicking on folders in demo browser 2022-01-19 21:45:47 +01:00
bors[bot] 48e53470cd
Merge #4581 #4590 #4593 #4607
4581: Adjustable prediction margin r=def- a=trml

This adds an option to adjust how early the client sends an input for a given tick. In vanilla this value is hardcoded to 10 milliseconds before the next tick, which is good for low-latency gameplay and/or when you have a stable connection, but sometimes it could perhaps be useful to increase the value, to either test something with a high ping (without having to joing a high-ping server or use on a 3rd party program like tc/netem), or for counteracting the effect of jitter and jumping ping.

The last part comes at a tradeoff for higher ping though, and it also doesn't handle lag caused by packet loss, but it I have found it useful in some situations when playing race/solo/dummy with a bad connection. Since it's a bit experimental I only added it as an f1 option and not stored between sessions, and also added a gameinfo flag to only support it on servers that implement #1441.

Edit: Also attempted to cleanup variable names for tick calculations in client.cpp slightly.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] 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)


4590: Remove extra projectiles r=def- a=trml

Aligns the code with vanilla, and cleans up things a bit
(same as [329e6261f3](url))

These were used to show projectiles a tick (or fraction of a tick) earlier than they otherwise would (and they were also sent without extrainfo since they didn't matter for prediction), so removing them would perhaps not make a noticeable difference. (and perhaps also less of a difference now since weapon input isn't applied before the start of a tick anymore).

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


4593: Fix compiler warning with new ffmpeg version (currently built from git) r=heinrich5991 a=def-

```
src/engine/client/video.cpp:102:32: error: assigning to 'AVOutputFormat *' from 'const struct AVOutputFormat *' discards qualifiers
        m_pFormat = m_pFormatContext->oformat;
                    ~~~~~~~~~~~~~~~~~~^~~~~~~
src/engine/client/video.cpp:571:13: error: assigning to 'AVCodec *' from 'const AVCodec *' discards qualifiers
        *ppCodec = avcodec_find_encoder(CodecId);
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
<!-- 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)


4607: Adopt upstream input (especially double click) handling, refactoring r=def- a=Robyt3

This adopts the 0.7 way of handling double clicks, by checking `Event.button.clicks` of the `SDL_Event`. The double click is stored as a flag which is cleared when the `MouseDoubleClick()` function is called (d215c73206 and 7977b46d36).

This reverts 72a6e20, as this hack is no longer required (closes #1745). Double clicking a friend in the friend list still works (#444) with both `gfx_asyncrender_old 0` and `1`.

Refactorings and minor fixes synchronizing with upstream:

- Only copy SDL keystate of _keyboard_ keys and mem_zero the rest to ensure out of bounds SDL keys don't trigger mouse keys.
- Rename variables and use SDL constants.
- Reduce unnecessary indentation.

## Checklist

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


Co-authored-by: trml <trml@users.noreply.github.com>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: oy <Tom_Adams@web.de>
2022-01-17 23:36:14 +00:00
bors[bot] 0177f21d36
Merge #4613
4613: Revert LFREEZE-LUNFREEZE explanation on editor for Switch layer r=def- a=GiuCcc

Thank `@fokkonaut`
Revert two lines to original.

Commit to be reverted:
2017464282 (diff-6ecdf8a78005b8c2541e54e3532ebec8f3f4ef2ec69ba8a6a281ce4421562570)


## 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: Wohoo <giu.casuccio@gmail.com>
2022-01-17 23:22:56 +00:00
Wohoo 163666a9fb Revert of 2017464282
on LFREEZE and LUNFREEZE  case
2022-01-18 00:07:52 +01:00
bors[bot] cfe5032217
Merge #4611
4611: Default players to being afk on new map r=heinrich5991 a=def-

As reported by MitakoKotomi in https://forum.ddnet.tw/viewtopic.php?f=118&p=70154

<!-- 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-01-17 15:16:03 +00:00
Dennis Felsing c033513976 Default players to being afk on new map
As reported by MitakoKotomi in https://forum.ddnet.tw/viewtopic.php?f=118&p=70154
2022-01-17 12:58:14 +01:00
bors[bot] e03e6210e0
Merge #4604
4604: Allow multiple comands when adding vote in UI r=heinrich5991 a=def-

as reported by louis

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-01-17 02:10:34 +00:00
def 7e7fac82da Escape voting commands sent from client 2022-01-17 00:41:47 +01:00
trml b391e4b50d Fix bullet rendered through walls 2022-01-16 21:58:51 +01:00
Robert Müller c214918977 only consume double click if item hot 2022-01-16 12:43:32 +01:00
def 746fc307aa Allow multiple comands when adding vote in UI
as reported by louis
2022-01-16 10:43:35 +01:00
bors[bot] dd9eb0d736
Merge #4584
4584: Fix rescue tee when swapping (fixes #4578) r=Jupeyy 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-01-15 18:39:31 +00:00
bors[bot] b0f6b805d3
Merge #4583
4583: Update score hud immediately when switching dummy r=Jupeyy 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-01-15 18:27:42 +00:00
bors[bot] dcc912d317
Merge #4602
4602: Fix windows macro and split the resize events r=def- a=Jupeyy

I noticed that the resize backend used the wrong macros `CONF_PLATFORM_WINDOWS` instead `CONF_FAMILY_WINDOWS`(windows seems to be the only one in detect.h that splits platform between 32bit and 64bit, maybe we should change that)

maybe this fixes #4351, because actually the workaround for windows was exactly inside the wrong macro to fix resizing in fullscreen.

I also split the resize functions, so its less confusing Resize (actively resize in the resolution list) vs GotResized (reported by SDL) and made some things a bit clearer

## 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-01-15 16:17:15 +00:00
Jupeyy 69202fdc22 Fix windows macro and split the resize events 2022-01-15 16:55:32 +01:00
bors[bot] 2d48cf7dcb
Merge #4573
4573: Implemented live freeze (tiles LFREEZE and LUNFREEZE) r=def- a=GiuCcc

Implemented live freeze.
Live frozen tees cannot move or jump, but they can use hook and weapons.
Live freeze permit the reverse-hammerfly: above tee is live frozen, so it can only hook, not drive. Lower tee has to hammer and drive.

It's implemented adding a new flag: CHARACTERFLAG_NO_MOVEMENTS.
Two tiles are 144 (LFREEZE) and 145 (LUNFREEZE) must be added as entities <--- MISSING ARTWORK HERE
Backcompatibily in-game has been tested, but missing cosmetic on old client: live frozen tee should have smoke too.
I've not tested the back-compatibility about save or rescue.

Added popup gametile in editor: live freeze and live unfreeze.
Added fix in editor explanation: classic TILE_FREEZE and TILE_UNFREEZE can be placed in switch layer too.

TODO:
Missing entities artwork for Tile 144 (LFREEZE) and 145 (LUNFREEZE)

## 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: Wohoo <giu.casuccio@gmail.com>
2022-01-15 10:27:04 +00:00
Jupeyy 956afed264 Fix console line bug when resizing 2022-01-14 22:36:41 +01:00
trml 30093e44c5 Remove extra projectiles 2022-01-13 00:46:11 +01:00
Wohoo fb09082128 fix another superfluous comma 2022-01-10 20:40:22 +01:00
Wohoo 26372c8164 fixed comma typo 2022-01-10 20:31:43 +01:00
Wohoo 6070a66c99 Save server string corrected.
Fix typo in comments
2022-01-10 19:23:48 +01:00
def e78b1188e0 Update score hud immediately when switching dummy 2022-01-09 22:16:42 +01:00
def c99433a800 Fix rescue tee when swapping (fixes #4578) 2022-01-09 22:13:27 +01:00
Wohoo ea98120bb2 Save is now back compatible with older version (default m_LiveFreeze=0).
Fix clang-format on comments
2022-01-09 18:39:46 +01:00
trml f3b0a1e331 Add ClPredictionMargin 2022-01-09 13:08:11 +01:00
Wohoo e8718df49c clang-format fix 2 2022-01-08 13:14:01 +01:00
Wohoo 68a8bbadbc clang-format fix 2022-01-08 12:30:51 +01:00
Wohoo 0614fce2bb Remove comment 2022-01-07 17:12:57 +01:00
Wohoo 2017464282 Livefreeze implementation with CHARACTERFLAG_NO_MOVEMENTS flag.
Freeze and Unfreeze tiles added to switch layer too.
2022-01-07 16:53:40 +01:00
bors[bot] 118ae1bb36
Merge #4551 #4557
4551: Revert "Support 32bit color depth, default to it (fixes #4549)" r=heinrich5991 a=def-

This reverts commit ee35097385.

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


4557: Editor: Don't react to server settings shortcuts when dialog is open r=heinrich5991 a=def-

as reported by Sorah

<!-- 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-01-05 01:42:09 +00:00
bors[bot] 234596784d
Merge #4542
4542: Downgrade SDL 2.0.18 -> 2.0.16 on Windows (fixes #4537) 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>
2022-01-05 01:28:58 +00:00
def 3b3b2c70af Editor: Don't react to server settings shortcuts when dialog is open
as reported by Sorah
2022-01-01 14:27:39 +01:00
def 0ab7190864 Don't warn on solo server, where no team ranks should exist 2021-12-29 20:36:03 +01:00
def 11d619e060 Use power button to quit (fixes #3786) 2021-12-29 11:16:41 +01:00
def 3805921b65 Version 15.8.1 2021-12-28 20:14:41 +01:00
heinrich5991 228125df4f Remove compatible version filter
It doesn't do anything right now, all servers advertise a compatible
version.

It might become a compatibility hazard in the future, e.g. DDNet servers
try to advertise a different version string to 0.6 than to 0.7 clients,
because the compatible version filter on 0.6 insists that it starts with
"0.6" and on 0.7 that it starts with "0.7", clearly incompatible.
2021-12-28 15:09:38 +01:00
def bc184b7198 Add margin for ping in server browser
as reported by Izanagi
2021-12-28 01:05:53 +01:00
bors[bot] 768a007eed
Merge #4429 #4517
4429: Pr sql fail fast r=heinrich5991 a=Zwelf

Remaining changes for #4424. Improving sql write times during shutdown and slow mysql responses/timeouts. I still want to test this change, especially for the last commit. Might have time for testing this evening. Thoughts and feedback on this patchset welcome.

## Checklist

- [ ] Tested the change ingame
   - [x] in mysql mod
   - [ ] in sqlite3 mode
- [ ] 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)


4517: Rename EXPLODING BULLET to BULLET r=heinrich5991 a=def-

As suggested by Yuzu

<!-- 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: Zwelf <zwelf@strct.cc>
Co-authored-by: def <dennis@felsin9.de>
2021-12-27 23:11:09 +00:00
bors[bot] a9cd29d624
Merge #4514 #4534
4514: Implement sv_min_team_size (fixes #3720) r=edg-l a=def-

to prevent too small teams counting as team finishes. You can still
finish with a team smaller than sv_min_team_size, but only get regular
ranks, not team ranks.

This will require going through all our maps and setting
sv_min_team_size in map config for maps intended for more than 2
players. We will also need to remove all teamranks with smaller teams
from official database.

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


4534: Implement "reset" command r=edg-l a=def-

to reset specific config to default value

<!-- 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-12-27 10:42:41 +00:00
bors[bot] c6b9a57a32
Merge #4521
4521: Support enter and escape in editor when confirming save r=edg-l 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-12-27 10:28:58 +00:00
def b898a868d5 Version 15.8 2021-12-27 01:26:56 +01:00
def 8625487292 Support enter and escape in editor when confirming save 2021-12-23 11:50:45 +01:00
def f9edeb627b Rename EXPLODING BULLET to BULLET
As suggested by Yuzu
2021-12-22 16:56:21 +01:00
bors[bot] c5ed7f6ec8
Merge #4515
4515: Revert "Use temporary file when saving editor file (fixes #4476)" r=heinrich5991 a=def-

Doesn't work on Windows, not so easy to overwrite a file already open in
editor. Not sure how our old approach works, but apparently it did
better than the new one. As reported by texnonik on Discord

This reverts commit e2084e1e9d.

<!-- 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-12-22 07:50:09 +00:00
def 7d57b80646 Revert "Use temporary file when saving editor file (fixes #4476)"
Doesn't work on Windows, not so easy to overwrite a file already open in
editor. Not sure how our old approach works, but apparently it did
better than the new one. As reported by texnonik on Discord

This reverts commit e2084e1e9d.
2021-12-21 23:31:08 +01:00
def 73d8329c4a Implement sv_min_team_size
to prevent too small teams counting as team finishes. You can still
finish with a team smaller than sv_min_team_size, but only get regular
ranks, not team ranks.

This will require going through all our maps and setting
sv_min_team_size in map config for maps intended for more than 2
players. We will also need to remove all teamranks with smaller teams
from official database.
2021-12-21 23:22:28 +01:00
bors[bot] 2f44e076c0
Merge #4504 #4507
4504: Swap: Also switch rescue tees for /r r=heinrich5991 a=def-

As reported by cheeser0613:

2player, 1die in freeze
swap 2 player by /swap
the other 1 also go die in freeze
/practice
one of them cant use /r

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


4507: Add cl(|_dummy|_contact)_port for ISPs that throttle specific ports r=heinrich5991 a=def-

As reported by Ryu

Verified with cl_port 12345; cl_dummy_port 12346:
<img width="681" alt="Screenshot 2021-12-21 at 12 48 11" src="https://user-images.githubusercontent.com/2335377/146925435-ef586ffd-29a0-4ab0-9228-aa77761eca0d.png">
<img width="1067" alt="Screenshot 2021-12-21 at 12 49 23" src="https://user-images.githubusercontent.com/2335377/146925438-9ba7819a-d3a9-42a8-821e-9808d15df9ee.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-12-21 17:44:27 +00:00
def d7ea3371d6 Swap: Also switch rescue tees for /r
As reported by cheeser0613:

2player, 1die in freeze
swap 2 player by /swap
the other 1 also go die in freeze
/practice
one of them cant use /r
2021-12-21 13:09:06 +01:00
bors[bot] d4f126810b
Merge #4484 #4486
4484: Add IStorage::FormatTmpPath static method r=heinrich5991 a=def-

Not sure I prefer it, but now it's done. Any opinions?

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


4486: Add .a files to .gitignore r=def- a=heinrich5991

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-21 10:30:12 +00:00
bors[bot] 51d930800c
Merge #4497
4497: Fix run_on_join being run on normal player again (fixes #4494) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-12-21 03:50:11 +00:00
bors[bot] 53833d2050
Merge #4498 #4499
4498: Respect sv_chat_initial_delay (fixes #4496) 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)


4499: Center cl_show_direction (fixes #4495) r=heinrich5991 a=def-

<img width="1823" alt="Screenshot 2021-12-20 at 23 36 17" src="https://user-images.githubusercontent.com/2335377/146841838-c3a692e5-740f-4295-a885-5439822aab4c.png">

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-12-21 03:38:53 +00:00
def 2727c998c2 Fix crash in GetSaves (fixes #4500) 2021-12-21 00:14:15 +01:00
def 57ebf33b1a Center cl_show_direction (fixes #4495) 2021-12-20 23:34:49 +01:00
def 6037bf7ff6 Respect sv_chat_initial_delay (fixes #4496) 2021-12-20 23:20:46 +01:00
def 2963c30755 Fix run_on_join being run on normal player again (fixes #4494) 2021-12-20 23:19:43 +01:00
def d91d20f079 Add a hint for "Run on join"
Otherwise it's not clear if you can run client commands (f1) or chat
commands (/). As reported by cheeser0613
2021-12-20 18:58:15 +01:00
def 1a02a20fa6 Add IStorage::FormatTmpPath static method
Not sure I prefer it, but now it's done. Any opinions?
2021-12-20 16:12:15 +01:00
bors[bot] 473848a19d
Merge #4482
4482: Use temporary file when saving editor file (fixes #4476) 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-12-20 12:33:05 +00:00
def e2084e1e9d Use temporary file when saving editor file (fixes #4476) 2021-12-20 10:54:46 +01:00
bors[bot] ec0d1172eb
Merge #4481
4481: Don't create cut off UTF-8 sequences on string manipulation r=def- a=heinrich5991

CC #4463
CC #4465 

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-20 08:58:55 +00:00
heinrich5991 58533cddef Fix string functions not to truncate in the middle of a UTF-8 character
This makes `str_utf8_copy` obsolete.
2021-12-20 02:34:02 +01:00
bors[bot] 3013466b86
Merge #4392
4392: Add SQL/Score tests 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-12-20 00:42:03 +00:00
def 3f03d8ee31 Get rid of useless semicolon in SQL queries 2021-12-20 00:50:59 +01:00
def 0c759ae6b6 Deterministic player order in /top5team name
same as in /top5team without name
2021-12-20 00:50:56 +01:00
def 594b4e3d24 Add cl_run_on_join to set command to execute when joining a server 2021-12-20 00:43:49 +01:00
bors[bot] 107438bead
Merge #4479
4479:  Fix normal binds (fixes #4477) 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-12-19 22:56:21 +00:00
def d23bd12c03 Don't handle lalt separately 2021-12-19 23:42:34 +01:00
def 98df2f25eb Fix normal binds (fixes #4477) 2021-12-19 23:42:19 +01:00
def 7484ffc125 Add buttons to open settings file and config directory
Only tested on macOS
2021-12-19 23:22:08 +01:00
def ffc532a302 Add open_file, works on macOS, safer 2021-12-19 23:22:04 +01:00
def 9ef5849f0c Add MySQL test support 2021-12-19 19:40:20 +01:00
def 9dc08ca156 True/False don't exist on older SQLite versions 2021-12-19 19:40:20 +01:00
def baf9b94f2c Factor CScoreWorker out of CScore, add SaveScore test 2021-12-19 19:40:20 +01:00
Dennis Felsing f03cb08150
Merge pull request #3961 from fokkonaut/pr-antibot
Add target clientid to antibot OnHammerHit
2021-12-19 19:33:56 +01:00
bors[bot] 72afa17349
Merge #4449 #4461 #4466 #4469 #4470 #4472 #4473
4449: Fix text selection cursor position (fixes #4444) r=heinrich5991 a=def-

after moving window to a screen with different dimensions than the
initial one

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


4461: Support cl_video_show_direction 2 r=heinrich5991 a=def-

Currently to show your own key presses when recording you need
cl_video_showdirection 1 and cl_show_direction 2 which is kind of
unintuitive.

Also changed the name to be consistent with cl_show_direction

Thanks to hussainx3 for report.

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


4466: Fix GLEW system lib linking on macOS (fixes #4439) r=heinrich5991 a=def-

Only GLEW::GLEW is provided, GLEW_LIBRARIES is empty by default

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


4469: Consider initial chat delays as normal mutes, implement unmuteid (fixes # 4460) 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)


4470: Support GUI/Cmd key and use it as equivalent to ctrl in default shortcuts r=heinrich5991 a=def-

like ctrl-f / cmd-f

On macOS all these system shortcuts are done with cmd while on Windows
ctrl is used. Support both now

Added support for cmd key as modifier for binds

Fixed missing right variants of modifiers in some places

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


4472: Make /rescue handle switch freeze too r=heinrich5991 a=def-

As reported by RonIn

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


4473: Fix comment in CMakeLists.txt 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-12-19 16:58:46 +00:00
def d479cac089 Rename IsSwitch to GetSwitchType 2021-12-19 12:10:03 +01:00
def 17287de243 Make /rescue handle switch freeze too 2021-12-19 12:10:00 +01:00
def acf199835d Support GUI/Cmd key and use it as equivalent to ctrl in default shortcuts
like ctrl-f / cmd-f

On macOS all these system shortcuts are done with cmd while on Windows
ctrl is used. Support both now

Added support for cmd key as modifier for binds
2021-12-18 12:23:20 +01:00
def 374c5ac64d Implement unmuteid, make it clearer that unmute uses ID from mutes
not player id
2021-12-18 11:28:54 +01:00
def 97f8e29a60 Minor cleanup 2021-12-18 11:20:22 +01:00
def 35d5854e28 Consider initial chat delays as normal mutes (fixes # 4460) 2021-12-18 11:20:16 +01:00
bors[bot] 5ec6f0994d
Merge #4410
4410: Fix leak in CLayerTiles::BrushGrab (fixes #4409) r=Learath2 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-12-17 23:38:19 +00:00
heinrich5991 cdbf8ff2d2 Skip the UTF-8 BOM on all read text files
Fixes #4462.
2021-12-17 22:07:01 +01:00
def ef5d3b77a9 Support cl_video_show_direction 2
Currently to show your own key presses when recording you need
cl_video_showdirection 1 and cl_show_direction 2 which is kind of
unintuitive.

Also changed the name to be consistent with cl_show_direction
2021-12-17 10:10:03 +01:00
bors[bot] 625ce302dd
Merge #4443
4443: Swap projectile owners when using /swap r=Learath2 a=def-

Thanks to Soapy Sandwich for responsibly disclosing this issue.
https://user-images.githubusercontent.com/2335377/145693247-c5c1ab2e-6353-4a4a-afab-c73f2d7eebc1.mp4
/swap is currently disabled until this is merged.

<!-- 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
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-12-16 12:39:00 +00:00
bors[bot] 1d88aef9fe
Merge #4456
4456: Pull some more refactoring from the upstream r=def- a=Kaffeine

The main motivation is making it easier to take (and push) patches to/from `teeworlds`

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

I'm not that familiar with the code. Please let me know if this commit make sense or not:
56900d7644

IIUC two other commits from https://github.com/teeworlds/teeworlds/pull/2594 are not relevant for DDNet (because we're reducing the CPU load differently).

Co-authored-by: Alexander Akulich <akulichalexander@gmail.com>
Co-authored-by: Robert Müller <robert.mueller@student.uni-siegen.de>
2021-12-15 07:51:42 +00:00
Robert Müller 843d021f82 add IServer::ChangeMap to fix change_map command
(cherry picked from commit 97d907304c56f643a9ed99e60c35052f950b27fb)
2021-12-15 03:36:25 +03:00
def ddf04c1ff2 Improve interfaces by exposing SwapClients in CEntities 2021-12-14 10:35:00 +01:00
heinrich5991 3185c75bda Don't clear client version on map change
Also still record client version on map changes into teehistorian.

Fixes #4445.

Thanks to @Kaffeine for noticing.
2021-12-14 06:50:30 +01:00
Robert Müller 8ec50f800b increase scrollbar handle size for small scrollbars 2021-12-13 17:48:17 +01:00
def e83a7ff96f Fix unsafe usage of CLaser casts
Since CDraggers are also stores as entities of ENTTYPE_LASER:

/media/ddnet/src/game/server/teams.cpp:898:23: runtime error: downcast of address 0x61600003db80 which does not point to an object of type 'CLaser'
0x61600003db80: note: object is of type 'CDragger'
 00 00 00 00  d0 24 3c b2 75 55 00 00  00 00 00 00 00 00 00 00  80 d8 03 00 60 61 00 00  f8 c1 04 5a
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'CDragger'
2021-12-12 00:35:33 +01:00
def 1d22f6b518 Swap laser owners when using /swap
Since they are implemented independently from projectiles (pistol, grenade)
2021-12-12 00:35:12 +01:00
def 84b1b6f92e Swap projectile owners when using /swap
Thanks to Soapy Sandwich for responsibly disclosing this issue.

/swap is currently disabled until this is merged.
2021-12-11 23:18:38 +01:00
def 9965007fa0 Center timer in HUD (fixes #4438) 2021-12-10 18:27:32 +01:00
Robert Müller 0ff313b130 adopt vanilla scrollbar colors and code style 2021-12-09 22:57:21 +01:00
Alexander Akulich 57e16f3f7b CEntity: Make NetworkClipped() const 2021-12-08 20:35:03 +03:00
def 16c748c6b1 Swap: Don't spam-protect retrying with local messages only
As suggested by 冷落:
> I have a advice./swap need wait 30s,and often someone will say /swap
> within 30 seconds,but kept saying it would be muted
2021-12-05 23:11:17 +01:00
Robert Müller a61c45550d rename Init method and move implementation 2021-12-03 20:26:27 +01:00
Robert Müller 2fe5464938 remove delegate functions in CMenus, fix variable names 2021-12-03 20:26:26 +01:00
Robert Müller f334b52d94 use UIEx() consistently 2021-12-03 20:26:26 +01:00
Robert Müller af82a20374 move ms_FontmodHeight to CUI 2021-12-03 20:26:25 +01:00
Robert Müller 8887a3137c move DoClearableEditBox to CUIEx 2021-12-03 20:26:23 +01:00
Robert Müller d948a1e41f fix variable name 2021-12-03 20:26:21 +01:00
Robert Müller 4bdddb7e3a pass correct number of utf8 characters to Manipulate 2021-12-03 20:26:17 +01:00
bors[bot] 2524905d74
Merge #4413
4413: Fix some more undefined behavior with super (fixes #4412) r=edg-l a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-12-01 12:43:22 +00:00
def 13044e093c Fix some more undefined behavior with super (fixes #4412) 2021-11-29 17:12:50 +01:00
Robert Müller 083c29f191 fix initialization of CUIEx::m_MouseSlow 2021-11-29 15:43:16 +01:00
def a45829f16d Fix leak in CLayerTiles::BrushGrab (fixes #4409) 2021-11-29 14:29:24 +01:00
bors[bot] ca558f406d
Merge #4398
4398: Synchronize with upstream and refactor UI scrollbars r=def- a=Robyt3

- Change appearance of all scrollbars to be consistent with upstream.
  - Change the large knob design that was used in some places to the flat design everywhere (except for color pickers).
  - Add consistent margins around scrollbars.
- Implementing clicking on scrollbar rails to instantly change the value.
- Consolidate UI scrollbar functions from menus and editor in `CUIEx`.
- Various minor refactorings.

## Screenshots

### Before

![br_old](https://user-images.githubusercontent.com/23437060/143658193-d9ea0d31-fa92-466e-9f54-099893caf567.png)
![settings_old](https://user-images.githubusercontent.com/23437060/143658198-1cd3ad52-4680-492c-b244-2699cb5b1c84.png)
![color_old](https://user-images.githubusercontent.com/23437060/143658194-3029dac5-eb29-4fed-a7ed-139f9a00803f.png)
![ed_file_old](https://user-images.githubusercontent.com/23437060/143658195-db00a54d-04ae-41cc-b78c-8a04303486d6.png)
![ed_img_old](https://user-images.githubusercontent.com/23437060/143658196-7f83feb6-8e92-4321-a600-d5ea18f117ad.png)

### After

![br_new](https://user-images.githubusercontent.com/23437060/143658211-1cf8bc58-1bc5-49ef-9946-afa75651c53e.png)
![setting_new](https://user-images.githubusercontent.com/23437060/143658210-00fa3b82-66a3-407a-a5d2-4a736f6b6643.png)
![color_new](https://user-images.githubusercontent.com/23437060/143658212-fca3ef8a-1e67-40f0-983a-3ad83b313ee5.png)
![ed_file_new](https://user-images.githubusercontent.com/23437060/143658214-d93fd473-56d6-48f0-81bb-3dea37618922.png)
![ed_img_new](https://user-images.githubusercontent.com/23437060/143658207-7118887a-4046-4779-8c19-6aba64c8c4ad.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: Robert Müller <robert.mueller@uni-siegen.de>
2021-11-28 09:56:44 +00:00
def 5be5f1032a Fix stack-buffer-overflow in Whisper (fixes #4400) 2021-11-27 20:58:06 +01:00
Robert Müller 053981ee4c refactor UI scrollbars 2021-11-26 23:03:45 +01:00
bors[bot] 5c46efc892
Merge #4391
4391: Remove ping filter (fixes #4365) r=edg-l a=def-

We had lots of cases of people having ping filter activated. Ping is now
too unreliable to actually filter by it. It can show an old super high
value and then you never see the location again.
![screenshot-20211124@160502](https://user-images.githubusercontent.com/2335377/143262874-0cb93dba-9539-4d0d-8400-399dffd3509b.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
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-11-26 08:21:18 +00:00
bors[bot] c74b0c8536
Merge #4389
4389: Sanitize owner data in client (fixes #4388) r=edg-l a=def-

and don't access out of scope on owner < 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
- [x] Considered possible null pointers and out of bounds array indexing
- [x] Changed no physics that affect existing maps
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2021-11-26 06:55:48 +00:00
bors[bot] d549c2a0f3
Merge #4396
4396: /swap fix: swap started/finished information r=edg-l a=def-

Thanks to 冷落 for report

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


Co-authored-by: def <dennis@felsin9.de>
2021-11-26 06:45:28 +00:00
def c6a637948a Version 15.7 2021-11-25 23:51:05 +01:00
def 8dce8d0a8c /swap fix: swap started/finished information
Thanks to 冷落 for report
2021-11-25 23:48:29 +01:00
Robert Müller d747edd1cf replace DeleteUntilCursor and DeleteFromCursor with SetRange 2021-11-25 00:05:04 +01:00
Robert Müller dcdea25284 remove unused CLineInput::CCallback 2021-11-25 00:05:04 +01:00
Robert Müller c5ca424675 add CLineInput::Insert 2021-11-25 00:04:59 +01:00
Robert Müller 85236edcde rename CLineInput::Add to Append and refactor 2021-11-25 00:03:44 +01:00
Robert Müller 35a3d8c604 add CLineInput::SetRange 2021-11-25 00:00:20 +01:00
Robert Müller fa8f540108 use str_utf8_stats in CLineInput::Manipulate 2021-11-24 23:39:34 +01:00
Robert Müller 5cf356229b refactor CLineInput::Clear 2021-11-24 23:31:40 +01:00
Robert Müller 350042975b use str_utf8_stats in CLineInput::Set 2021-11-24 23:29:09 +01:00
def 7464785013 Remove ping filter (fixes #4365)
We had lots of cases of people having ping filter activated. Ping is now
too unreliable to actually filter by it. It can show an old super high
value and then you never see the location again.
2021-11-24 16:04:04 +01:00
def a817a2e60f Sanitize owner data in client (fixes #4388)
and don't access out of scope on owner < 0
2021-11-24 15:41:27 +01:00
bors[bot] 2376de500d
Merge #4381 #4382 #4387
4381: Fix enter behavior when creating new folder in editor r=edg-l a=def-

As reported by louis:

> pressing enter while creating a new folder in the editor (while using
> "save as") does not create the folder but instead enters the selected
> folder in the background

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


4382: Fix save typing when server settings are open in editor r=edg-l a=def-

As reported by louis:

> while saving a mapname while having the "Server Settings" tab open,
> pressing "m" while typing the mapname will unfocus the cursor from the
> mapname field onto the server settings field

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


4387: Don't access switchers out of bounds (fixes #4386) r=edg-l a=def-

It's possible that a map was saved with a different amount of switchers
than it has at the moment. Happened on Jao Shooter. I'll check with
mapper if they changed the number of switchers.

<!-- 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-11-24 11:57:19 +00:00
def 2e34f45c50 Don't access switchers out of bounds (fixes #4386)
It's possible that a map was saved with a different amount of switchers
than it has at the moment. Happened on Jao Shooter. I'll check with
mapper if they changed the number of switchers.
2021-11-23 19:01:52 +01:00
def 36a6b39031 Fix save typing when server settings are open in editor
As reported by louis:

> while saving a mapname while having the "Server Settings" tab open,
> pressing "m" while typing the mapname will unfocus the cursor from the
> mapname field onto the server settings field
2021-11-22 18:26:14 +01:00
def b4b9016cf4 Fix enter behavior when creating new folder in editor
As reported by louis:

> pressing enter while creating a new folder in the editor (while using
> "save as") does not create the folder but instead enters the selected
> folder in the background
2021-11-22 18:12:32 +01:00
def bd1a2a655f No wasd moving when dialog is open (fixes #4370) 2021-11-20 10:42:28 +01:00
def 26797274ba Remove duplicate name in credits 2021-11-19 10:38:36 +01:00
trml aba2c66507 Clip network first in CDragger 2021-11-19 00:42:00 +01:00
fokkonaut 3d2df7cfc9 Disallow dummy option (closes #4305, #4316) 2021-11-17 20:35:39 +01:00
bors[bot] 5f17c5360a
Merge #4283
4283: Hopefully crash less with ASAN r=heinrich5991 a=Learath2

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

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [x] Considered possible null pointers and out of bounds array indexing
- [ ] 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: Learath <learath2@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2021-11-17 13:50:48 +00:00
def fb23d4637b Add contributors 2021-11-16 18:54:07 +01:00
bors[bot] 7e9f1cc85e
Merge #4306
4306: Small optimization of EntityEx snapping r=def- a=trml

This drops sending entityex to old client versions, and for stationary pickups not in switch layer (since they don't benefit from entity ex for prediction).

It also slightly changes how m_StartTick is snapped for CLight and CGun when EntityEx is present (always sets it to 0, which could reduce network traffic slightly). However, this might cause misprediction (or invisible lights/guns) for clients who have already changed their version to 15.6, so can omit this part if wanted.

## 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>
2021-11-16 08:07:52 +00:00
bors[bot] 8c49d20cb6
Merge #4315
4315: Use W, A, S, D to navigate in editor r=def- a=ChillerDragon

Sorah requested it on discord

## Checklist

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


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-11-16 07:56:22 +00:00
def f5eaf393da Increase console backlog size from 64 KB to 1 MB
Can't even list all bot bans currently
2021-11-15 23:26:19 +01:00
bors[bot] cdfc521132
Merge #4340 #4350
4340: Add functions for packing/unpacking int/unsigned using char arrays r=heinrich5991 a=Robyt3

Add `uint_to_bytes_be` and `bytes_be_to_uint` functions from upstream and use them where applicable to reduce duplicate 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)


4350: Fix map_extract r=heinrich5991 a=def-

Reported by cheeser0613

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

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: def <dennis@felsin9.de>
2021-11-15 19:33:45 +00:00
Robert Müller 12699aa3e4 add functions for packing/unpacking int/unsigned using char arrays 2021-11-09 22:19:32 +01:00
bors[bot] 0443a3ef65
Merge #4341
4341: Make laser doors show correctly when spectating other players r=def- a=trml

Makes the server send the switch state of other players while spectating others, otherwise the switch state of your own player (including when spectating in freeview).

Also changed the client a little to both handle situations where the server only sends one SWITCHSTATE netobject (then it just uses that team) or all (then it chooses the team that maintains the above behavior). I'm not sure if the latter would really be useful (but since the netobject contains a team it would be possible to do so).

## 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>
2021-11-09 08:40:52 +00:00
trml 57387b5965 Fix switch state when spectating other players 2021-11-08 23:51:28 +01:00
def 114acb4887 Version 15.6.2 2021-11-08 17:08:52 +01:00
bors[bot] 455ee32754
Merge #4337
4337: Fix DbgDummy check being at the wrong place r=def- a=heinrich5991

Fixes #4325.

## 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: ChillerDragon <ChillerDragon@gmail.com>
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-11-08 15:11:43 +00:00
bors[bot] 959e65d82f
Merge #4326
4326: Fix spacing in HUD settings for 5:4 resolution r=heinrich5991 a=def-

Before:
![screenshot-20211107@112309](https://user-images.githubusercontent.com/2335377/140641210-4e1ba689-4e67-4b1d-a3fc-330dd5cc6218.png)
Now:
![screenshot-20211107@112758](https://user-images.githubusercontent.com/2335377/140641264-84b9b16e-a889-40c2-8b72-87ccce3acf8f.png)

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-11-07 23:49:21 +00:00
heinrich5991 210b3d1fb2 Make control flow not depend on preprocessor macros 2021-11-08 00:33:35 +01:00
ChillerDragon de2f820c90 DbgDummy check belongs to check ingame not to sql 2021-11-08 00:33:35 +01:00
bors[bot] ac3d9d0c9a
Merge #4335
4335: Escape skin name when downloading (fixes #4333) r=Jupeyy 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-11-07 18:03:57 +00:00
def ce10e29351 Escape skin name when downloading (fixes #4333) 2021-11-07 17:01:50 +01:00
def 5acf6e77da Fix spacing in HUD settings for 5:4 resolution 2021-11-07 11:39:22 +01:00
trml 8db53f2a03 Fix sort comparator 2021-11-07 11:00:48 +01:00
bors[bot] 70607b4094
Merge #4311
4311: Fix crash in CDragger (fixes #4307) r=Jupeyy a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-11-06 23:54:09 +00:00
Jupeyy d0b634216c Don't set cursor on empty text 2021-11-06 23:34:44 +01:00
def e13987bdd3 Fix crash in CDragger (fixes #4307) 2021-11-06 20:07:12 +01:00
Jupeyy d4dd3e6969 Use delete[] for m_pSwitchers 2021-11-06 18:12:07 +01:00
ChillerDragon b5d09ddb6e Use W, A, S, D to navigate in editor 2021-11-06 16:48:25 +01:00
def 146d1d0173 Version 15.6.1 2021-11-06 13:13:51 +01:00
trml ae8ccdf97a Don't send entityex to old clients or for stationary pickups 2021-11-06 12:13:42 +01:00
def 4ddb553355 Fix snd_chat and snd_team_chat (fixes #4302) 2021-11-05 17:00:39 +01:00
bors[bot] 9cb30a8c66
Merge #4287
4287: sv_plasma_per_sec 0 => disable firing r=Jupeyy a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-11-04 13:45:23 +00:00
def 1bb21e1635 Version 15.6 2021-11-04 14:28:32 +01:00
fokkonaut ae6bb9763d Fix characters disappearing (fixes #4285) 2021-11-04 14:15:24 +01:00
def c96f67ce72 maybe_unused with older compilers 2021-11-04 10:59:25 +01:00
def 5b5afe2b4a GET_SIZE -> MACRO_ALLOC_GET_SIZE 2021-11-04 10:50:39 +01:00
def 5413041104 sv_plasma_per_sec 0 => disable firing 2021-11-03 17:21:51 +01:00
Learath 2c7a8bcb73 Pad to 8b boundary 2021-11-03 16:10:40 +01:00
bors[bot] 82c7b20001
Merge #4286
4286: Don't divide by 0 with sv_plasma_per_sec r=edg-l a=def-

Thread 1 "DDNet-Server" received signal SIGFPE, Arithmetic exception.
0x000055555560d65f in CGun::Tick (this=0x55555583b440) at /media/ddnet/src/game/server/entities/gun.cpp:109
109		if(m_LastFire + Server()->TickSpeed() / g_Config.m_SvPlasmaPerSec <= Server()->Tick())

<!-- 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-11-03 14:16:27 +00:00
def 469e6ba1af Quick fix quick fix 2021-11-03 15:13:47 +01:00
def a541894d59 Don't divide by 0 with sv_plasma_per_sec
Thread 1 "DDNet-Server" received signal SIGFPE, Arithmetic exception.
0x000055555560d65f in CGun::Tick (this=0x55555583b440) at /media/ddnet/src/game/server/entities/gun.cpp:109
109		if(m_LastFire + Server()->TickSpeed() / g_Config.m_SvPlasmaPerSec <= Server()->Tick())
2021-11-03 14:57:31 +01:00
def 63c4617b9e Quick fix: entity id != player id 2021-11-03 09:15:48 +01:00
def 45827bce80 Simplify 2021-11-03 01:06:15 +01:00
bors[bot] fd6b26fb5c
Merge #4284
4284: Reset selection, if gui element was changed outside of DoEditBox r=def- a=Jupeyy

Changing ui element by hot keys was not visible to DoEditBox, and thus didn't act like selection params were resetted

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-11-02 23:51:09 +00:00
Learath 066467f742 Ugly but more portable 2021-11-03 00:51:03 +01:00
Jupeyy 6a98fd163b Reset selection, if gui element was changed outside of DoEditBox 2021-11-03 00:46:36 +01:00
Learath 216bf45030 Hopefully crash less with ASAN 2021-11-03 00:25:02 +01:00
bors[bot] 259155cb27
Merge #4282
4282: Fix heap-use-after-free in OnMessage (fixes #4279) 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-11-02 23:10:11 +00:00
def e410315772 Fix heap-use-after-free in OnMessage (fixes #4279) 2021-11-03 00:08:58 +01:00
def 65655975bc Try to fix CDragger's heap-use-after-free (fixes #4277) 2021-11-02 17:09:25 +01:00
Jupeyy 9a0f16b55b Add exception id to TeamKill 2021-11-01 16:49:14 +01:00
Learath ee10debfe5 Try to catch #4240 in action 2021-10-31 16:18:00 +01:00
Jupeyy cc87d49c9b Reset text color after kill messages are created 2021-10-29 00:11:21 +02:00
def e1f131b068 Allow zooming any distance in editor
as requested by Knuski
2021-10-28 10:14:30 +02:00
trml 4a8f18c322 Use correct (larger) m_NumSwitchers bound 2021-10-26 16:16:34 +02:00
fokkonaut 5d86646985
Fix pickup network clipping 2021-10-26 15:34:00 +02:00
bors[bot] 5df2febd58
Merge #4245
4245: Further fixes for cpu/zoom on large maps with entityex r=def- a=trml

Attempt to fix #4244

Added network clipping to entity ex for projectiles and pickups, and made snapping of gamecontroller happen before gameworld (as suggested in #4236), which should help when zooming out on large maps in general (where the number of entities exceeds the maximum number of snap items).

Also added bounds checks for switchers in the client.

## 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: trml <trml@users.noreply.github.com>
2021-10-26 09:50:51 +00:00
bors[bot] 3adadd039e
Merge #4250
4250: Fix mouse select position in console when using different page r=def- a=Jupeyy

fixes #4246

Also noticed if you enter so much text that console input goes into the second line, it will move the whole console up, but i disabled selection in this case for now, because don't want to redesign the whole console rn and is a real edge case anyway.

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-10-26 09:25:17 +00:00
Jupeyy 4af9bc7123 Fix mouse select position in console when using different page 2021-10-26 00:16:52 +02:00
bors[bot] 77dcf023a9
Merge #4238 #4249
4238: Make downstream merges easier r=def- a=ChillerDragon

Untested

4249: Using unsuper does not give an advantage r=def- a=ChillerDragon

Count runs that used "unsuper" as legal finishes.

Co-authored-by: Chiller Dragon <chillerdragon@gmail.com>
2021-10-25 21:59:21 +00:00
Chiller Dragon 2c72112eca
Using unsuper does not give an advantage 2021-10-25 22:06:16 +02:00
trml e2dbba3146 Network clipping for entityex in CPickup and CProjectile, snap gamecontroller before gameworld, bound checks for switchers in client 2021-10-25 02:34:28 +02:00
Jupeyy c7ae79aec5 Minimal changes from mouse state change: fix editor & input 2021-10-23 14:24:52 +02:00
Jupeyy 0d17665137 Revert "Add new mouse state"
This reverts commit e4cb348db2.
2021-10-23 13:48:21 +02:00
Chiller Dragon c185e75403
Make downstream merges easier 2021-10-23 11:03:55 +02:00
trml 676d6e41aa Snap players first to ensure they are always sent 2021-10-22 00:40:20 +02:00
trml 85a99d174d Preprocess snap items to make getting EntityEx faster 2021-10-22 00:40:17 +02:00
trml 2964c1b4c4 Use network clipping for EntityEx 2021-10-21 22:46:45 +02:00
def 663eea9cab Fix pasting crash in edit box (fixes #4230)
Don't allocate string with -1 size
2021-10-19 13:49:33 +02:00
def a269671738 Fix segfault when joining team (fixes #4224) 2021-10-17 19:27:38 +02:00
bors[bot] fce6776c38
Merge #4095 #4176
4095: [Concept] Add new mouse state (ingame mouse) r=def- a=Jupeyy

This would remove ui_mousesense and use the desktop cursor position instead for menus and editor
This would also fix the editor cursor to not move faster than in menus.
That's probably how most games would handle menus, instead of using relative mouse mode
And this would work for touch inputs.

The normal gameplay relative mouse is ofc NOT affected by any kind

Opinions?

Missing:
- [x] m_MouseSlow in menus
- [x] Make desktop cursor invisible
- [x] Some components that use ui mouse
- [x] Remove focus in/out relative mouse state changes, fixed with next SDL version


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


4176: Entity switch prediction r=def- a=trml

Adds the prediction for pickups and projectiles (based on #4108)

For blinking entities (deactivated by switch) I also used the extended info to make the blinking effect happen client-side. So instead of the server omitting the projectile/pickup from the snapshot every N ticks (which prevented some things like explosive bullets from being predicted correctly), the server will keep sending the item and let the client decide how to show it.

Added doors as well, and changed how they are sent (and rendered) in a similar way (by always sending both endpoints and using a fixed m_StartTick instead of updating it every tick).

An idea was that this could potentially reduce network traffic a bit (in addition to helping with prediction), especially for stationary items that are rarely/never have to be updated (doors and pickups).

This makes CItems::OnRender a bit more complex, and it could perhaps be cleaned up some way (either using something like CProjectileData, or by moving more of the logic into RenderProjectile/Laser/Pickup).

Some things missing:
- Add more entities (draggers, light, gun)
- Entities are not correctly shown when in super (e.g. doors are shown as closed, and should be open)

## 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: trml <trml@users.noreply.github.com>
2021-10-16 16:38:18 +00:00
bors[bot] f8d634f8d7
Merge #4215
4215: Old chat wrapping for old chat mode r=def- a=Jupeyy


![screenshot_2021-10-14_16-50-34](https://user-images.githubusercontent.com/6654924/137342505-ea0a56b6-24cd-4163-8ad9-7a8f03b2671e.png)

## Checklist


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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-10-16 16:27:48 +00:00