Commit graph

2182 commits

Author SHA1 Message Date
bors[bot] ff085a4545
Merge #4772
4772: Fix dummy connect on some vanilla servers r=def- a=Jupeyy

Fixes #4332, fixes #1698, fixes #4394, fixes #3544

For whatever reason the servers send "dm1.map" as map always (even if its not loaded at all), resulting in trying to disconnect the dummy, because on 
`NETMSG_CON_READY` message the config var `m_ClDummy` gets set, making the process server packet think this is the main connection, which then handles the map load as a map change. (The code generally doesn't look very safe, ez to break with the dummy connection check)

I changed the check to actually check if the connection is not the dummy connection for a few packets now, where i thought it doesnt make sense that the dummy connection (should) ever handle them
## 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
- [x] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-03-02 10:26:01 +00:00
Jupeyy c9094eb76f Fix dummy connect on some vanilla servers 2022-03-02 09:11:37 +01:00
bors[bot] e215aeb232
Merge #4768
4768: Videorecorder on by default (also for github builds) r=Jupeyy a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-03-02 08:02:32 +00:00
Dennis Felsing 42907990ac Fix wrong param name 2022-03-01 23:52:46 +01:00
Dennis Felsing 687f3e6160 Remove some useless conditions around free 2022-03-01 23:19:49 +01:00
Dennis Felsing 3cd7058fe6 Show correct server address when connecting 2022-02-28 19:38:59 +01:00
bors[bot] 03fc4d8f6e
Merge #4758
4758: Fix logging into rcon with dummy r=def- a=heinrich5991

Fixes #4721.

<!-- 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>
2022-02-23 21:28:28 +00:00
heinrich5991 eff9abf769 Fix logging into rcon with dummy
Fixes #4721.
2022-02-23 20:42:08 +01:00
Chairn c0d398df38 CheckImageFormatRGBA --> IsImageFormatRGBA 2022-02-23 00:39:31 +01:00
Chairn 76064bd1c8 Drop non RGBA images 2022-02-22 20:21:34 +01:00
bors[bot] 40380d088f
Merge #4713
4713: Give the condition waits proper conditions r=def- a=Jupeyy

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

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-02-19 12:48:40 +00:00
bors[bot] a5b3bd9fa0
Merge #4733
4733: Fix MinGW warnings (fixes #4731) r=Jupeyy a=def-

`@Jupeyy` `@Robyt3` `@Zwelf` 

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-02-19 08:51:54 +00:00
Dennis Felsing ded32c4334 Fix MinGW warnings (fixes #4731) 2022-02-18 12:54:19 +01:00
Jupeyy 4330ff83cf Add exception handling for Windows 2022-02-18 11:35:06 +01:00
Robert Müller 89f126cf8d Remove obsolete ignore_convention comment 2022-02-16 20:54:11 +01:00
bors[bot] dc52f81e2d
Merge #4715
4715: Initialize m_aErrorString earlier (fixes #4707) r=Jupeyy a=def-

Just a guess that there might stil be garbage in this array
<!-- What is the motivation for the changes of this pull request -->

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-02-15 18:48:32 +00:00
Dennis Felsing 1972a1be9a Initialize m_aErrorString earlier (fixes #4707)
Just a guess that there might stil be garbage in this array
2022-02-15 18:30:20 +01:00
Jupeyy 8cbff50461 Give the condition waits proper conditions 2022-02-15 16:31:29 +01:00
Dennis Felsing 18d9997348 Fix clang-format 2022-02-15 00:32:04 +01:00
Dennis Felsing dbfc62d2c0 Add modernize-deprecated-headers 2022-02-15 00:22:52 +01:00
Dennis Felsing b58470fda4 Add modernize-use-equals-default 2022-02-15 00:17:57 +01:00
Dennis Felsing 2da5d7d289 Add modernize-use-emplace 2022-02-15 00:15:06 +01:00
Dennis Felsing 68e4eb21d5 Add modernize-use-bool-literals 2022-02-15 00:12:52 +01:00
ChillerDrgon 064ba50230 Add secure_random_uninit 2022-02-14 12:06:31 +01:00
Dennis Felsing 1beb3f7b22 Fix backend_sdl.cpp build
src/engine/client/backend_sdl.cpp: In function ‘bool BackendInitGlew(EBackendType, int&, int&, int&)’:
src/engine/client/backend_sdl.cpp:305:20: error: ‘GLEW_VERSION_4_5’ was not declared in this scope; did you mean ‘GLEW_VERSION_1_5’?
  305 |                 if(GLEW_VERSION_4_5)
      |                    ^~~~~~~~~~~~~~~~
      |                    GLEW_VERSION_1_5
2022-02-08 18:35:59 +01:00
Dennis Felsing 720268af6a Fix compilation error in client.cpp
src/engine/client/client.cpp:3861:47: error: ‘INT_MAX’ was not declared in this scope
 3861 |         if(Start < 0 || Length < 0 || Start > INT_MAX - Length)
      |                                               ^~~~~~~
src/engine/client/client.cpp:81:1: note: ‘INT_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
2022-02-08 18:35:55 +01:00
Dennis Felsing bec66a2cb6 Fix backend_opengl.cpp build (fixes #4681) 2022-02-08 18:17:56 +01:00
bors[bot] d7ed57fa3f
Merge #4576 #4670 #4671
4576: HTTP Serverbrowser: Quit faster (fixes #4563) r=heinrich5991 a=def-

```
[2022-01-08 09:57:03][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=54ms
[2022-01-08 09:57:03][client]: disconnecting. reason='unknown'
[2022-01-08 09:57:03][http]: https://master2.ddnet.tw/ddnet/15/servers.json failed. libcurl error: Callback aborted
[2022-01-08 09:57:03][serverbrowse_http]: master chooser aborted
```

Not instantaneous but much faster, depends on how often curl calls the PROGRESSFUNCTION.

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


4670: Lib updates r=heinrich5991 a=def-

curl 7.79.0 -> 7.81.0
freetype 2.11.0 -> 2.11.1
sqlite 3.36.0 -> 3.37.2
ffmpeg 4.4 -> 5.0
websockets 4.2 -> 4.3

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


4671: Update Chinese translations (by cheeser0613) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-02-07 11:01:38 +00:00
Alexander Akulich d7a4c37f11 engine/client: Replace the game hardcoded name with a macro variable 2022-02-06 22:25:34 +03:00
Dennis Felsing b897753ef0 HTTP Serverbrowser: Quit faster (fixes #4563)
[2022-01-08 09:57:03][serverbrowse_http]: found master, url='https://master1.ddnet.tw/ddnet/15/servers.json' time=54ms
[2022-01-08 09:57:03][client]: disconnecting. reason='unknown'
[2022-01-08 09:57:03][http]: https://master2.ddnet.tw/ddnet/15/servers.json failed. libcurl error: Callback aborted
[2022-01-08 09:57:03][serverbrowse_http]: master chooser aborted
2022-02-06 18:39:14 +01:00
Jupeyy 338b6b2238 Add windowed fullscreen ( a special case for Windows ) 2022-02-04 11:14:10 +01:00
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00
Robert Müller d8aefa5bed Add missing default value for CServerCapabilities::m_SyncWeaponInput 2022-01-30 11:47:30 +01:00
Dennis Felsing 1cf377f172 Disallow start_video outside of video player (fixes #4642) 2022-01-28 21:12:31 +01:00
bors[bot] 155a922d47
Merge #4628 #4639
4628: Disable or fix some spammy new clang-tidy 13 warnings r=heinrich5991 a=def-

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

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

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

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

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
```
<!-- What is the motivation for the changes of this pull request -->

## Checklist

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


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

Thanks for Skeith for report

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-01-26 13:17:54 +00:00
heinrich5991 aed195b244 Only record snapshot of the currently active tee
Fixes #4636.
2022-01-26 01:28:20 +01:00
heinrich5991 408ece7645 Fix rcon command receiving
Only use the rcon commands from the main connection
2022-01-24 15:29:17 +01:00
Dennis Felsing c79320ed71 Improve macos performance
by declaring all threads as QoS class interactive
2022-01-23 18:23:09 +01:00
def 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +01:00
def 3f7befdd8b Add some further readability checks, mostly redundancy
/media/ddnet/src/engine/server/databases/sqlite.cpp:232:55: warning: the address of ‘char* sqlite3_expanded_sql(sqlite3_stmt*)’ will never be NULL [-Waddress]
  232 |         if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
2022-01-22 17:22:01 +01:00
def bc78ba57b9 Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
def 7aac8b5386 Add readability-container-size-empty 2022-01-22 13:54:25 +01:00
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +01:00
heinrich5991 d2bf8d6513 Rename Client to Conn (suggestion by deen) 2022-01-21 22:13:35 +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] 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 d54a7993d5 Fix compiler warning with ffmpeg 5.0 2022-01-18 00:30:34 +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] 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
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
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
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
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
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
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
def 594b4e3d24 Add cl_run_on_join to set command to execute when joining a server 2021-12-20 00:43:49 +01:00
bors[bot] 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] 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 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 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
Alexander Akulich fa977bbdce Fix UUID messages unpack on demo playing 2021-12-08 18:50:41 +03: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
fokkonaut 3d2df7cfc9 Disallow dummy option (closes #4305, #4316) 2021-11-17 20:35:39 +01:00
bors[bot] cdfc521132
Merge #4340 #4350
4340: Add functions for packing/unpacking int/unsigned using char arrays r=heinrich5991 a=Robyt3

Add `uint_to_bytes_be` and `bytes_be_to_uint` functions from upstream and use them where applicable to reduce duplicate code.

## Checklist

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


4350: Fix map_extract r=heinrich5991 a=def-

Reported by cheeser0613

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

## Checklist

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


Co-authored-by: Robert Müller <robert.mueller@uni-siegen.de>
Co-authored-by: def <dennis@felsin9.de>
2021-11-15 19:33:45 +00:00
Robert Müller 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] 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] 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
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 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
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
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
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] 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
def ca95a135ce Always support resizing, remove gfx_resizable 2021-10-05 19:32:09 +02: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
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
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
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
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
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] 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] 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
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
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
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
Robert Müller 1820c72513 use minimum instead of std::min 2021-08-20 17:16:18 +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
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
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] 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
Jupeyy a663799188 uint64 -> uint64_t, int64 -> int64_t 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