Commit graph

4116 commits

Author SHA1 Message Date
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +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
heinrich5991 4435e17b95 Fix a few bugs in dummy handling
Previously, e.g. pings would only be replied to on the currently active
client.
2022-01-21 02:02:08 +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
Dennis Felsing 57d340701d Forgot a part of the asyncrender revert 2022-01-20 16:02:02 +01:00
Jupeyy 55a1406641 Further android build fixes 2022-01-20 11:04:47 +01:00
bors[bot] 054e7528dd
Merge #4612
4612: Handle SIGINT and SIGTERM (fixes #4610) r=heinrich5991 a=def-

Code by Robyt3 taken from Teeworlds, added SIGTERM

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-17 23:51:58 +00: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
Dennis Felsing 8a6cb2bed7 Simplify signal handling by unregistering 2022-01-18 00:35:33 +01:00
Dennis Felsing d54a7993d5 Fix compiler warning with ffmpeg 5.0 2022-01-18 00:30:34 +01:00
Dennis Felsing f16e1f09c1 Also handle SIGTERM (fixes #4610) 2022-01-17 23:16:03 +01:00
Robert Müller 259a449b67 use compliant sig_atomic_t for signal handler, use _Exit 2022-01-17 23:15:52 +01:00
Robert Müller a69852bdfc force quit on second Ctrl+C 2022-01-17 23:15:52 +01:00
Robert Müller eecd13476c handle SIGINT in server to properly shutdown everything 2022-01-17 23:15:49 +01:00
Robert Müller c495d4b327 change type of MouseDoubleClick from int to bool 2022-01-16 12:43:32 +01:00
oy e3b20696cc end double mouse click state when doing a new single click. 2022-01-16 12:43:32 +01:00
oy bbc194ce2a use info provided by sdl for mouse double clicks 2022-01-16 12:43:32 +01:00
Robert Müller 3557bea32d reduce indentation of input event handling code 2022-01-16 12:43:29 +01:00
Robert Müller 6675de319b do not copy keyboard over mouse state, refactoring 2022-01-16 12:41:31 +01:00
Robert Müller 79879591b1 refactor mouse state handling 2022-01-16 12:41:31 +01:00
Robert Müller b4a99fecdf Revert "Split CInput::NextFrame() from CInput::Update() (fixes #444)"
This reverts commit 72a6e20ba8.
2022-01-16 12:41:31 +01:00
bors[bot] c1cd846c79
Merge #4568
4568: Reduce default ambient volume to 30 (fixes #4567) 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>
2022-01-15 16:28:28 +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
Robert Müller 4dbd8b454d Fix OOB access in CSnapshotDelta::UnpackDelta, cleanup 2022-01-14 19:10:43 +01:00
bors[bot] ccdb758479
Merge #4592
4592: Fix crash in macOS when moving screen (fixes #4435) r=Jupeyy a=def-

Thanks to Jupeyy for the suggestion

Normally it crashes after a few seconds, tried moving window around, resizing, moving between screens like crazy and no crashes after 1-2 min.

## 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-13 14:50:12 +00:00
bors[bot] 53b652f16f
Merge #4582
4582: Revert "Disable gfx_asyncrender_old on macOS (fixes #4435)" r=Jupeyy a=def-

Doesn't help fully against the crashes, just makes them a bit less
likely. Causes VSync to have even more delay. Should find an alternative
(real) fix.

This reverts commit 7d8a142768.

<!-- 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-13 14:33:32 +00:00
Dennis Felsing 52e03c765d Fix crash in macOS when moving screen (fixes #4435)
Thanks to Jupeyy for the suggestion
2022-01-13 15:33:10 +01:00
trml 30093e44c5 Remove extra projectiles 2022-01-13 00:46:11 +01:00
trml e7f13bc5da Only use configured prediction margin on servers with predictable/synced weapon input 2022-01-11 01:30:05 +01:00
bors[bot] 469136b5e7
Merge #4587
4587: Fix OOB read in snapshot code reported by mmmds r=def- a=Robyt3

See https://github.com/teeworlds/teeworlds/issues/2643.


## 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: heinrich5991 <heinrich5991@gmail.com>
2022-01-10 22:04:58 +00:00
heinrich5991 4cc96d8116 Fix OOB read in snapshot code reported by mmmds
Fix #2643.
2022-01-10 22:45:42 +01:00
Zwelf 23e009b184 Skip over read queries and write into backup database in FailMode 2022-01-09 22:51:55 +01:00
Zwelf 5a8f9a2dd5 Skip read requests during shutdown 2022-01-09 22:51:55 +01:00
def 71267d91be Revert "Disable gfx_asyncrender_old on macOS (fixes #4435)"
Doesn't help fully against the crashes, just makes them a bit less
likely. Causes VSync to have even more delay. Should find an alternative
(real) fix.

This reverts commit 7d8a142768.
2022-01-09 17:28:37 +01:00
trml f3b0a1e331 Add ClPredictionMargin 2022-01-09 13:08:11 +01:00
Dennis Felsing b4d16e3f60 Always clear stars, also when entering dummy (fixes #4554)
otherwise they get stuck. Thanks to Skeith reproduction steps:

> Basically, to consistently reproduce the bug, you put your tee in
> freeze, then you connect your dummy right as the stars appear when
> frozen. It also happens with the stars that pop out when you shoot your
> pistol @deen
2022-01-08 00:53:22 +01:00
bors[bot] 571f981394
Merge #4566
4566: Don't crash when no ids are left (fixes #4565) 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 23:53:35 +00:00
def d02253da00 Don't crash when no ids are left (fixes #4565) 2022-01-05 23:30:30 +01:00
def 23fdce1aa8 Reduce default ambient volume to 30 (fixes #4567) 2022-01-05 23:27:31 +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
fokkonaut 8300753fa4 Support 128 players in serverbrowser 2022-01-02 13:41:59 +01:00
def 7ce5b246ec Revert "Support 32bit color depth, default to it (fixes #4549)"
This reverts commit ee35097385.
2021-12-30 11:06:51 +01:00
def ee35097385 Support 32bit color depth, default to it (fixes #4549) 2021-12-30 01:32:57 +01:00
def d7aded177b Revert "Fine tune MySQL timeouts to fail faster"
This reverts commit 541667d00a.
2021-12-29 10:37:19 +01:00
def 18e9faebdb Revert "Skip read requests during shutdown"
This reverts commit ac0c935aa1.
2021-12-29 10:23:46 +01:00
def 77b10ff4cd Revert "Skip over read queries and write into backup database in FailMode"
This reverts commit 8c8b4e5bb4.

Causes database not to work on official servers
2021-12-29 10:16:39 +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
bors[bot] b195c75d33
Merge #4528 #4535 #4538
4528: Try to fix SDL2 assertion failure (fixes #4434) r=heinrich5991 a=def-

I can't really reproduce it:

Assertion failure at SDL_GetWindowFlags_REAL (/home/deen/isos/ddnet/debian6/root/mac64/SDL2-2.0.16/src/video/SDL_video.c:1905), triggered 1 time:
'window && window->magic == &_this->window_magic'

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


4535: Explicitly disable notch area for fullscreen on macOS (fixes #4533) r=heinrich5991 a=def-

See https://developer.apple.com/documentation/bundleresources/information_property_list/nsprefersdisplaysafeareacompatibilitymode?language=objc

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


4538: Add new icons by Ravie r=heinrich5991 a=def-

<img width="752" alt="Screenshot 2021-12-27 at 23 25 59" src="https://user-images.githubusercontent.com/2335377/147511038-9c073c25-8684-4104-96a5-dc1d7ff3e904.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-27 23:22:48 +00: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
Robert Müller 07a8d21224 fix argument order in test, use constant 2021-12-27 23:41:52 +01:00
Robert Müller 2ffd0ddae2 fix invalid left shift in CVariableInt::Unpack, add tests 2021-12-27 18:00:15 +01: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
def d787a4832b Implement "reset" command
to reset specific config to default value
2021-12-27 01:13:11 +01:00
def 7305885f6e Try to fix SDL2 assertion failure (fixes #4434)
I can't really reproduce it:

Assertion failure at SDL_GetWindowFlags_REAL (/home/deen/isos/ddnet/debian6/root/mac64/SDL2-2.0.16/src/video/SDL_video.c:1905), triggered 1 time:
'window && window->magic == &_this->window_magic'
2021-12-25 18:44:46 +01:00
Zwelf 541667d00a Fine tune MySQL timeouts to fail faster 2021-12-25 10:58:38 +01:00
Zwelf 8c8b4e5bb4 Skip over read queries and write into backup database in FailMode 2021-12-25 10:58:38 +01:00
def 6bb875c660 Don't make score test depend on specific timestamp
Insert current timestamp instead
2021-12-25 01:33: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] 4a21f6fb1d
Merge #4513
4513: Display more relevant version numbers on command line (fixes #4511) r=heinrich5991 a=def-

<img width="1838" alt="Screenshot 2021-12-21 at 23 05 20" src="https://user-images.githubusercontent.com/2335377/147003649-64b27082-8e5e-4966-8a15-3af161bbe573.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 22:11:22 +00:00
def 51c096777e Display more relevant version numbers on command line (fixes #4511) 2021-12-21 23:05:44 +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
Robert Müller 92f53c7a37 reload map when changing sv_sixup 2021-12-21 17:37:04 +01:00
def dd4efe0449 Add cl(|_dummy|_contact)_port for ISPs that throttle specific ports
As reported by Ryu
2021-12-21 12:49:05 +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] 3490876ee9
Merge #4503
4503: Fix joining pw-protected server via Steam (fixes #4502) r=heinrich5991 a=def-

Tested by copying DDNet executable from package into Steam directory and running it via steam://run/412220//ger2.ddnet.tw:8001/ directly and when client is running already. (UI had another server selected)

## 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-21 10:19:34 +00:00
def cd6cfd2607 Fix joining pw-protected server via Steam (fixes #4502) 2021-12-21 10:31:52 +01:00
def 2963c30755 Fix run_on_join being run on normal player again (fixes #4494) 2021-12-20 23:19:43 +01:00
bors[bot] f6baf78e6e
Merge #4489
4489: Don't overwrite player-set refresh rate 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 17:10:49 +00:00
def 1261ba4e03 Don't overwrite player-set refresh rate 2021-12-20 17:53:56 +01:00
def a6a0092996 Actually remove gfx_asyncrender_old 2021-12-20 17:27:01 +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
def 440baa17be Support building universal binaries with discord
For now only x86-64 is supported by discord sdk, arm64 we ship without
discord sdk. So players can choose if they want more performance without
discord integration, or less performance with discord integration.
2021-12-20 16:07:00 +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
heinrich5991 27f18824d6 Fix str_utf8_forward to use the same logic as str_utf8_decode 2021-12-20 02:17:10 +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 594b4e3d24 Add cl_run_on_join to set command to execute when joining a server 2021-12-20 00:43:49 +01:00
def 6feb1a0eee Create connections as unique_ptrs directly
no more leak in test/score.cpp
2021-12-19 23:04:12 +01:00
bors[bot] 79e5703e21
Merge #3638
3638: Revert "Let's not crash the client and server on dbg_assert" r=def- a=heinrich5991

This reverts commit a6e144e.

## 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-12-19 18:45:38 +00:00
def f5d59e8719 Rename CONF_SQL to CONF_MYSQL 2021-12-19 19:40:20 +01:00
def 3a2850b7f7 Add comment for true/false 2021-12-19 19:40:20 +01:00
def aacab812d4 Use at least SQLite version 3.25
Required for Window functions, see https://www.sqlite.org/windowfunctions.html
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
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] 3c354eb2d5
Merge #4468
4468: Alternative fix for cut off names (fixes #4463) r=heinrich5991 a=def-

https://github.com/ddnet/ddnet/pull/4465 might have more side effects

<!-- 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 17:11:41 +00: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
bors[bot] 529c1654da
Merge #4447
4447: Disable gfx_asyncrender_old on macOS (fixes #4435) 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-19 16:44:23 +00:00
bors[bot] eea0a95550
Merge #4204
4204: Lower worst/best case frame time calculations r=heinrich5991 a=Jupeyy

1 second is too much, 1 frame of 60 fps is more than enough, dropping a whole frame when using 60fps as limit is already quite alot

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-12-19 16:23:52 +00: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 ea7e39c2f0 Alternative fix for cut off names (fixes #4463)
https://github.com/ddnet/ddnet/pull/4465 might have more side effects
2021-12-18 10:34:20 +01:00
def b445a8aeaf Fix mouse selection after changing window size (on macOS) 2021-12-18 00:12:23 +01: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] 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
Robert Müller 019f8b665f set m_MapReload instead of polling sv_map, use bool, remove dead code
(cherry picked from commit dc56ab6d93e60f1a4bf26196a76b9e12df65529c)
2021-12-15 03:36:25 +03:00
Alexander Akulich d46e4a14c1 CServer: Port to Config() upstream API 2021-12-15 03:36:25 +03:00
Alexander Akulich 4d346456c5 CServer: Add a const CConfig getter for const Server instance 2021-12-15 03:36:25 +03:00
Alexander Akulich 0b24888f61 CServer: Init m_pConfig variable with the global instance for now
The case is lie. The variable was not initialized.
2021-12-15 03:36:25 +03:00
Alexander Akulich 9d3594205d Console: Add Config() getter as in other classes 2021-12-15 03:36:19 +03:00
Alexander Akulich 145816b046 IServer: Change GetMapName() type to const char *
Partially follow upstream 77daedc814
2021-12-15 03:04:03 +03: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
heinrich5991 4fab7d7500 Remove unused variable m_SupportsMapSha256 2021-12-14 06:49:40 +01:00
def 9496d2697a Disable gfx_asyncrender_old on macOS (fixes #4435) 2021-12-13 19:14:21 +01:00
def ac094b5378 Fix text selection cursor position (fixes #4444)
after moving window to a screen with different dimensions than the
initial one
2021-12-13 19:12:37 +01:00
def 7d8a142768 Disable gfx_asyncrender_old on macOS (fixes #4435) 2021-12-13 12:30:30 +01:00
Alexander Akulich d832800ebc Server: Implement a 'reason' argument for Console Shutdown
(cherry picked from the upstream commit teeworlds / 6899778b348cce800665e3e320f88a6688168a14)
2021-12-08 20:43:59 +03:00
Alexander Akulich cad00f7ce1 Add a config var to toggle colors enablement for the console output 2021-12-08 20:35:03 +03:00
Alexander Akulich fa977bbdce Fix UUID messages unpack on demo playing 2021-12-08 18:50:41 +03:00
Zwelf 3db7fca215 Don't shutdown server when there are outstanding sql queries to be executed 2021-12-08 10:09:39 +01:00
Zwelf ac0c935aa1 Skip read requests during shutdown 2021-12-07 13:50:57 +01:00
Robert Müller f20443b694 fix command line arguments with unicode on windows
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-12-06 19:48:25 +01:00
def da7dfda47e Disable connection reuse in curl (fixes #4342)
Thanks to @godwhoa for report and testing the workaround!
2021-11-28 01:56:08 +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 82ffd1b05b Enable sv_swap, more reasonable default for timeout 2021-11-23 16:58:06 +01:00
bors[bot] 6df701a34a
Merge #4366
4366: Add sql BindInt64 r=def- a=ChillerDragon

Comes in handy for my downstream

Follow up to https://github.com/ddnet/ddnet/pull/4334

Tested with sqlite3

## 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-19 12:40:05 +00:00
ChillerDragon 097f718190 Add sql BindInt64 2021-11-19 12:29:24 +01:00
bors[bot] 5997a387d9
Merge #4358
4358: Disallow dummy option (closes #4305, #4316) r=heinrich5991 a=fokkonaut

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

## Checklist

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


Co-authored-by: fokkonaut <35420825+fokkonaut@users.noreply.github.com>
2021-11-17 20:02:27 +00:00
fokkonaut b3c8eb7d2b Add forgotten allowdummy flag 2021-11-17 21:00:37 +01:00
fokkonaut 3d2df7cfc9 Disallow dummy option (closes #4305, #4316) 2021-11-17 20:35:39 +01:00
def e9ffcc3c50 Fix serverinfo json parser to work with system libjsonparser (fixes #4202)
Debian, Ubuntu, Fedora are using libjsonparser without our own changes,
thus we were doing garbage.
2021-11-17 18:26:16 +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
bors[bot] 0e64a6ccc9
Merge #4330
4330: Try crc for maps if sha256 isn't available (fixes #4327) r=heinrich5991 a=def-

Happens with demos cut from KoG

<!-- 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-15 19:22:46 +00:00
def fef86aa26e Pass demo file when splicing (fixes #4327) 2021-11-15 15:00:31 +01:00
Robert Müller dd3ef1577e fix steam names being cut off inside utf8 codepoints 2021-11-13 16:20:44 +01: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] 9bd3bc8480
Merge #4334
4334: Add GetInt64 r=def- a=ChillerDragon

Comes in handy for my downstream

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-11-08 16:33:25 +00:00
ChillerDragon 9f89a1296a Add GetInt64 2021-11-07 16:55:32 +01:00
bors[bot] 15319a3e50
Merge #4321
4321: Improve performance of `SnapFindItem` for extended item types r=Jupeyy a=heinrich5991

Look up the internal type of the searched-for UUID type once, and then
just do integer comparisons to find the item.

CC #4300

<!-- 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-11-07 02:05:49 +00:00
bors[bot] cc96d90ecb
Merge #4312
4312: Don't access out of bounds in linereader (fixes #4308) r=heinrich5991 a=def-

If someone wants to look more closely, maybe there is a better fix

<!-- 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-07 01:29:53 +00:00
def 030163b1d9 Don't access out of bounds in linereader (fixes #4308) 2021-11-07 01:10:34 +01:00
bors[bot] 66fdc39f9c
Merge #4313
4313: Use uint64_t for network stats (fixes #4309) r=heinrich5991 a=def-

Doesn't overflow so quickly, if it overflows has deterministic behavior
at least.

<!-- 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 00:06:52 +00:00
heinrich5991 b5c09b9c10 Improve performance of SnapFindItem for extended item types
Look up the internal type of the searched-for UUID type once, and then
just do integer comparisons to find the item.

CC #4300
2021-11-07 01:02:20 +01:00
def 724fbffaf0 Use uint64_t for network stats (fixes #4309)
Doesn't overflow so quickly, if it overflows has deterministic behavior
at least.
2021-11-06 23:32:54 +01:00
bors[bot] e1a07e9294
Merge #4300
4300: Don't call uuid lookup, if the expected type isn't an uuid extended type anyway r=heinrich5991 a=Jupeyy



Most performance loss currently comes from the simple fact that lookupuuid is slow.
This addresses the problem by making sure its only called for net messages, that are extended anyway

`@trml` or `@heinrich5991` can you check if that makes sense without breaking something?

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-11-06 18:34:44 +00:00
def ef5e2ecd93 Support unicode filenames on windows with pnglite (fixes #4301) 2021-11-05 18:02:34 +01:00
Jupeyy 8eefc0a656 Don't call uuid lookup, if the expected type isn't an uuid extended type anyway 2021-11-04 20:50:05 +01:00
Jupeyy 9f9427e8e9 Remove upper resolution bound 2021-11-04 16:46:40 +01:00
Jupeyy 6a98fd163b Reset selection, if gui element was changed outside of DoEditBox 2021-11-03 00:46:36 +01:00
def b3984affc4 CVariableInt: Limit to 31 bits to fit into int (fixes #4280) 2021-11-02 23:37:26 +01:00
def bc180060a5 Update events description (fixes #4269) 2021-10-31 23:31:15 +01:00
Jupeyy 5da25cd935 Make some variables atomic, that are read from the main thread 2021-10-28 13:53:26 +02:00
Jupeyy 141ce9e088 Protect various variables for the sound class 2021-10-28 13:53:26 +02:00
Jupeyy 86319303e8 Put buffer under the mutex 2021-10-28 13:53:26 +02:00
Jupeyy 85b0dcdbd5 Fix data race in backend_sdl 2021-10-28 00:52:06 +02:00
bors[bot] a9bdaefde7
Merge #4251
4251: Add inp_translated_keys (fixyes #4241) r=Jupeyy a=def-

fixes #4241

## 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>
2021-10-26 12:50:13 +00:00
Dennis Felsing 4894b51c94 Add inp_translated_keys (fixyes #4241) 2021-10-26 11:40:53 +02:00
Jupeyy a34c094fb2 Remove pure greyscale colors 2021-10-24 01:54:18 +02:00
Jupeyy f909f612f0 Use default color, if print color is white 2021-10-24 01:48:38 +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
Jupeyy a1ef18e059 Revert "Remove the mouse mode changes that aren't needed"
This reverts commit 1a917b0aae.
2021-10-23 13:48:04 +02:00
Jupeyy 5dbc6416d1 Revert "Still clear pending mouse motion"
This reverts commit 2c565a33ab.
2021-10-23 13:47:51 +02:00
murpi c5b1d15452 Update server.cpp 2021-10-20 20:26:44 +02:00
bors[bot] 4601f7500e
Merge #4232
4232: Still clear pending mouse motion r=def- a=Jupeyy

Same as #3932 ... again :/

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test if it works standalone, system.c especially
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] 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-19 21:30:32 +00:00
Jupeyy 2c565a33ab Still clear pending mouse motion 2021-10-19 23:18:44 +02:00
Robert Müller fbda0468c6 fix exception in GetAnnouncementLine with empty list 2021-10-17 22:53:56 +02:00
bors[bot] 37801cbf1d
Merge #4218
4218: Set VERSION_DDNET_SWITCH for upcoming release 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-10-17 17:41:29 +00:00
Jupeyy 1a917b0aae Remove the mouse mode changes that aren't needed 2021-10-16 23:56:40 +02:00
def 206585e885 Fix notify on xmonad
I don't get a notification otherwise, not sure if this is the better
default or we need an option
2021-10-16 19:37:53 +02:00
def 87f29d26ce Set VERSION_DDNET_SWITCH for upcoming release 2021-10-16 18:58:33 +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
Edgar 5539116792
fix style 2021-10-15 12:17:14 +02:00
Edgar 8810531065
remove missused volatile 2021-10-15 12:15:39 +02:00
Jupeyy 3b333ea063 Lower worst/best case frame time calculations 2021-10-08 00:23:24 +02:00
Jupeyy e4cb348db2 Add new mouse state 2021-10-07 16:48:25 +02:00
bors[bot] 73de789e90
Merge #4188
4188: Add option to highlight self in kill messages r=heinrich5991 a=Azorlogh

Motivation: #4186

List of changes:
- Add options clKillMessageHighlightSelf, clKillMessageNormalColor, clKillMessageHighlightColor
- Rework HUD panel in settings

![hud_0](https://user-images.githubusercontent.com/17968319/135732345-b8152c74-f754-4722-9b60-46a1ba7cc9c8.png)

![hud_1](https://user-images.githubusercontent.com/17968319/135732346-814a918b-1828-4860-a3c7-372869b79575.png)

![in_game](https://user-images.githubusercontent.com/17968319/135732347-6e9cf148-29b8-4fc4-8dba-647e049f961a.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
- [x] Written a unit test if it works standalone, system.c especially (not standalone)
- [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: Azorlogh <bott.alix@gmail.com>
2021-10-06 15:27:25 +00:00
bors[bot] 43e69905bc
Merge #4157
4157: invalidate texture when unloading a texture. r=heinrich5991 a=ChillerDragon

Closes https://github.com/teeworlds/teeworlds/issues/1450

(cherry picked from commit 23a1b80f60)

<!-- 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: oy <Tom_Adams@web.de>
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-10-06 15:16:00 +00:00
bors[bot] 121c6d16f6
Merge #3879 #4079
3879: Use SDL_FlashWindow to request user's attention r=heinrich5991 a=Jupeyy

We should soon update to SDL 2.0.16 for our bundled libs, but don't merge before this happened.

This drops the remaining X11 dependency.

We should then also use GLEW with EGL for official builds for easy native wayland support(which i discussed before already)

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


4079: Make teehistorian easier to reproduce r=heinrich5991 a=Zwelf

I've tested it ingame, but still have to make sure, that the ordering of the teehistorian messages are right. I would be really happy if we could land this before changing team joining logic (#4006 or /practice logic, but there isn't a pr for this yet), but I would like to make sure that the change is correct.

## Checklist

- [x] Tested the change ingame
- [ ] Tested in combination with possibly related configuration options
- [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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: Zwelf <zwelf@strct.cc>
2021-10-06 14:52:39 +00:00
bors[bot] 353f265e77
Merge #4197 #4198
4197: Properly export antibot DLL symbols on Windows, this time for real r=Jupeyy a=heinrich5991

0750ae0fbd was missing the function
prototypes that used `ANTIBOTAPI`.

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


4198: Always support resizing, remove gfx_resizable 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: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: def <dennis@felsin9.de>
2021-10-06 14:41:24 +00:00
Jupeyy ce9a962030 Rename VERSION to VERSION.txt 2021-10-06 16:13:36 +02:00
def ca95a135ce Always support resizing, remove gfx_resizable 2021-10-05 19:32:09 +02:00
Azorlogh 40ab93c592 capitalize Color & remove superfluous toggle 2021-10-05 18:48:08 +02:00
bors[bot] 26d54f8c8c
Merge #4171
4171: Add basic selection support for ui ex edit boxes r=def- a=Jupeyy

This changes the hotkey for "exclude" to CTRL + SHIFT + X, because else it collides with Cutting strings out of a selection

This is defs not perfect, it basically ignores keyboard keys that could also alter selection (e.g. shift + right) but i didnt want to break the IME stuff, bcs i don't understand 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: Jupeyy <jupjopjap@gmail.com>
2021-10-04 18:07:09 +00:00
Jupeyy fd68cc3a05 Add basic selection support for ui ex edit boxes 2021-10-04 19:58:25 +02:00
Jupeyy 3c1e0fe663 Use SDL_FlashWindow to request user's attention 2021-10-04 19:21:36 +02:00
def e8bc6fcb47 Add notes for settings only available
with specific compile options or on specific builds

Also applies to https://ddnet.tw/settingscommands/
2021-10-03 12:23:31 +02:00
Azorlogh 96f25d32cb fix default colors 2021-10-02 23:25:36 +02:00
Azorlogh 07b85a286b highlight self in kill messages 2021-10-02 23:15:59 +02:00
heinrich5991 5dae776696 Set the maximum connection trials to 5 per 20s
It was previously 4 per 20s which can cause problems with the default
reconnect delay of 5s when the server is full.
2021-10-02 18:27:26 +02:00
bors[bot] f820702522
Merge #4180
4180: Use constructor consistently for colors r=def- a=Robyt3

This changes all color instantiations to consistently use the constructor instead of an initializer list.

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
2021-09-25 08:15:42 +00:00
Robert Müller 6ee5dd24a5 use constructor consistently for colors 2021-09-25 09:50:11 +02:00
bors[bot] 3b45d8a28f
Merge #4179
4179: Fix text upload call, make invalid calls visible 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>
2021-09-25 07:48:06 +00:00
Jupeyy 451a087bde Fix text upload call, make invalid calls visible 2021-09-25 01:58:28 +02:00
trml 8448f9ef04 Predict switch projectiles and pickups, make blinking effect client-side 2021-09-19 14:14:00 +02:00
Chairn 635485de90 Fixed typo in variable name 2021-09-18 20:41:01 +02:00
bors[bot] 79dbbe2ee2
Merge #4151
4151: Copy ingame console like in ATH r=def- a=BloodWod-513

The idea is taken from the implementation of this in ATH client
<!-- 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: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: BloodWod-513 <dayn_2013@mail.ru>
2021-09-15 21:22:04 +00:00
BloodWod-513 4317c43c6b Console copy string 2021-09-15 19:47:01 +02:00
Jupeyy 08881e8a6f Refactor text renderer 2021-09-15 19:46:58 +02:00
Zwelf e9dec007b2 Address review to make code more consistent 2021-09-15 17:31:35 +02:00
heinrich5991 bebc417e99 Ensure a snap is evaluated before the world is rendered the first time 2021-09-15 16:58:33 +02:00
ChillerDragon de4e1ea644 Merge UnloadTexture with UnloadTextureNew 2021-09-15 13:19:54 +02:00
Zwelf eacd314701 Move team and practice mode recording to the beginning of the tick 2021-09-14 22:33:09 +02:00
Zwelf 81f4263428 Record team practice mode making replay easier 2021-09-14 22:10:43 +02:00
Alexander Akulich 895a0b3451 CServer::ProcessClientPacket(): Adjust the debug message buffer size
We allocated 512 bytes to dump up to 32 data bytes in a hex form.
According to the str_hex() implementation, we need three bytes per the
source data byte (a byte is represented as a two-digit hexadecimal number
with appended space char) plus the null-termination.

We actually could re-use the last space char for the null, but it is not
implemented in str_hex(). Keep this logic as-is.

The stack-allocated buffer size reduced from 512 to 97 bytes.
2021-09-14 20:59:29 +03:00
Alexander Akulich 92abe8d545 Use str_hex() for CServer::ProcessClientPacket() debug output 2021-09-14 20:49:53 +03:00
Jupeyy 7f5ca0ffe1 Small graphic refactoring 2021-09-14 00:21:17 +02:00
bors[bot] 1d9557de20
Merge #3783
3783: Further fixes for Haiku r=def- a=panos

- Haiku is Unix-like, but it still doesn't use libnotify.
- Haiku comes with its own sets of definitions for certain long variables. There's still a problem revolving around the variables, but I removed a duplicate, conflicting definition on the Haiku platform.
- Changed some definition-related logic in detect.h, because the gcc compiler in Haiku (version 8.3.0) complained about duplicate definitions. I chose to use 'unknown' rather than an empty string.

I think that I'm very close.

Co-authored-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
Co-authored-by: def <dennis@felsin9.de>
2021-09-13 19:26:25 +00:00
def b357007897 Fix clang-format 2021-09-13 21:13:39 +02:00
heinrich5991 243c1daa96 Use #include <> instead of #include "" for non-relative includes 2021-09-13 21:04:21 +02:00
bors[bot] 18eabe0038
Merge #4158
4158: Make emoticons smoother r=heinrich5991 a=Jupeyy

It's still not 100% the same as with high bandwidth, but atleast animation wise it should look the same.
The client doesn't predict if an emote actually is triggered, so it still only triggeres them every second tick without high bandwidth.

~Since this changes demo playing quite a bit, it should defs be tested~(not really xd)

fixes #4156

## 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-09-13 15:51:04 +00:00
Jupeyy c06edd9aeb Update server list silently 2021-09-13 16:50:40 +02:00
heinrich5991 91b60e6981 Make emoticons smoother 2021-09-13 16:26:48 +02:00
Panagiotis Vasilopoulos 3b1c074842
Further fixes for Haiku
- Haiku is Unix-like, but it still doesn't use libnotify.
- Haiku comes with its own sets of definitions for certain long variables.
  There's still a problem revolving around the variables, but I removed a
  duplicate, conflicting definition on the Haiku platform.
- Changed some definition-related logic in detect.h, because the gcc compiler
  in Haiku (version 8.3.0) complained about duplicate definitions. I chose to
  use 'unknown' rather than an empty string on one occasion.
- Changed size of m_aLastSoundPlayed[CHAT_NUM] in
  `src/game/client/components/chat.cpp` due to an undocumented/undiscovered bug
  in Haiku.
2021-09-13 15:29:32 +02:00
ChillerDragon d60e330085 Pointer naming convention in UnloadTexture 2021-09-13 14:55:21 +02:00
bors[bot] 2916f1b7d4
Merge #3991
3991: Implement upstream download code style r=heinrich5991 a=ChillerDragon

In https://github.com/teeworlds/teeworlds/pull/2556 teeworlds introduced temporary download files for maps. DDNet already has that but a bit different. Those temporary files are now also deleted on error like it is done in the upstream. The main goal of this pr is to reduce code diff to upstream.

Tested official ddnet maps over http and other maps.

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@student.uni-siegen.de>
Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-09-13 12:00:29 +00:00
ChillerDragon 1e7dea54d6 Merge branch 'master' into pr_rm_incomplete_download 2021-09-13 13:57:09 +02:00
oy 9e17281573 invalidate texture when unloading a texture.
Closes https://github.com/teeworlds/teeworlds/issues/1450

(cherry picked from commit 23a1b80f60)
2021-09-13 13:23:00 +02:00
bors[bot] 1a3eaff5f0
Merge #3851
3851: Record last 10 demos by default r=heinrich5991 a=def-

Opinions? Someone on Discord just had the issue that a gameplay on FNG wasn't recorded. I think keeping the last 10 demos around isn't too expensive disk-wise.

## 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-09-13 11:16:53 +00:00
heinrich5991 deb4917563 Revert "Let's not crash the client and server on dbg_assert"
This reverts commit a6e144ea72.
2021-09-13 12:57:53 +02:00
bors[bot] 89e3d694b9
Merge #4152
4152: Make use of IO_MAX_PATH_LENGTH r=heinrich5991 a=ChillerDragon

Inspired by
0a7d0fee7c

<!-- 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>
2021-09-13 10:31:26 +00:00
ChillerDragon 3eb3dcd48b Make use of IO_MAX_PATH_LENGTH
Inspired by
0a7d0fee7c
2021-09-13 12:14:50 +02:00
ChillerDragon 1c8165adaa Cleaner nulled gfx
Remove not needed method definitions.
Feed the graphics engine with some fake data.

This removes valgrind warnings.

Thanks to @Jupeyy for helping a lot :)
2021-09-09 14:03:59 +02:00
ChillerDragon 5997304080 Add -DHEADLESS_CLIENT option to cmake (nulled gfx)
This allows compiling the client without graphics backend and thus it
can run also in a non graphical enviornment
2021-09-09 13:29:15 +02:00
bors[bot] 845c04fc22
Merge #4143
4143: Fix cl_show_direction wrong maximum r=Jupeyy a=HamidReza585

The maximum for cl_show_direction was supposed to be 2 but it looks like I forgot to change it in #4133  so if someone check show local player's key presses in DDNet settings (or do cl_show_direction 2), it will be reset to 1 next time the client launches.

## 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: HamidReza <57710259+HamidReza585@users.noreply.github.com>
2021-09-04 11:19:52 +00:00
HamidReza 00e2206cc5 Fix cl_show_direction 2 wrong maximum 2021-09-04 15:37:37 +04:30
HamidReza 8dbebab524 Remove cl_show_local_direction and add cl_show_direction 2 2021-08-31 03:04:44 +04:30
HamidReza 8bc5ec9bcc Add cl_show_local_direction
cl_show_local_direction allows you to see your own key presses during the game.
2021-08-30 21:26:23 +04:30
bors[bot] 121173b5d6
Merge #4111
4111: Fix filesystem/IO with unicode filenames on windows r=def- a=Robyt3

It was previously not possible to load a map or really any file with a filename containing unicode, e.g. german umlauts.

Now all filenames are converted from multibyte to widechar on windows, and the correct functions and structs (with the `W` suffix) are used consistently.

Some changes are made to synchronize ddnet's implementation with upstream (once https://github.com/teeworlds/teeworlds/pull/2936 has been merged there):
- The unused and not working `IOFLAG_RANDOM` is removed (on upstream ddnet's `IOFLAG_APPEND` is added instead).
- The `fs_listdir_info` function is renamed to `fs_listdir_fileinfo` and now using the parameter object `CFsFileInfo` that contains the filename, modified date and creation date, making it easier to add more properties in the future. `FS_LISTDIR_INFO_CALLBACK` is renamed to `FS_LISTDIR_CALLBACK_FILEINFO`.

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
2021-08-30 09:02:24 +00:00
BloodWod b9d660dd95 Add colors for dbg_msg console 2021-08-28 04:42:42 +05:00
bors[bot] a8c36540e5
Merge #4117
4117: Make fullscreen changes better (especially under windows) r=def- a=Jupeyy

This bug already existed in our current release, so its not related to some SDL update

## 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-08-24 16:29:55 +00:00
Jupeyy 7234c04c15 Make fullscreen changes better (especially under windows) 2021-08-24 18:23:31 +02:00
bors[bot] 43c3391124
Merge #3967
3967: Add state if no master was found r=Learath2 a=Jupeyy

fixes #3951

by adding a state if no master was found

## 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-08-24 12:31:55 +00:00
Jupeyy bde7e854ac Update GLEW 2021-08-24 14:05:35 +02:00
Jupeyy b216b6744a Add Android build scripts 2021-08-24 12:18:20 +02:00
bors[bot] acb87171a9
Merge #4107
4107: Upgrade resolution list r=def- a=Jupeyy

Quick overview about the changes made
- Add refresh rate to fullscreen modes
- Show current resolution(on window mode for example update the resolution). Current behavior is, that the list index isn't updated -> see picture below
- Save current resolution, even on windowed mode
- Move get videomodes to main thread, like all window API(probably safer)
- Better window states updates, e.g. in maximized state it should remove maximize flag, when resized by the resolution list
  And also update resolution when e.g. changing from fullscreen to windowed.
- No resolution list on desktop fullscreen, as this isn't intended anyway

windowed mode:
![screenshot_2021-08-22_13-30-07](https://user-images.githubusercontent.com/6654924/130354590-b92a2161-3207-498c-818e-34410092d2ed.png)

fullscreen:
![screenshot_2021-08-22_14-18-09](https://user-images.githubusercontent.com/6654924/130354801-821692ac-b1c3-41ad-a7b6-5ca59ceb6caa.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-08-24 07:52:08 +00:00
Robert Müller 4a375242c5 fix fs_listdir and fs_listdir_fileinfo with unicode on windows 2021-08-23 12:49:15 +02:00
Jupeyy c7580b374c Remove Windows XP code 2021-08-23 12:05:01 +02:00
Jupeyy ac56075b1b Upgrade resolution list 2021-08-22 15:00:12 +02:00
bors[bot] da59deea84
Merge #4105
4105: fix console name of GfxDesktopWidth r=def- a=Jupeyy

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

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-08-21 20:31:20 +00:00
Jupeyy 36ad87f70a fix console name of GfxDesktopWidth 2021-08-21 21:38:30 +02:00
Väinö Mäkelä d94f52b447 Fix fullscreen resolution setting on SDL 2.0.16
SDL_SetWindowSize's documentation tells that SDL_SetWindowDisplayMode
should be used to set the sizes of fullscreen windows. SDL commit
72d812852023450b7c3850b8e87b63575df041ee changed SDL_SetWindowSize's
behavior so that it can no longer be used to set the screen resolution
with windows that are created in fullscreen mode.
SDL_SetWindowDisplaymode is used instead when the window is fullscreen.
2021-08-21 21:33:40 +03:00
bors[bot] 42f21c6dd9
Merge #3986
3986: Use consistent case for error messages r=def- a=ChillerDragon

Use the style introduced by `@def-` in
61e47422f6

consistency :)

## 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>
2021-08-21 10:03:10 +00:00
def 9a03b6d01f Fix long maps not showing as finished (fixes #4092)
Only used client-side so no protocol change
2021-08-21 09:30:32 +02:00
bors[bot] 4ad16b0f74
Merge #4098
4098: Remove unused gfx_alphabits config variable and dead code r=def- a=Robyt3

The config variables are unused.

(First commit is also https://github.com/teeworlds/teeworlds/pull/2913)

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
2021-08-20 15:35:02 +00:00
bors[bot] 3de25b7290
Merge #4099
4099: Use minimum instead of std::min r=Learath2 a=Robyt3

This replaces remaining usages of `std::min` with `minimum`. Fixes build for me on Windows with Visual Studio 2015.

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
2021-08-20 15:27:08 +00:00
bors[bot] dba212112d
Merge #4089 #4093 #4094
4089: log git revision hash to stdout/console r=def- a=edg-l

Fixes #3963

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


4093: Make fallback stronger and safer r=def- a=Jupeyy

- Save renderer & version string, so the fallback isn't portable between driver updates or system changes
- Only allow modern GL on modern systems(windows)
- Don't show modern GL in settings, if the driver is on the blocklist(this prevents Intel users from doing it, they can still force it over F1 console)

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


4094: Add prediction for switch tiles r=def- a=trml

Prediction of freeze and other tiles in switch layer (for #3990)

## 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: Edgar Luque <git@edgarluque.com>
Co-authored-by: Edgar <git@edgarluque.com>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
Co-authored-by: trml <trml@users.noreply.github.com>
2021-08-20 15:18:59 +00:00
Robert Müller 1820c72513 use minimum instead of std::min 2021-08-20 17:16:18 +02:00
Robert Müller 769ae98279 remove dead code 2021-08-20 17:09:46 +02:00
Robert Müller fd66957f3a remove unused gfx_alphabits config variable 2021-08-20 16:58:39 +02:00
Robert Müller 8fa7610463 remove obsolete engine/shared/message.h 2021-08-20 16:23:29 +02:00
Jupeyy 55abc3f7bb Make fallback stronger and safer 2021-08-18 12:42:30 +02:00
Jupeyy 915ab512bc Add STATE_NO_MASTER 2021-08-16 18:27:43 +02:00
Jupeyy 6101782290 Make clicking refresh before current load is finished to calculate best master again 2021-08-16 18:27:43 +02:00
bors[bot] 3594d89f85
Merge #4003
4003: Use GL_ARRAY_BUFFER r=Learath2 a=Jupeyy

For older OpenGL contexts

`@Learath2` can you check this?

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-08-16 12:31:30 +00:00
Magnus Auvinen f8153a4f2a removed the operator int() from IGraphics::CTextureHandle and ISound::CSampleHandle in order to catch more bugs
(cherry picked from commit 563f1d0c52)
2021-08-14 21:54:18 +02:00
Zwelf d6912f7ced Record team change in teehistorian 2021-08-14 15:22:13 +02:00
Zwelf aa41b60934 Don't record sv_reserved_slots_pass in teehistorian 2021-08-14 15:22:13 +02:00
Jupeyy ac5d731b91 Use GL_ARRAY_BUFFER 2021-08-08 16:55:19 +02:00
def 7dcca97900 Revert "Fix client use-after-free reported by mmmds"
Seems to cause problems:

> Hussain wrote
> :last update+ beta
> my dummy stuck ( this second time)
> disconnect and connect again useless still stuck
> and disconnect server too
> have to restart the game

This reverts commit ce2f29b5f1.
2021-08-04 16:30:25 +02:00
Robert Müller f974117ce0 download to .%pid%.tmp, rename to .map when done
The commit message is misleading. DDNet already had the pid.tmp behavior.
This just uses more the teeworlds style of doing it.

(cherry picked from commit 0da0cb8044)
2021-08-04 14:09:29 +02:00
Robert Müller 4ba3d206a0 also remove incomplete map when restarting download
(cherry picked from commit b67b55448a)
2021-08-04 11:11:41 +02:00
Robert Müller 2e31cf3258 delete incomplete map file when download is aborted
(cherry picked from commit github.com/teeworlds/teeworlds/commit/494f74902dcb0271235d3a0831ecd4c6db58b7e9)
2021-08-04 11:03:31 +02:00
bors[bot] 4a77882fcc
Merge #3988
3988: improved the debug graphs. r=def- a=ChillerDragon

Closes https://github.com/teeworlds/teeworlds/issues/1058

(cherry picked from commit bf61d41c49)

No hard feelings from my side about the clamp. I am just hunting down em diffs to the upstream. But `@heinrich5991` seemed a bit concerned [back in 2013](https://github.com/teeworlds/teeworlds/issues/1058#issuecomment-12178577)

Old:
![screenshot_2021-08-04_10-12-54](https://user-images.githubusercontent.com/20344300/128148556-e818d45d-a455-4021-89a3-6f61cf187c93.png)


New:
![screenshot_2021-08-04_10-15-08](https://user-images.githubusercontent.com/20344300/128148516-b5a5fc79-2db8-4379-9d20-1a39c4d6285a.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: oy <Tom_Adams@web.de>
2021-08-04 08:29:58 +00:00
oy deea648bcd improved the debug graphs.
Closes https://github.com/teeworlds/teeworlds/issues/1058

(cherry picked from commit bf61d41c49)
2021-08-04 09:58:50 +02:00
ChillerDragon 02abc95c18 Use consistent case for error messages
Use the style introduced by @def- in
61e47422f6
2021-08-03 16:41:04 +02:00
bors[bot] b475d4ffc5
Merge #3987
3987: Fix client use-after-free reported by mmmds r=def- a=ChillerDragon

Fix https://github.com/teeworlds/teeworlds/issues/2645

The `Sv_ReadyToEnter` net message is only valid while we're still
loading stuff, it is used to signal that we can send the `ENTERGAME`
system message. Simply ignoring the server message while we're in the
wrong part of the state machine works.

(cherry picked from commit a97f8a22de)


## 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-08-03 14:40:33 +00:00
heinrich5991 ce2f29b5f1 Fix client use-after-free reported by mmmds
Fix https://github.com/teeworlds/teeworlds/issues/2645

The `Sv_ReadyToEnter` net message is only valid while we're still
loading stuff, it is used to signal that we can send the `ENTERGAME`
system message. Simply ignoring the server message while we're in the
wrong part of the state machine works.

(cherry picked from commit a97f8a22de)
2021-08-03 16:36:15 +02:00
Robert Müller c335d84373 remove unused MenuTick, reuse existing m_LocalStartTime
(cherry picked from commit 009b072c34)
2021-08-03 15:41:00 +02:00
BloodWod 89bd2c6b15 disabling quick editing in the console 2021-07-26 14:27:27 +05:00
fokkonaut 845ce60031
Forgot it here too 2021-07-22 02:15:28 +02:00
fokkonaut 5450808d03
Forgot to add target here 2021-07-22 00:22:12 +02:00
fokkonaut e30db2bf29 Add target clientid to antibot OnHammerHit 2021-07-21 22:28:59 +02:00
Jupeyy 7e55b64556 Remove global CGameClient instance 2021-07-12 12:53:08 +02:00
def 2cb3c575f5 Merge master into pr_use_cpp 2021-07-04 16:09:20 +02:00
bors[bot] f23475665f
Merge #3942
3942: Allow the antibot to get more insight into the network r=Learath2 a=heinrich5991

E.g. allow it to see the messages the server sends.

<!-- 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
- [ ] 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-07-01 14:55:12 +00:00
bors[bot] 5d73c31863
Merge #3932
3932: Reset relative mouse motion on toggle r=def- a=Jupeyy

<!-- 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: Jupeyy <jupjopjap@gmail.com>
2021-07-01 12:20:06 +00:00
def c24060f244 Compare lower case strings respecting utf8 (fixes #3937) 2021-06-28 22:51:14 +02:00
Jupeyy 734ed86bd9 Reset relative mouse motion on toggle 2021-06-25 14:52:26 +02:00
heinrich5991 fe082b9a6a Allow the antibot to get more insight into the network
E.g. allow it to see the messages the server sends.
2021-06-24 20:32:41 +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
Dennis Felsing 0892405ba7 sjon -> json 2021-06-21 14:51:45 +02:00
Jupeyy a43d1698c5 Use time_get_microseconds in ChoseMaster class 2021-06-15 02:18:36 +02:00
bors[bot] ca14d87b13
Merge #3911
3911: Don't set cached pings for servers without info r=def- a=heinrich5991

Fixes #3899.

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

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-06-14 22:29:48 +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
heinrich5991 97b53c4409 Don't set cached pings for servers without info
Fixes #3899.
2021-06-15 00:06:26 +02:00
Jupeyy d873a5d663 Fix str comp parameter in updater 2021-06-14 07:47:54 +02:00
heinrich5991 5a584bd82b Fix help text of cfg var to mention correct filename
I missed this during the `serverlist_urls.cfg` →
`ddnet-serverlist-urls.cfg` rename.
2021-06-12 19:34:18 +02:00
Dennis Felsing e869c29aeb
Merge pull request #3896 from Jupeyy/pr_read_pixel_ignore_alpha
Force alpha values from glReadPixel to 255
2021-06-12 18:51:34 +02:00
Jupeyy f8fc05ec49 Force alpha values from glReadPixel to 255 2021-06-12 16:58:45 +02:00
Dennis Felsing ac584fa648
Merge pull request #3889 from Jupeyy/pr_fix_queuehttps_refresh
Don't refresh, if a job is already running
2021-06-12 11:31:43 +02:00
def c60715e907 Add timeout for serverbrowser http request 2021-06-09 17:40:46 +02:00
Jupeyy 90303692df Don't refresh, if a job is already running 2021-06-09 17:40:46 +02:00
bors[bot] b445862628
Merge #3888
3888: Send server info request for ping with different token r=Jupeyy a=heinrich5991

Thanks to @Jupeyy for figuring out this bug.

Previously, the client would send the request for server info and the
server info ping packet with the same token, making the answer
indistinguishable from each other. Fix this by generating a token that
won't collide.

Fixes #3862.

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

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-06-09 15:36:38 +00:00
heinrich5991 97a8fcca04 Send server info request for ping with different token
Thanks to @Jupeyy for figuring out this bug.

Previously, the client would send the request for server info and the
server info ping packet with the same token, making the answer
indistinguishable from each other. Fix this by generating a token that
won't collide.

Fixes #3862.
2021-06-09 17:29:06 +02:00
Jupeyy fea070a712 Remove unused variables 2021-06-09 05:35:28 +02:00
Jupeyy 9956242b4e Remove cl_load_country_flags 2021-06-08 01:06:07 +02:00
bors[bot] f6e887f7aa
Merge #3881
3881: Use str_length r=def- a=ChillerDragon

Either we should delete str_length or we should use it. Feel free to downvote this pr if u think delete is the way to go.

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2021-06-05 17:17:30 +00:00
ChillerDragon 8a4f4fc6c9 Use str_length 2021-06-05 16:46:01 +02:00
bors[bot] 46f204bda7
Merge #3873
3873: Add japanese compressed font r=def- a=TsFreddie

This is a 57kb hiragana/katakana font sits between deja vu sans and source han sans. GlowSansJCompressed is a fork of Source Han Sans so the style and license are the same: https://github.com/welai/glow-sans/blob/master/docs/README-en.md

Was torn between condensed (thiner) font and compressed (thinnest) font, but I figure since we want to fit them better, might as well make more text fit rather than less:

![image](https://user-images.githubusercontent.com/3797859/120436727-e0053f00-c3b1-11eb-8760-4c5afbb4a6da.png)

The font weight is "book" because glow sans has 9 font weights instead of matching source han sans's 7. so the weight name was shifted.

_Japanese translation will come later._

## 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-04 14:28:24 +00:00
Freddie Wang 66caa896b9 Add japanese condensed font 2021-06-04 21:15:29 +08:00
heinrich5991 26a577b891 Fix crash in serverbrowser initialization
Another missing commit.

Fixes #3875.

CC #3772 #3855
2021-06-03 00:27:00 +02:00
bors[bot] 593ce122e6
Merge #3866
3866: Add Input handling to UI Ex initialization r=def- a=Jupeyy




fixes #3865

- [ ] 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-31 17:07:26 +00:00
Jupeyy 14f448d6d6 Init input handling in UI Ex 2021-05-31 12:27:04 +02:00
ChillerDragon 68962e9b40 Fix a woopsie in snapshot docs
Thanks to @def- and @murpii :)
2021-05-29 11:07:33 +02:00
bors[bot] 7e9b0fcb6b
Merge #3858
3858: Reduce spamminess of http server browser r=heinrich5991 a=def-

As reported by fokkonaut on Discord. Not sure if we lose relevant
information.

Previously:
```
[2021-05-28 12:08:54][http]: http https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:55][http]: task done https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:55][http]: http https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task done https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][serverbrowse_http]: found master, url='https://master2.ddnet.tw/ddnet/15/servers.json' time=2437ms
[2021-05-28 12:08:57][http]: http https://master4.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task failed. libcurl error: Could not resolve host: master4.ddnet.tw
[2021-05-28 12:08:57][http]: http https://master3.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task failed. libcurl error: Could not resolve host: master3.ddnet.tw
[2021-05-28 12:08:57][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=201ms
[2021-05-28 12:08:58][serverbrowse_http]: determined best master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=201ms
[2021-05-28 12:08:58][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
```
Now:
```
[2021-05-28 12:29:58][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:29:59][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:30:00][serverbrowse_http]: found master, url='https://master2.ddnet.tw/ddnet/15/servers.json' time=799ms
[2021-05-28 12:30:00][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=43ms
[2021-05-28 12:30:00][serverbrowse_http]: determined best master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=43ms
```
<!-- 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-05-28 15:13:42 +00:00
def bcdb3e0247 Reduce spamminess of http server browser
As reported by fokkonaut on Discord. Not sure if we lose relevant
information.

Previously:

[2021-05-28 12:08:54][http]: http https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:55][http]: task done https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:55][http]: http https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task done https://master2.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][serverbrowse_http]: found master, url='https://master2.ddnet.tw/ddnet/15/servers.json' time=2437ms
[2021-05-28 12:08:57][http]: http https://master4.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task failed. libcurl error: Could not resolve host: master4.ddnet.tw
[2021-05-28 12:08:57][http]: http https://master3.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task failed. libcurl error: Could not resolve host: master3.ddnet.tw
[2021-05-28 12:08:57][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:57][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=201ms
[2021-05-28 12:08:58][serverbrowse_http]: determined best master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=201ms
[2021-05-28 12:08:58][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:08:58][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json

Now:

[2021-05-28 12:29:58][http]: http https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:29:59][http]: task done https://master1.ddnet.tw/ddnet/15/servers.json
[2021-05-28 12:30:00][serverbrowse_http]: found master, url='https://master2.ddnet.tw/ddnet/15/servers.json' time=799ms
[2021-05-28 12:30:00][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=43ms
[2021-05-28 12:30:00][serverbrowse_http]: determined best master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=43ms
2021-05-28 12:30:27 +02:00
def badaae58e9 [http]: http -> [http]: fetching 2021-05-28 12:11:59 +02:00
heinrich5991 f5e91ba192 Remove unused parts of the new serverinfo 2021-05-27 21:48:10 +02:00
heinrich5991 bfef7c9ba3 Add forgotten commit data from #3772
Change filename `serverlist_urls.cfg` → `ddnet-serverlist-urls.cfg`,
change filename `cache.sqlite3` → `ddnet-cache.sqlite3`, add `const` to
a variable and change pings to just before multiples of 100.

Fixes #3853.
2021-05-27 21:48:04 +02:00
Learath2 7e95911714 Fix alignment for CVoteOptionServer 2021-05-27 19:35:20 +02:00
heinrich5991 039f2c6823 Fix (harmless) array OOB access when no pings were cached
Use `vector.data()` instead of `&vector[0]` to get access to the
underlying array.

Fixes #3850.
2021-05-27 15:53:40 +02:00
def cc81ca973c Record last 10 demos by default 2021-05-27 14:57:50 +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] 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
Jupeyy b607cf0f60 Remove texture quality config 2021-05-21 15:00:14 +02:00
bors[bot] 309cc79899
Merge #3815
3815: Remove "Show only supported" switch from graphics tab r=def- a=ardadem

gfx_display_all_modes can be used instead

## Checklist

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


Co-authored-by: Arda Demir <ddmirarda@gmail.com>
2021-05-21 12:47:22 +00:00
heinrich5991 ad26358853 Fix clang-tidy warnings
Even fix a bug in the process, if `m_pDDNetInfo` is null.
2021-05-14 01:25:59 +02:00
heinrich5991 53e9457965 Save previously determined best serverlist
Also make the whole process more robust against failures, retry finding
the best serverlist if the current one is broken.
2021-05-14 01:01:09 +02:00
heinrich5991 9002c9f9a2 Allow pinging favorites directly, leaking your IP address
This is on by default for favorites added in the LAN tab, otherwise off.
2021-05-14 01:01:09 +02:00
heinrich5991 47c803f3fb Remove server info backward compatibility that is no longer needed
Goes all the way back to 04eddacd65 in
2008, pre 0.5.0.
2021-05-14 01:01:09 +02:00
heinrich5991 bd4e0f7fd8 Try parsing the server list before considering a masterserver 2021-05-14 01:01:08 +02:00
heinrich5991 afe6ab87e2 Also sort HTTP server info by score/name 2021-05-14 01:01:08 +02:00
heinrich5991 ee42faac1f Determine one's own location automatically, but provide override
Automatically determine the approximate location of the client by
including that info in the already fetched https://info2.ddnet.tw/info.
Can be overridden using the the config variable `br_location`.
2021-05-14 01:01:08 +02:00
heinrich5991 9eca91de74 Special case China as its own continent for ping estimation
It has an exceptionally bad connection to the outside due to the Great
Firewall of China:
https://en.wikipedia.org/w/index.php?title=Great_Firewall&oldid=1019589632
2021-05-14 01:01:08 +02:00
heinrich5991 acbaa87835 Use in-band ping for determining latency, if supported
Still fall back to server info requests for pinging.
2021-05-14 01:01:08 +02:00
heinrich5991 5ae0c3f3a0 Fix server capabilities only working after disconnect 2021-05-14 01:01:08 +02:00
heinrich5991 6567743546 Add PINGEX and PONGEX messages that are correlatable
The current NETMSG_PING and NETMSG_PING_REPLY messages suffer from the
fact that you cannot know whether a given NETMSG_PING_REPLY is from your
NETMSG_PING.
2021-05-14 01:01:08 +02:00
heinrich5991 a0df2bdf9c Measure the ping to the current server occasionally
This is done using the serverbrowser extended GETINFO packet. It's done
when the client enters the game and every ten minutes afterwards.
2021-05-14 01:01:08 +02:00
heinrich5991 ed561c3602 Add a command to ping all servers
Name it in a way to make clear what information it leaks to anyone who
wants to listen.
2021-05-14 01:01:07 +02:00
heinrich5991 bce7a4f84e Add serverbrowser ping cache 2021-05-14 01:00:41 +02:00
heinrich5991 355c6fccd3 Add sqlite3 to the client 2021-05-14 01:00:41 +02:00
heinrich5991 4301ffab58 Give tests their own playground IStorage
Also add a function to clean it up after the test.
2021-05-14 01:00:41 +02:00
heinrich5991 436e202cbd Add client-side HTTP server info
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.
2021-05-14 01:00:39 +02:00
heinrich5991 11adc8c1ff Make it possible to run jobs in the current thread 2021-05-13 03:15:18 +02:00
bors[bot] 22ef342ffc
Merge #3825
3825: Add sv_swap r=heinrich5991 a=def-

Because swap is broken and the current way of disabling is horrible.

<!-- 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-11 20:05:47 +00:00
def 6a348c8f60 Add sv_swap
Because swap is broken and the current way of disabling is horrible.
2021-05-11 17:05:17 +02:00
bors[bot] e7787bf58d
Merge #3823
3823: Add hookcollision color changeable r=heinrich5991 a=Jupeyy

![t](https://cdn.discordapp.com/attachments/293493549758939136/841549439742378034/unknown.png)

in HUD

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-05-11 14:39:42 +00:00
Jupeyy f8b15e0412 Add hookcollision color changeable 2021-05-11 14:34:53 +02:00
bors[bot] 5d0e820af4
Merge #3814
3814: Fix x11 notify by Maiski r=def- a=Jupeyy

This works on KDE without problems, he also tested on i3

## 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-07 21:33:46 +00:00
Arda Demir 500670cfba Rename gfx_display_all_modes to gfx_display_all_video_modes 2021-05-07 12:56:50 +03:00
bors[bot] 1d0253aa67
Merge #3811
3811: Add Intel as vendor to the block list on windows r=def- a=Jupeyy

I also added, that the warning doesnt require to be displayed, as it currently won't help anyway to update the driver.

Should set all Intel users to OGL 2.0 default, they can ofc still manually change the setting as they want

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2021-05-07 07:52:57 +00:00
bors[bot] 23b8ad5cc2
Merge #3812
3812: Make init/shutdown when GL processor creation fails safer r=def- a=Jupeyy

Especially with GL 3.3, which has a shutdown command implemented, it should only get called, if it actually created the the backend stuff.

## 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-07 07:43:27 +00:00
Freddie Wang 08ecb91622 detect display changes and clamp the resolution 2021-05-07 12:00:32 +08:00
Jupeyy 99e460deb7 Fix x11 notify by Maiski 2021-05-07 02:07:37 +02:00
Freddie Wang 24ccffb005 calculate canvas size instead of window size 2021-05-06 22:29:49 +08:00
Jupeyy fbbfbf7890 don't initialize opengl stuff, if not required 2021-05-06 13:39:17 +02:00
Freddie Wang 2f008d04d3 dpi-aware resolution list 2021-05-06 18:59:30 +08:00
Jupeyy 9104c19a1a remove dublicate code 2021-05-06 12:48:46 +02:00
def 427c01294a av_init_packet is deprecated, use av_packet_alloc instead 2021-05-06 12:25:12 +02:00
Jupeyy 899c30406d Add Intel as vendor to the block list on windows 2021-05-06 12:23:40 +02:00
bors[bot] 97ab2c6c01
Merge #3798
3798: Add GLES support r=def- a=Jupeyy

I know i *****ed up, that i didnt move the files in a different commit, but when i noticed it was already too late.
Its mostly disabling stuff that GLES doesn't support. Global LOD bias or glOrtho for examlpe.

~***Strong note***:
This will move ALL linux implementation to GLES instead of GL, since GLES is supported by X11 and wayland, we probably want some testing for this.
This also means, that the default for Linux gets GLES 3.0 which is equivalent to OpenGL 3.3, not OpenGL 3.0!!!~

~If you wonder "why":
Gles just works differently to OGL, it knows about all functions that exists, and e.g. doesn't require GLEW at all, but that also means, that GLES does NOT work while we use OGL, because GLEW would kill GLES.~
GLEW in EGL mode works fine with wayland, just requires X11 to use EGL too(SDL_VIDEO_X11_FORCE_EGL)

_Additionally, for GLES only, only 3.0 and 1.0 context are supported._(doesn't matter anymore for linux)

probably fixes:
~not_really_fixes  #3797~
fixes #2885

And would also allow android support, if i ever get these build scripts upto date, or smby is interested into fixing them for me :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
- [ ] 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-06 09:50:26 +00:00
Dennis Felsing 6bd41d5dd2
Support ipv6
Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2021-05-05 17:32:37 +02:00
def 6a6ba69189 Steam: Support connecting to hostname
instead of just ip address, untested
2021-05-05 16:10:30 +02:00