Commit graph

7314 commits

Author SHA1 Message Date
Jupeyy 8451775821 Make components member of CGameClient 2021-07-12 12:07:31 +02:00
bors[bot] dbc05f6bb0
Merge #3947
3947: Allow zooming to levels. Close #3923 r=def- a=Learath2

I guess no harm in adding this since it's such a trivial addition? If it's useful to someone might as well have it.

Closes #3923 

## 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: Learath2 <learath2@gmail.com>
2021-07-10 14:16:20 +00:00
Learath2 1a6de7caf8 Allow zooming to levels. Close #3923 2021-07-10 15:53:23 +02:00
def 2a74ca331e Avoid double free on m_pScore (fixes #3939) 2021-07-08 20:21:22 +02:00
def 6598e0a543 Another MacOS -> macOS in translations 2021-07-08 09:08:08 +02:00
def 2cb3c575f5 Merge master into pr_use_cpp 2021-07-04 16:09:20 +02:00
bors[bot] 0e4e884b13
Merge #3935
3935: Remove switch state from prediction, initialize m_Layer r=def- a=trml

I couldn't reproduce #3934, but I believe it was caused by uninitialized values in projectiles (m_Layer and m_Number), which should be fixed now. Also cleaned up the unused switch code (all except tiles with number 0).

## 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-06-29 12:51:06 +00:00
def c24060f244 Compare lower case strings respecting utf8 (fixes #3937) 2021-06-28 22:51:14 +02:00
trml 48a84aef46 Remove switch state from prediction, initialize m_Layer 2021-06-28 00:29:42 +02:00
Sefa Eyeoglu 801ebbd161
fix: switch servers after player confirms
When a player wants to switch servers in-game, but needs to confirm the
action because of cl_confirm_disconnect, the game used to not actually
connect to the new server.

This adds a way to still connect to that server, after the player
confirms.

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
2021-06-26 14:29:06 +02:00
Jupeyy a663799188 uint64 -> uint64_t, int64 -> int64_t 2021-06-24 17:19:17 +02:00
Jupeyy 9dfea5511a Use cpp 2021-06-24 17:19:17 +02:00
bors[bot] 0393ac0f88
Merge #3930
3930: Still allow lock/unlock/practice while sv_chat_initial_delay is set r=Jupeyy a=def-

Not sure if we should just allow them whenever someone is muted

Fixes #3929

<!-- 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-06-23 09:11:17 +00:00
def 29c95bc0a2 Still allow lock/unlock/practice while sv_chat_initial_delay is set
Not sure if we should just allow them whenever someone is muted

Fixes #3929
2021-06-23 08:51:13 +02:00
bors[bot] dc2fb88929
Merge #3927
3927: Forbid votes while being muted r=def- a=heinrich5991

Fixes the problem of people abusing the vote reason for spamming.

Fixes #3926.

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

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-06-22 21:05:08 +00:00
heinrich5991 15c6ad2fe7 Forbid votes while being muted
Fixes the problem of people abusing the vote reason for spamming.

Fixes #3926.
2021-06-22 22:45:30 +02:00
def a79d7b1965 Version 15.5.4 2021-06-20 11:39:04 +02:00
def d3e7306457 Version 15.5.3 2021-06-20 09:35:10 +02:00
effyn 286c99805f
Fix typo 2021-06-17 02:41:45 -07:00
bors[bot] a4e2457eed
Merge #3905
3905: Init mouse diff floats in editor r=def- a=Jupeyy

I assume is the cause the cursor in editor often is gone, bcs when alt tab it moves the cursor based on uninitialized values

## 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-06-15 13:29:11 +00:00
heinrich5991 c5cd8d354d Add a new failure log level to the HTTP module
Use it for the "determine best masterserver" job, so that we can debug
failures.
2021-06-15 00:12:06 +02:00
Jupeyy 942cbba7cf Init mouse diff floats in editor 2021-06-13 21:07:40 +02:00
def 56df0cf4ee Version 15.5.2 2021-06-13 18:07:33 +02:00
def 6388002467 Version 15.5.1 2021-06-12 18:51:48 +02:00
def b767d7a37c Version 15.5 2021-06-12 11:21:08 +02:00
bors[bot] ddcf654e7a
Merge #3895
3895: Translate "Name" and "Time" header in ghost menu r=def- a=TsFreddie

![image](https://user-images.githubusercontent.com/3797859/121635979-cb176280-cab9-11eb-9304-49a99bd4c048.png)

These two headers weren't translated.

## 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: Freddie Wang <tsfreddiewang@gmail.com>
2021-06-11 07:17:15 +00:00
Freddie Wang 32b8c8c192
Translate "Name" and "Time" header in ghost menu 2021-06-11 13:31:30 +08:00
Jupeyy 9956242b4e Remove cl_load_country_flags 2021-06-08 01:06:07 +02:00
bors[bot] 8bd552d3b8
Merge #3884
3884: Make mouse pos calculation more robust against NaNs r=def- a=Jupeyy

1. Since the config didn't have a limit set, they could be negative, which directly caused bugs
2. If you set a min mouse distance, lets say 5, It can mathematically happen that you drag your mouse exactly so much that you hit the (0, 0) point and the if(.. < MinDistance) branch normalizes that point, which causes non restorable NaNs.
It's now safe, the min distance is later in code checked to be atleast 1, i "even" just made it safe enough, so there shouldn't be any change in behaviour:
07ab4d5356/src/game/client/components/controls.cpp (L298-L304)
Which casts the float to an int and checks the int, and this does not restore the mouse pos for NaNs, because nan to int is not 0
its some insanly high value int_max or smth

To reproduce both bugs "easily" on current master you can abuse a SDL limitation,
relative mouse mode seems to only move upto +-1 unit,
- so for 1. set the ingame mouse sens to 100000 and the max mouse distance to -1000 and move your mouse fast for a few seconds, happens relativly easy (Thanks to Souly how to reproduce it)
- for 2. set mouse sens to 100 and max distance to 1 and min distance to 5, this case is a bit harder to reprod in debug mode, probably bcs of the way mouse pos is later handled and also maybe bcs of floating point differences with signs that go close to 0... had to move the mouse few seconds but still got it relativly fast (with -0fast it happens almost instant)

it will exactly happen what i explained in 2. that the reported mouse movement negates the current mouse pos, resulting in mouse pos (0,0)

![screenshot_2021-06-06_21-55-18](https://user-images.githubusercontent.com/6654924/120938281-35bf4b80-c712-11eb-9b6b-7523e8b436bd.png)

This this was also a bug reported in #bugs channel, i think we could also add it to the release

## 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-06-07 08:28:24 +00:00
Jupeyy cd68b4608e Make calculation which sets mouse pos safer 2021-06-06 23:38:11 +02:00
Jupeyy 403803df4f Give mouse settings a maximum 2021-06-06 23:38:11 +02:00
Zwelf 4d14bcea0b Fix inconsistent handling of death tile between front and game layer 2021-06-05 16:38:53 +02:00
def 87ed889747 Move hammer and pistol weapons (fixes #3872) 2021-06-02 12:28:14 +02:00
Jupeyy aa9338614f Use FontSize for rendered cursor 2021-05-31 16:23:07 +02:00
Jupeyy 14f448d6d6 Init input handling in UI Ex 2021-05-31 12:27:04 +02:00
bors[bot] e5e2e46da2
Merge #3837
3837: Use "occupado" spawn spots when nothing else is left r=heinrich5991 a=def-

Better than not spawning at all

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2021-05-28 17:21:50 +00:00
bors[bot] 992cd86d8e
Merge #3848
3848: Update German translation, some minor English fixes, update language files 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-05-28 17:11:05 +00:00
Learath2 7e95911714 Fix alignment for CVoteOptionServer 2021-05-27 19:35:20 +02:00
Freddie Wang 769970b30b Only predict pickup if affected by movers 2021-05-27 15:45:41 +08:00
def 3716bece80 masterserver -> master server, serverlist -> server list 2021-05-27 09:03:36 +02:00
bors[bot] efde7523e4
Merge #3772
3772: Add client-side HTTP server info r=def- a=heinrich5991

Summary
=======

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

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

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

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

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

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

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

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

(also known as user-visible changes)

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

This is alleviated a bit by providing an approximate location for each
server (continent) so the client only has to know its own location for
approximating pings.
## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-05-26 21:00:49 +00:00
bors[bot] fbf3d6e943
Merge #3844
3844: Add UI Ex class to share common ui implementations r=def- a=Jupeyy

Between menus and editor for example

Currently only did DoEditBox, as this created crashes in the editor

fixes #3395

It's copy and paste from the implementation of CMenus, except for 4 lines, which i'll mark below

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-05-26 13:21:01 +00:00
Jupeyy b7adc5a690 Add UI Ex class to share common ui implementations
between menus and editor for example
2021-05-26 15:02:33 +02:00
bors[bot] 47d63317aa
Merge #3826
3826: Respect TuneZone for characters r=def- a=TsFreddie

*I might be totally insane for doing this.
*The effect is only truly noticeable if you have high ping AND dropping packets.*

*clang-tidy's warning doesn't seems to relate to anything I've changed*


Now characters will try to respect TuneZones when ~~evolving and~~ predicting (like projectiles do). Since it is really important to keep TuningList as accurate as possible, I made a TuningList update logic so we try our best to update tunings only for the correct TuneZone (instead of constantly shoving current tuning into TuningList)

And each CCharacterCore now has its own Tunings to avoid any characters influencing GameWorld's tuning. Some server code has to be updated accordingly. I checked the code path, didn't notice anything that would make our server behave differently.

And I guess I should tag @trml myself this time.

## 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 (as far as I could tell)
- [ ] 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: Freddie Wang <tsfreddiewang@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2021-05-23 08:16:57 +00:00
Zwelf fa79ffa1a1 Simplify entities destruction 2021-05-22 20:02:00 +02:00
bors[bot] bf1fa15380
Merge #3841
3841: Add better support for compose binds in demo menu r=def- a=ChillerDragon

I assume shift is a common compose bind. So users might have bound
shift+scroll or shift+arrowkeys to something else and do not want to
change the playback speed while triggering that compose bind.

I have to admit this is something I personally need and I am not sure what the demand for it is.
But for example my zoom bind is shift+mousewheelup and shift+mousewheeldown and I change that a lot while watching demos but it keeps affecting the playback speed. Maybe someone else has a compose bind using the alt key I do not know. But this solves my issue :)

## 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-05-22 10:03:42 +00:00
bors[bot] 502711541e
Merge #3804
3804: HiDPI-aware Resolution List r=def- a=TsFreddie

This is a version of https://github.com/teeworlds/teeworlds/pull/2827

Which gives you a resolution list that allows you to select appropriate window size (which is saved in config and used to initialize videos), while showing the canvas size (which is the drawing resolution), at least on MacOS.

This also fixes incorrect clips that happens without HiDPI enabled, because `Graphics()->ScreenWidth()` (in canvas size) was reported incorrectly before, which is now fixed.

Also, I noticed that `m_DesktopScreenWidth` and `m_DesktopScreenHeight` (in window size in MacOS) is used incorrectly or differently from what it was used during initialization:

* During initialization, DesktopScreenWidth is the "screen width of your desktop", but it was used as the "game window size on your desktop" when checking whether to resize window. I added a separate window size calculation to use during resize.

Also, god, I hope SDL's different sizes and stuff is reported consistently at least in Wayland or X, so please test. I know in Windows they are always in pixel/canvas size so it might not be a huge issue there.

## Checklist

- [x] Tested the change ~~ingame~~ on MacOS
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options (again, on MacOS, with both HiDPI and non-HiDPI settings)
- [ ] 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: Freddie Wang <tsfreddiewang@gmail.com>
2021-05-22 09:56:09 +00:00
ChillerDragon 7d87089acd Make sure ctrl+shift+s works same as clicking UI
Do not overwrite the current map when saving as a new file

closed #1972
2021-05-22 11:40:08 +02:00
ChillerDragon 18e69b4df1 Add better support for compose binds in demo menu
I assume shift is a common compose bind. So users might have bound
shift+scroll or shift+arrowkeys to something else and do not want to
change the playback speed while triggering that compose bind.
2021-05-22 11:31:15 +02:00
Jupeyy b607cf0f60 Remove texture quality config 2021-05-21 15:00:14 +02:00