Commit graph

11838 commits

Author SHA1 Message Date
def 734790a4aa Fix deprecation warning in ffmpeg 5.1 (fixes #5681) 2022-07-31 00:58:15 +02:00
Robert Müller 7f1a7795ee Fix tab and F10 keys working inconsistently in editor
By moving the calls to `KeyPress` from `CEditor::OnUpdate` to `OnRender`.
2022-07-30 13:31:00 +02:00
Dennis Felsing d520fe6177 Fix rotating plasma by Robyt3 (fixes #5666) 2022-07-28 15:42:11 +02:00
bors[bot] 9a3f526cb6
Merge #5614
5614: Fix clang-tidy 14 mingw issues (fixes #5612) r=heinrich5991 a=def-

Strangely I didn't get all of the errors.

## 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2022-07-27 10:45:54 +00:00
Dennis Felsing 9d6ccbe838 Version 16.2.2 2022-07-27 12:22:43 +02:00
def c94de9b764 Further clang-tidy 14 issues (fixes #5612) 2022-07-27 09:07:47 +02:00
def 1944bc7052 Ignore Stack address escape clang-tidy warnings
/media/ddnet/src/engine/server.h:135:3: error: Address of stack memory associated with local variable 'aBuf' is still referred to by the stack variable 'tmp' upon returning to the caller.  This will be a dangling reference [clang-analyzer-core.StackAddressEscape,-warnings-as-errors]
                return SendPackMsgOne(pMsg, Flags, ClientID);
                ^
/media/ddnet/src/game/server/gamecontext.cpp:4084:5: note: Assuming the condition is false
        if(pFilter[0])
           ^~~~~~~~~~
/media/ddnet/src/game/server/gamecontext.cpp:4084:2: note: Taking false branch
        if(pFilter[0])
        ^
/media/ddnet/src/game/server/gamecontext.cpp:4088:2: note: Calling 'CGameContext::SendChatTarget'
        SendChatTarget(ClientID, aBuf);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/game/server/gamecontext.cpp:401:5: note: Assuming field 'm_SvDemoChat' is not equal to 0
        if(g_Config.m_SvDemoChat)
           ^~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/game/server/gamecontext.cpp:401:2: note: Taking true branch
        if(g_Config.m_SvDemoChat)
        ^
/media/ddnet/src/game/server/gamecontext.cpp:402:3: note: Calling 'IServer::SendPackMsg'
                Server()->SendPackMsg(&Msg, MSGFLAG_VITAL | MSGFLAG_NOSEND, -1);
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:71:3: note: Taking true branch
                if(ClientID == -1)
                ^
/media/ddnet/src/engine/server.h:73:19: note: Assuming the condition is true
                        for(int i = 0; i < MaxClients(); i++)
                                       ^~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:73:4: note: Loop condition is true.  Entering loop body
                        for(int i = 0; i < MaxClients(); i++)
                        ^
/media/ddnet/src/engine/server.h:74:8: note: Assuming the condition is true
                                if(ClientIngame(i))
                                   ^~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:74:5: note: Taking true branch
                                if(ClientIngame(i))
                                ^
/media/ddnet/src/engine/server.h:77:15: note: Calling 'IServer::SendPackMsgTranslate'
                                        Result = SendPackMsgTranslate(&tmp, Flags, i);
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:118:6: note: Assuming field 'm_ClientID' is >= 0
                if(pMsg->m_ClientID >= 0 && !Translate(pMsg->m_ClientID, ClientID))
                   ^~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:118:6: note: Left side of '&&' is true
/media/ddnet/src/engine/server.h:118:31: note: Assuming the condition is true
                if(pMsg->m_ClientID >= 0 && !Translate(pMsg->m_ClientID, ClientID))
                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:118:3: note: Taking true branch
                if(pMsg->m_ClientID >= 0 && !Translate(pMsg->m_ClientID, ClientID))
                ^
/media/ddnet/src/engine/server.h:125:6: note: Assuming the condition is false
                if(IsSixup(ClientID))
                   ^~~~~~~~~~~~~~~~~
/media/ddnet/src/engine/server.h:125:3: note: Taking false branch
                if(IsSixup(ClientID))
                ^
/media/ddnet/src/engine/server.h:135:3: note: Address of stack memory associated with local variable 'aBuf' is still referred to by the stack variable 'tmp' upon returning to the caller.  This will be a dangling reference
                return SendPackMsgOne(pMsg, Flags, ClientID);
                ^
2022-07-27 09:07:20 +02:00
def 6fc2296a6e Ignore openssl deprecation warning for now (fixes #5597) 2022-07-27 09:06:57 +02:00
bors[bot] 53e9fd3599
Merge #5627
5627: Fix shift + left click in editor (fixes #5626) 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-07-26 19:11:24 +00:00
bors[bot] e8667b6075
Merge #5658
5658: Fix game freezing up on duplicate snapshot r=def- a=Fireball-Teeworlds

If a duplicate snapshot is received (for the same tick), we add both to the SnapshotStorage and end up with the same snapshot as both Cur and Prev. This results in GameInfraTick returning "inf" and results in "NaN" downstream in a few places, getting the CollLine logic stuck.

Some debug info (tcpdump, gdb, perf): https://gist.github.com/Fireball-Teeworlds/ad0016d2551a2e4d4cb5691023493856

Apparently this doesn't really happen in the wild, unless you have a buggy network stack. In which case it happens frequently enough to pinpoint the issue :D

 (fixes #5657)

## Checklist

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


Co-authored-by: Fireball <fireball.teeworlds@gmail.com>
2022-07-26 13:46:40 +00:00
Fireball 9689301410 Fix game freezing up on duplicate snapshot
If a duplicate snapshot is received (for the same tick), we add both to the SnapshotStorage and end up with the same snapshot as both Cur and Prev. This results in GameInfraTick returning "inf" and results in "NaN" downstream in a few places, getting the CollLine logic stuck.

Apparently this doesn't really happen in the wild, unless you have a buggy network stack. In which case it happens frequently enough to pinpoint the issue :D
2022-07-24 21:57:05 +01:00
Robert Müller 1398936f54 Minor refactoring of CDemoPlayer::DoTick:
- Decrease variable scopes
- Use `bool` instead of `int`
2022-07-24 19:01:45 +02:00
Robert Müller 4c397e479a Refactor CSnapshotBuilder::Finish using TotalSize and OffsetSize 2022-07-24 18:04:48 +02:00
Robert Müller 3863d41623 Validate snapshot size and member variables and demo snapshots
Add `CSnapshot::IsValid` to check if a snapshot unpacked from a snapshot delta or demo is valid:
- ensure number of items and data size are not negative
- ensure that the actual size of the snapshot matches the size derived from its member variables
- ensure item offsets are within the valid range
- ensure item sizes are not negative

Add `CSnapshot::TotalSize` and `CSnapshot::OffsetSize` utility functions.

Minor improvements to related error messages.

Fixes buffer overflow:

```
==47744==ERROR: AddressSanitizer: global-buffer-overflow on address 0x558618e3767f at pc 0x558614b9bdfb bp 0x7ffe58a32cd0 sp 0x7ffe58a32cc0
READ of size 4 at 0x558618e3767f thread T0
    0x558614b9bdfa in CSnapshotItem::Type() const src/engine/shared/snapshot.h:16
    0x558615c3c911 in CSnapshot::GetItemType(int) const src/engine/shared/snapshot.cpp:29
    0x558614aebaba in CClient::UnpackAndValidateSnapshot(CSnapshot*, CSnapshot*) src/engine/client/client.cpp:2264
    0x558614af87cb in CClient::OnDemoPlayerSnapshot(void*, int) src/engine/client/client.cpp:2598
    0x558615b9db1a in CDemoPlayer::DoTick() src/engine/shared/demo.cpp:659
    0x558615babd3f in CDemoPlayer::Update(bool) src/engine/shared/demo.cpp:1007
    0x558614afb08b in CClient::Update() src/engine/client/client.cpp:2686
    0x558614b1d9eb in CClient::Run() src/engine/client/client.cpp:3296
    0x558614b8e64f in main src/engine/client/client.cpp:4761
```

And fixes a buffer overflow that manifests itself as an internal ASan error:

```
=================================================================
==4755==AddressSanitizer CHECK failed: ../../../../src/libsanitizer/asan/asan_descriptions.cc:79 "((0 && "Address is not in memory and not in shadow?")) != (0)" (0x0, 0x0)
    0x7f0bf5f368be in AsanCheckFailed ../../../../src/libsanitizer/asan/asan_rtl.cc:72
    0x7f0bf5f54eee in __sanitizer::CheckFailed(char const*, int, char const*, unsigned long long, unsigned long long) ../../../../src/libsanitizer/sanitizer_common/sanitizer_termination.cc:77
    0x7f0bf5e4cb6f in GetShadowKind ../../../../src/libsanitizer/asan/asan_descriptions.cc:79
    0x7f0bf5e4cb6f in __asan::GetShadowAddressInformation(unsigned long, __asan::ShadowAddressDescription*) ../../../../src/libsanitizer/asan/asan_descriptions.cc:95
    0x7f0bf5e4cb6f in __asan::GetShadowAddressInformation(unsigned long, __asan::ShadowAddressDescription*) ../../../../src/libsanitizer/asan/asan_descriptions.cc:92
    0x7f0bf5e4e386 in __asan::AddressDescription::AddressDescription(unsigned long, unsigned long, bool) ../../../../src/libsanitizer/asan/asan_descriptions.cc:440
    0x7f0bf5e50e94 in __asan::ErrorGeneric::ErrorGeneric(unsigned int, unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long) ../../../../src/libsanitizer/asan/asan_errors.cc:380
    0x7f0bf5f35f4d in __asan::ReportGenericError(unsigned long, unsigned long, unsigned long, unsigned long, bool, unsigned long, unsigned int, bool) ../../../../src/libsanitizer/asan/asan_report.cc:460
    0x7f0bf5e86f5e in __interceptor_memset ../../../../src/libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc:762
    0x558234873f1d in mem_zero src/base/system.cpp:213
    0x55823481fc27 in CSnapshotBuilder::NewItem(int, int, int) src/engine/shared/snapshot.cpp:675
    0x55823481be65 in CSnapshotDelta::UnpackDelta(CSnapshot*, CSnapshot*, void const*, int) src/engine/shared/snapshot.cpp:380
    0x558234776641 in CDemoPlayer::DoTick() src/engine/shared/demo.cpp:631
    0x5582347861a9 in CDemoPlayer::Update(bool) src/engine/shared/demo.cpp:1007
    0x5582336d4c7d in CClient::Update() src/engine/client/client.cpp:2695
    0x5582336f75dd in CClient::Run() src/engine/client/client.cpp:3305
    0x558233768241 in main src/engine/client/client.cpp:4770
```
2022-07-24 18:00:39 +02:00
Robert Müller 1b32e47173 Fix shift with negative exponent in TeamMask
```
src/game/server/teams.cpp:484:35: runtime error: shift exponent -1 is negative
    0x55d065b241c4 in CGameTeams::TeamMask(int, int, int) src/game/server/teams.cpp:484
    0x55d0657f92ed in CCharacter::TickDefered() src/game/server/entities/character.cpp:821
    0x55d065a5d04c in CGameWorld::Tick() src/game/server/gameworld.cpp:283
    0x55d0659327e6 in CGameContext::OnTick() src/game/server/gamecontext.cpp:852
    0x55d0656e6a88 in CServer::Run() src/engine/server/server.cpp:2807
    0x55d0657164f1 in main src/engine/server/server.cpp:3904
```
2022-07-22 16:42:56 +02:00
Jupeyy 88c4b69301 Add an option to remove weak hook & bounce 2022-07-21 17:04:16 +02:00
Robert Müller 95636da6d9 Fix out of bounds access with highlighted messages in server demos
```
src/game/client/components/chat.cpp:795:89: runtime error: index -1 out of bounds for type 'CClientData [64]'
    #0 0x55c133fd047a in CChat::AddLine(int, int, char const*) src/game/client/components/chat.cpp:795
    #1 0x55c133fc80b5 in CChat::OnMessage(int, void*) src/game/client/components/chat.cpp:570
    #2 0x55c134677688 in CGameClient::OnMessage(int, CUnpacker*, int, bool) src/game/client/gameclient.cpp:770
    #3 0x55c133c282d2 in CClient::OnDemoPlayerMessage(void*, int) src/engine/client/client.cpp:2627
    #4 0x55c134ccdcba in CDemoPlayer::DoTick() src/engine/shared/demo.cpp:679
    #5 0x55c134cdac81 in CDemoPlayer::Update(bool) src/engine/shared/demo.cpp:1007
    #6 0x55c133c2a08b in CClient::Update() src/engine/client/client.cpp:2686
    #7 0x55c133c4c9eb in CClient::Run() src/engine/client/client.cpp:3296
    #8 0x55c133cbd64f in main src/engine/client/client.cpp:4761
```
2022-07-21 15:32:11 +02:00
Robert Müller b4eee122dd Fix null pointer access in maplayers when the snapshot has no game info
```
src/game/client/components/maplayers.cpp:98:112: runtime error: member access within null pointer of type 'const struct CNetObj_GameInfo'
    #0 0x55d84eea9e1e in CMapLayers::EnvelopeEval(int, int, ColorRGBA&, void*) src/game/client/components/maplayers.cpp:98
    #1 0x55d84f518082 in CRenderTools::ForceRenderQuads(CQuad*, int, int, void (*)(int, int, ColorRGBA&, void*), void*, float) src/game/client/render_map.cpp:112
    #2 0x55d84f517ac7 in CRenderTools::RenderQuads(CQuad*, int, int, void (*)(int, int, ColorRGBA&, void*), void*) src/game/client/render_map.cpp:98
    #3 0x55d84eee10b0 in CMapLayers::OnRender() src/game/client/components/maplayers.cpp:1839
    #4 0x55d84f34b915 in CGameClient::OnRender() src/game/client/gameclient.cpp:640
    #5 0x55d84e8d44c2 in CClient::Render() src/engine/client/client.cpp:1222
    #6 0x55d84e92d1a0 in CClient::Run() src/engine/client/client.cpp:3370
    #7 0x55d84e99964f in main src/engine/client/client.cpp:4761
```
2022-07-21 15:28:31 +02:00
Jupeyy 2240ad2966 Fix spelling 2022-07-19 18:22:44 +02:00
Robert Müller c6cf0004a9 Fix names of static variables in settings menus 2022-07-18 21:51:46 +02:00
Robert Müller 687fd91414 Rename variable m_aEntries to m_vEntries 2022-07-18 21:43:59 +02:00
bors[bot] a9bc4ae113
Merge #5634
5634: Fix clang tidy accessing data pointer r=def- a=ChillerDragon

ddnet/src/engine/client/favorites.cpp:229:23: error: 'data' should be
used for accessing the data pointer instead of taking the address of the
0-th element [readability-container-data-pointer,-warnings-as-errors]
        int Index = pEntry - &m_aEntries[0];
                             ^~~~~~~~~~~~~~
                             (m_aEntries).data()

<!-- 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-07-18 14:28:43 +00:00
bors[bot] 650800ea1e
Merge #5633
5633: Adapt upstreams CButtonContainer r=def- a=ChillerDragon

Introduce ``CButtonContainer`` which is used for fading text in teeworlds. There is no fading text in ddnet yet.
This change allows introducing such fading buttons but the main motivation for this change is easier copy & pasting code from ddnet to teeworlds code base and vice versa.

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [ ] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [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: ChillerDragon <ChillerDragon@gmail.com>
2022-07-18 14:07:11 +00:00
ChillerDragon 1347860b2c Adapt upstreams CButtonContainer 2022-07-18 10:23:03 +02:00
Robert Müller b594a323a6 Change return type of CNetBase::IsSeqInBackroom from int to bool 2022-07-17 20:51:48 +02:00
Robert Müller 5f7d19d2e0 Use sizeof instead of hardcoded value 2022-07-17 20:51:11 +02:00
Robert Müller 4970a615d8 Remove dead code
The condition `Size < 1` is never true because the previous condition `Size < NET_PACKETHEADERSIZE` (`Size < 3`) already covers it.
2022-07-17 20:34:29 +02:00
ChillerDragon 0d4f38811e Fix clang tidy accessing data pointer
ddnet/src/engine/client/favorites.cpp:229:23: error: 'data' should be
used for accessing the data pointer instead of taking the address of the
0-th element [readability-container-data-pointer,-warnings-as-errors]
        int Index = pEntry - &m_aEntries[0];
                             ^~~~~~~~~~~~~~
                             (m_aEntries).data()
2022-07-16 16:00:38 +02:00
Alexander Akulich 04ff8f13c2 Menu: Fix a typo in loading state text 2022-07-14 23:40:23 +03:00
Alexander Akulich 9e4098f3a5 prediction/entity: Add GetPos() (sync the API with server/entity) 2022-07-14 23:40:23 +03:00
Alexander Akulich 5169369809 prediction/entity: Sync ID getter name with the server/entity 2022-07-14 23:40:23 +03:00
Alexander Akulich 1f264a042d CClient::DemoPlayer_Play: Load map info into m_CurrentServerInfo
This e.g. allows better heuristic in GetGameInfo() (from gameclient.cpp)
2022-07-14 23:38:20 +03:00
Alexander Akulich 6f6337cbf5 CDemoPlayer: Mark GetMapInfo() const 2022-07-14 23:38:20 +03:00
bors[bot] 482f15a711
Merge #5520 #5624
5520: Warn about pnglite-incompatible PNGs on load r=def- a=heinrich5991

This allows a larger range of PNGs to be loaded while still maintaining
backward compatibility with older clients by annoying the user.

This warning can be enabled by the `warn-pnglite-incompatible-images`
key in the https://info2.ddnet.tw/info JSON, if the key is not there or
the JSON hasn't been obtained yet, the warning is disabled. Since the
JSON is cached across restarts, it'll be effective for initially loaded
images from the second start.

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


5624: Move message copy inside `SendPackMsgTranslate` r=def- a=Robyt3

Fix clang warning: Address of stack memory associated with local variable 'aBuf' is still referred to by the stack variable 'tmp' upon returning to the caller.  This will be a dangling reference [clang-analyzer-core.StackAddressEscape]

Mark the input parameters as const pointers and mark the protocol message `Pack` methods as const.

And remove a null check that only serves to hide programmer errors.

## Checklist

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


Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
Co-authored-by: Robert Müller <robytemueller@gmail.com>
2022-07-14 16:38:08 +00:00
heinrich5991 994324b059 Warn about pnglite-incompatible PNGs on load
This allows a larger range of PNGs to be loaded while still maintaining
backward compatibility with older clients by annoying the user.

This warning can be enabled by the `warn-pnglite-incompatible-images`
key in the https://info2.ddnet.tw/info JSON, if the key is not there or
the JSON hasn't been obtained yet, the warning is disabled. Since the
JSON is cached across restarts, it'll be effective for initially loaded
images from the second start.
2022-07-14 18:22:46 +02:00
heinrich5991 4292c9ed77 Convert preprocessor #define to constexpr int 2022-07-14 18:22:46 +02:00
heinrich5991 44eb321d96 Fix name of an std::vector member 2022-07-14 18:22:44 +02:00
bors[bot] 96896ddf5c
Merge #5619
5619: Make UI inputs more secure r=def- a=C0D3D3V

fixes #3560 finally :) what a dream xD

This in addition also fixes an input bug, if you hold a mouse button on an input and then open f1 it no longer presses that button.

## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-07-14 16:17:55 +00:00
bors[bot] dafc3984dd
Merge #5511
5511: Rename cl_show_quads -> cl_showquads r=heinrich5991 a=def-

To reenable quads for everyone who accidentally disabled it or has the
bind to accidentally disable them

<!-- 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-07-13 20:12:45 +00:00
Dennis Felsing de087bd80a Fix shift + left click in editor (fixes #5626) 2022-07-12 20:09:53 +02:00
heinrich5991 7c984df17a Fix UDP connectivity check
The nonsensical index of `m_aNetClients` was introduced during my
rebasing of #5205.

Fixes #5618.
2022-07-11 20:48:28 +02:00
Robert Müller d99ed6d811 Remove null check that potentially hides programming errors 2022-07-11 19:11:32 +02:00
Robert Müller ba1608529e Move message copy inside SendPackMsgTranslate
Fix clang warning: Address of stack memory associated with local variable 'aBuf' is still referred to by the stack variable 'tmp' upon returning to the caller.  This will be a dangling reference [clang-analyzer-core.StackAddressEscape]

Mark the input parameters as const pointers and mark the protocol message `Pack` methods as const.
2022-07-11 19:02:16 +02:00
c0d3d3v 27a4c494e9
Make UI inputs more secure 2022-07-11 18:56:36 +02:00
bors[bot] abc9929d35
Merge #5615
5615: Fix Text Alignments in Popups r=def- a=blueskyGH

Fixed the alignment issues in Popups.

Examples:
Before
 ![screenshot_2022-07-11_02-19-13](https://user-images.githubusercontent.com/108560485/178168210-071fbad9-dc59-4caf-94d9-b5ab0dea3f01.png)
![screenshot_2022-07-11_02-20-25](https://user-images.githubusercontent.com/108560485/178168199-4fabe057-69a5-4699-a8cf-858ac2d81811.png)

After
![screenshot_2022-07-11_02-36-26](https://user-images.githubusercontent.com/108560485/178168906-51f40cdf-3e1f-45e4-84a6-56e6056884f6.png)
![screenshot_2022-07-11_02-36-39](https://user-images.githubusercontent.com/108560485/178168909-f9825083-775d-487a-8704-2921e9b25a89.png)


Its my first PR for actual code. Please indulge me. :) 

We still need to get rid of the "ExtraAlign" variable and only use TextWidth().
But somehow TextWidth() doesn't work properly in this case. 
Hopefully a more experienced collaborator can have a look at these lines:
bbca48aa5b (diff-3aebb8cc835bb888d687b51e9dcfc0cda5326d89fd1c97ff83d85c00b82ed116L1656-R1657)

## 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: blueskyGH <108560485+blueskyGH@users.noreply.github.com>
2022-07-11 16:11:57 +00:00
blueskyGH 381394cfff Fix Text Alignments in Popups 2022-07-11 15:47:48 +02:00
c0d3d3v e3fc71d051
Rename "NoSomething" to "SomethingDisabled" 2022-07-11 13:40:01 +02:00
c0d3d3v ebfc053809
Remove even more redundant variables to avoid inconsistent states. Fix another swap bug. 2022-07-11 13:39:52 +02:00
bors[bot] a3001f3bd1
Merge #5205
5205: Allow multiple addresses per server in the serverbrowser r=def- a=heinrich5991

Support is incomplete for `leak_ip_address_to_all_servers` (will only
ping the first address of each server) and for the `leak_ip` setting
(which will also only ping the first address of each server).

Fixes #5158.

## 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-07-10 23:31:21 +00:00
bors[bot] 9e1b6cd1e9
Merge #5613
5613: Search in $PATH for server executable (fixes #5594) 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 (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: def <dennis@felsin9.de>
2022-07-10 23:08:57 +00:00
def aa788e228c Search in $PATH for server executable (fixes #5594) 2022-07-10 23:59:28 +02:00
Robert Müller a971a16ed5 Fix readability-duplicate-include 2022-07-10 21:57:13 +02:00
Robert Müller ec4175277e Fix readability-container-data-pointer 2022-07-10 21:42:57 +02:00
Robert Müller bf686342df Fix performance-unnecessary-value-param 2022-07-10 21:42:57 +02:00
Robert Müller 99d1fb726c Fix modernize-loop-convert in tests 2022-07-10 21:42:57 +02:00
Robert Müller ad0ca6090a Fix modernize-use-bool-literals 2022-07-10 21:00:40 +02:00
Robert Müller 072b9ebaba Use DrawRoundRectExt instead of DrawRoundRect and remove the latter 2022-07-10 17:19:35 +02:00
Robert Müller cc0f64cc29 Use DrawRect instead of DrawRoundRect in CStatboard
To reduce duplicate code.
2022-07-10 17:19:34 +02:00
Robert Müller 992e5d0d07 Use DrawRect instead of DrawRoundRect in CMotd
To reduce duplicate code.
2022-07-10 17:19:34 +02:00
Robert Müller ab4a4aeb75 Use DrawRect instead of DrawRoundRect in CMenus
To reduce duplicate code.
2022-07-10 17:19:34 +02:00
Robert Müller 0c10b64ee5 Use DrawRect instead of DrawRoundRect in CConsole
To reduce duplicate code.
2022-07-10 17:19:33 +02:00
Robert Müller b571fdf93c Use DrawRect instead of DrawRoundRect/Ext in CScoreboard
To reduce duplicate code.
2022-07-10 17:19:33 +02:00
Robert Müller 76c9d86016 Use DrawRect instead of DrawRoundRect/Ext in CHud
To reduce duplicate code.
2022-07-10 17:19:33 +02:00
Robert Müller e042a22d1e Use DrawRect instead of DrawRoundRect/Ext in CSpectator
To reduce duplicate code.
2022-07-10 17:19:33 +02:00
Robert Müller a0ef36847b Add CRenderTools::DrawRect/4 and make DrawUIRect/4 delegates
So usages of `DrawRoundRect/Ext` can more easily be replaced with `DrawRect/4` and so the basic draw methods can be moved to the engine graphics without depending on the `CUIRect` class.
2022-07-10 17:19:32 +02:00
Robert Müller ebf6ce4d27 More efficient CreateRoundRectQuadContainer with CORNER_NONE
By adding an additional case that only creates a single quad when no corners / rounding are used, like in `DrawRoundRectExt4`.
2022-07-10 17:19:32 +02:00
Robert Müller a9787b15e3 Merge CRenderTools::DrawUIRect4NoRounding into DrawUIRect4
As this is a special case the methods can be merged to reduce the number of public methods.
2022-07-10 17:19:32 +02:00
heinrich5991 8996d152ab Allow multiple connect addresses
This allows the client to connect to servers that have both an IPv4 and
an IPv6 address, even if the client is only connected to one of the two.
The one faster to answer will be picked.

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

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

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

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

## Checklist

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


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

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

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-07-09 09:47:48 +00:00
bors[bot] 5345e55b94
Merge #5545
5545: Format name accordingly r=heinrich5991 a=Chairn

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

## Checklist

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


Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-07-08 23:08:02 +00:00
Dennis Felsing fe5e0298fd Version 16.2.1 2022-07-09 00:06:49 +02:00
c0d3d3v 1dacb3366b
rename ReadCharacterCore back to Read; Do not overwrite predicted
CharacterCore with Snap Data
2022-07-08 21:47:51 +02:00
Jupeyy c6589f3a5e (A bit) safer interface for text containers 2022-07-08 19:19:37 +02:00
Chairn b8840c4571 Replaced magic number with MAX_CHECKPOINTS 2022-07-08 18:01:33 +02:00
Chairn a69dc599a9 Huge variable naming format
Fix pointer and pointer array variable naming

Huge renaming to match our rules

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

Further format static variables

Format almost all pointer names accordingly

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

clang-format

Fix CI fail

Fix misnamed non pointer as pointer and non array as array

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

clang-format

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

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

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

## Checklist

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


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



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

Should probably wait until after 16.2 release with them.

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

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

## Checklist

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


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

Recreates SnapEntities internally

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-07-07 10:41:22 +00:00
bors[bot] 5ab2491c24
Merge #5574
5574: Only MySQL >= 8.0.1 removed my_bool (fixes #5573) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-07-07 10:19:53 +00:00
bors[bot] 9e9024d449
Merge #5585
5585: Only announce birthday once (fixes #5576) r=heinrich5991 a=def-

No matter if you use /timecp or rename

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

## Checklist

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


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

Fixes #5348

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

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

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

This PR adds a workaround for the problems, but this Net message is just designed wrong and should maybe in the future get updated to use ticks instead of rounded floats.
 
This PR allows to trigger Time Checkpoints in arbitrary order.
 
 This PR does not make checkpoints unskippable, because we currently have no way to do this, and we have no effect tile that is not skippable (except probably solid blocks).
 
 
 
 
## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-07-06 15:49:59 +00:00
c0d3d3v e6f1ef90de
send correct time diff on finish
send record when player joins or changes name
minor cleanup
2022-07-06 17:43:20 +02:00
Dennis Felsing ef9299c88d Also make gameclient aware that snapshots have been purged (fixes #5571)
Recreates SnapEntities internally
2022-07-06 15:42:05 +02:00
c0d3d3v ae80287c1b
Update checkpoint diff display to use time format with hours:minutes:centisecs
Add time diff to finish display.
Increase time the finish time display is displayed to 6 sec.
Allow to trigger time checkpoints out of order
2022-07-06 15:14:29 +02:00
c0d3d3v 498c2dbbcf
Renamed some time checkpoint related variables.
Init some of the time checkpoint variables explicitly
2022-07-06 15:13:55 +02:00
Chairn 32318a7c90 Reworked color system
Removed duplicate structs. Replaced 4 floats array with appropriate
struct where applicable
2022-07-06 11:39:51 +02:00
Chairn 27da8391dc Replace 2 floats array with vec2 where it makes sense 2022-07-06 11:39:43 +02:00
Jupeyy b3699fe9bc Remove useless GL 3.3 config 2022-07-05 20:02:19 +02:00
heinrich5991 e026bce50f Fix out of bounds read in checksum stuff 2022-07-05 10:26:05 +02:00
Jupeyy edc79e48cc Fix skindownload by only allowing move assignments 2022-07-04 18:24:34 +02:00
c0d3d3v a961151b32
Show also +0.00 split, and checkpoints close to start (<1sec) 2022-07-03 13:31:54 +02:00
bors[bot] b79bb7e62a
Merge #5547
5547: Minor tweaks to keep ODR across translation units r=def- a=Jupeyy

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

## Checklist

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


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

Same as #4941 

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

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

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

## Checklist

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


Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-06-30 14:36:58 +00:00
bors[bot] 5e0eada302
Merge #5517
5517: Add APPEARANCE Settings page r=def- a=C0D3D3V

This could potentially also be added to 16.2

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

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

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

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

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

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

## Checklist

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


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

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

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

Various refactoring in engine sound.

## Checklist

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


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

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

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

fixes #5455

## Checklist

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


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

So it is clear what the default is

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


## Checklist

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


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

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

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

Impressions: https://youtu.be/E770vGp4KKY

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


fixes #5149
fixes #198
closes #5159

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

## Checklist

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


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

## Checklist

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


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

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

## Checklist

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


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

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

## Checklist

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


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

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

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

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

## Checklist

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


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

- Video recorder off
- small fix in logger.cpp

Tested on Java-17

## Checklist

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


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

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

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

Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-06-24 13:58:00 +00:00
ChillerDragon 0163aa56ac Fix build with -DUPNP=ON 2022-06-24 14:16:29 +02:00
Dennis Felsing 805f6ac431 Fix win32 discord compilation
/home/deen/isos/ddnet/ddnet-source/src/engine/client/discord.cpp: In function ‘EDiscordResult (* GetDiscordCreate())(DiscordVersion, DiscordCreateParams*, IDiscordCore**)’:
/home/deen/isos/ddnet/ddnet-source/src/engine/client/discord.cpp:25:16: error: invalid conversion from ‘EDiscordResult (__attribute__((stdcall)) *)(DiscordVersion, DiscordCreateParams*, IDiscordCore**)’ {aka ‘EDiscordResult (__attribute__((stdcall)) *)(int, DiscordCreateParams*, IDiscordCore**)’} to ‘FDiscordCreate’ {aka ‘EDiscordResult (*)(int, DiscordCreateParams*, IDiscordCore**)’} [-fpermissive]
   25 |         return DiscordCreate;
      |                ^~~~~~~~~~~~~
      |                |
      |                EDiscordResult (__attribute__((stdcall)) *)(DiscordVersion, DiscordCreateParams*, IDiscordCore**) {aka EDiscordResult (__attribute__((stdcall)) *)(int, DiscordCreateParams*, IDiscordCore**)}
2022-06-24 10:06:04 +02:00