Commit graph

11431 commits

Author SHA1 Message Date
Jupeyy d7cdc14819 Don't ever skip any frame 2022-05-27 17:54:58 +02:00
Robert Müller a0a0fa1322 Fix ingame menu buttons when mouse is held and released ingame 2022-05-27 17:45:30 +02:00
Robert Müller 6a72c5c38b Fix clang-analyzer-cplusplus.NewDelete (Use of memory after it is freed) 2022-05-27 16:41:14 +02:00
Robert Müller a2465605df Remove base/tl/range.h 2022-05-27 16:36:40 +02:00
Robert Müller f9d49bd53e Remove base/tl/allocator.h 2022-05-27 16:36:40 +02:00
Robert Müller 47098daa42 Remove base/tl/algorithm.h 2022-05-27 16:36:40 +02:00
Robert Müller ca309d6ef8 Remove base/tl/array.h 2022-05-27 16:36:39 +02:00
Robert Müller 0c69495522 Use std::vector instead of array in editor 2022-05-27 16:36:39 +02:00
Robert Müller 3f8fb732a3 Use std::vector<CKey> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller c6e195a399 Use std::vector<CNameBan> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller 4a023342b7 Use std::vector<CName> instead of array, adjust variable name 2022-05-27 16:31:18 +02:00
Robert Müller ce54a0d075 Use std::vector<CMenuImage> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller 24ad383211 Use std::vector<CSourceQueueEntry> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller d3eb9d6fe7 Use std::vector<std::string> instead of array 2022-05-27 16:31:18 +02:00
Robert Müller 0f097a0490 Use std::vector<char *> instead of array in gamecontext 2022-05-27 12:13:30 +02:00
Robert Müller 80103888ea Use std::vector<char *> instead of array in config_store 2022-05-27 12:13:30 +02:00
Robert Müller b9c52f7e31 Use SetActiveItem(nullptr) instead of SetActiveItem(0) 2022-05-27 11:59:14 +02:00
Robert Müller 2b02bd449b Prevent lock of UI
Co-authored-by: oy <tom_adams@web.de>
2022-05-27 11:53:05 +02:00
bors[bot] 7348bf4d56
Merge #5246
5246: Use std::vector instead of sorted_array, remove base/tl/sorted_array.h r=def- a=heinrich5991

This replaces all usages of `sorted_array` with `std::vector`. This requires the following general changes:

- `add_unsorted` is replaced with `push_back`.
- `add` is replaced with `push_back` and subsequent `sort` or `stable_sort` must be ensured.
  - In some cases, immediately sorting the entire list after adding an item was unavoidable. Previously items were added at the correct position, which was O(N) because all items after the inserted one had to be moved in any case.
- `sort_range` is replaced with `sort` or `stable_sort`.
- `size` returns a `size_t` instead of `int`, so to fix sign comparison warnings, casts are added where necessary or types of loop variables are changed to `size_t` where possible. For-each loops are also used where possible / where required by clang-tidy.
- `find_binary` is replaced with `std::equal_range`. This can only find items of the same type, so some wrappers, that only have the relevant fields set, need to be created for searching.

In terms of behavior, this should not change anything, except maybe `CLocalizationDatabase` for the better. As far as I understand it, at lot of the code there was not doing anything. It assumes that binary search can return a range of multiple entries, but the equality/comparison function is based on hash and context hash. This means that any item in this range will match the given hash and context hash already, so all of the following checks are redundant. I changed this to first do a lookup with the hash and context hash and if that fails do another lookup with the default context hash.

I have also already replaced `base/tl/array.h` with `std::vector`, removing all of `base/tl` except `threading.h`. I'll make a separate PR later because this caused a lot more changes especially in the editor that I first want to test and review myself.

Naming of `array`/`sorted_array`/`std::vector` variables was rather inconsistent (sometimes prefix `a` or `l` is used), so ~~I chose to not use any prefix for all new `std::vector`s~~ heinrich5991 left them as-is.

## 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-05-27 08:51:55 +00:00
bors[bot] 61c81fa0f2
Merge #5240
5240: Fix crash when graphics init failed (fixes #5237) r=heinrich5991 a=def-

## 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-05-26 22:17:15 +00:00
Robert Müller de1de5e7bd Use emplace_back for CFriendItem 2022-05-27 00:14:07 +02:00
Robert Müller 476af1286d Use emplace_back for CCommand, fix member variable names 2022-05-27 00:13:26 +02:00
Robert Müller d0b5d096f5 Use emplace_back for CString 2022-05-27 00:03:13 +02:00
Robert Müller bea74f3d4f Remove base/tl/sorted_array.h 2022-05-27 00:03:13 +02:00
Robert Müller a76cdb254e Use std::vector<CDownloadSkin> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller 0859da7e6a Use std::vector<CSkin> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller ae8f5e87c7 Use std::vector<CNameIndexed> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller 5cc76d286f Use std::vector<CGhostItem> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller b24f318450 Use std::vector<CFriendItem> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller de23bf912d Use std::vector<CString> instead of sorted_array, improve string search 2022-05-27 00:03:13 +02:00
Robert Müller 359093cab8 Use std::vector<CDemoItem> instead of sorted_array 2022-05-27 00:03:13 +02:00
Robert Müller 96c97d5bb7 Use std::vector for assets menu list items instead of sorted_array 2022-05-26 23:49:30 +02:00
Robert Müller 2ea0c49f8b Use std::vector<CCommand> instead of sorted_array 2022-05-26 23:49:30 +02:00
Robert Müller 662cb58132 Use std::vector<CFilelistItem> instead of sorted_array 2022-05-26 23:49:30 +02:00
Robert Müller 0032f6f2c2 Use std::vector<CCountryFlag> instead of sorted_array 2022-05-26 23:49:27 +02:00
Robert Müller 295c395c8c Use std::vector<CUISkin> instead of sorted_array 2022-05-26 23:47:37 +02:00
Robert Müller 97dd8105fd Use std::vector<CLanguage> instead of sorted_array 2022-05-26 23:42:06 +02:00
Robert Müller 9dece943e7 Use std::vector<CMapNameItem> instead of sorted_array 2022-05-26 23:42:06 +02:00
Robert Müller 9b2f0fe3c4 Remove unused includes of base/tl/array.h and sorted_array.h 2022-05-26 23:42:06 +02:00
bors[bot] 0648f22d7a
Merge #5236
5236: Don't enable colors when stdout is redirected to a file (fixes #5233) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: Dennis Felsing <dennis@felsin9.de>
2022-05-26 21:24:38 +00:00
bors[bot] e63b8e2bb5
Merge #5183
5183: render allways the nameplate of a specchar (or the real player) r=def- a=C0D3D3V

fokkonaut uses spec chars in addition to normal players in his mod, so the names should also be displayed in addition to the player name

## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-05-26 21:06:19 +00:00
bors[bot] 74b94b3e71
Merge #5245
5245: disable dragger beams soon, not only every 150ms r=def- a=C0D3D3V

The check whether a dragger is active, I somehow forgot in the dragger beams. Sorry! Actually, I should have noticed this during testing. But when I tested Fall into the Future today, it seemed strange to me (already at the first part). I should have noticed it when I tested it. I have compared that in any case with 15.9.1 and looked at the code again and saw that there the check is made every tick.


## 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-05-26 20:47:48 +00:00
c0d3d3v 62c99515d5
disable dragger beams soon, not only every 150ms 2022-05-26 19:49:51 +02:00
trml 2402edcb8a Remove predicted character from gameworld before calling base class destructor 2022-05-26 19:08:46 +02:00
Dennis Felsing ac2657bfce Fix crash when graphics init failed (fixes #5237) 2022-05-26 13:04:39 +02:00
Dennis Felsing d2e9a78483 Don't enable colors when stdout is redirected to a file (fixes #5233) 2022-05-26 12:32:24 +02:00
bors[bot] 3b81157013
Merge #5231
5231: Fix windows crash r=def- a=C0D3D3V

Fixes #5226

I tested it in a Windows VM.
`@sjrc6` is it correct that `TempCore` is this way zero initialized, can you check that maybe in the debugger? I do not want to change the behaviour, even tho the core is read in two lines later with `TempCore.ReadCharacter(pCharacter);`

## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-05-26 08:57:22 +00:00
c0d3d3v 62cad6ba51
use value initialization in Evolve lambda 2022-05-26 08:26:27 +02:00
c0d3d3v cf03ada052
revert to SetHookedPlayer in ReadCharacterCore 2022-05-26 07:45:34 +02:00
Dennis Felsing 68bcd21eff asan+ubsan clean 2022-05-26 01:22:14 +02:00
Dennis Felsing 604142da3a Try other fix for tautological 2022-05-26 00:37:33 +02:00
Dennis Felsing 3a231b07e1 Fix new Obj-C deprecation warnings
src/macos/server.mm:74:29: warning: 'NSOKButton' is deprecated: first deprecated in macOS 10.10 [-Wdeprecated-declarations]
                        if([openDlg runModal] != NSOKButton)
                                                 ^~~~~~~~~~
                                                 NSModalResponseOK
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSPanel.h:51:5: note: 'NSOKButton' has been explicitly marked deprecated here
    NSOKButton API_DEPRECATED_WITH_REPLACEMENT("NSModalResponseOK", macos(10.0,10.10)) = NSModalResponseOK,
    ^
src/macos/server.mm:90:14: warning: 'NSTitledWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                styleMask: NSTitledWindowMask
                           ^~~~~~~~~~~~~~~~~~
                           NSWindowStyleMaskTitled
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:885:32: note: 'NSTitledWindowMask' has been explicitly marked deprecated here
static const NSWindowStyleMask NSTitledWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskTitled", macos(10.0,10.12)) = NSWindowStyleMaskTitled;
                               ^
src/macos/server.mm:91:5: warning: 'NSClosableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                | NSClosableWindowMask
                  ^~~~~~~~~~~~~~~~~~~~
                  NSWindowStyleMaskClosable
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:886:32: note: 'NSClosableWindowMask' has been explicitly marked deprecated here
static const NSWindowStyleMask NSClosableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskClosable", macos(10.0,10.12)) = NSWindowStyleMaskClosable;
                               ^
src/macos/server.mm:92:5: warning: 'NSMiniaturizableWindowMask' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations]
                | NSMiniaturizableWindowMask
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
                  NSWindowStyleMaskMiniaturizable
/Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:887:32: note: 'NSMiniaturizableWindowMask' has been explicitly marked deprecated here
static const NSWindowStyleMask NSMiniaturizableWindowMask API_DEPRECATED_WITH_REPLACEMENT("NSWindowStyleMaskMiniaturizable", macos(10.0,10.12)) = NSWindowStyleMaskMiniaturizable;
                               ^
4 warnings generated.
2022-05-26 00:37:33 +02:00
Zwelf 93ece6f090 Only record swap in teehistorian if active 2022-05-25 19:35:37 +02:00
bors[bot] 1ca4220adf
Merge #5222
5222: Fix crash because of hooks on non ddnet server r=def- a=C0D3D3V

Reported by `@Ясно` Понятно 
on non ddnet server, this code gets run to detect strong-weak ids:
6a5673aa04/src/game/client/gameclient.cpp (L2540-L2541)
which causes a crash because this CCharacterCore is not bound to a gameworld 
the check for m_pWorld failed because m_pWorld is fill of random data
ac15943e85/src/game/gamecore.cpp (L625)
So I would also like to initialize it with a nullpointer 

## 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-05-25 15:51:43 +00:00
c0d3d3v a5cf35576d
init m_pWorld with nullptr 2022-05-25 17:42:44 +02:00
c0d3d3v 6a5673aa04
fix crash on non ddnet server if hook is in view 2022-05-25 17:33:59 +02:00
bors[bot] ac15943e85
Merge #5218
5218: do not snap dragger beam, if the target is out of reach r=def- a=C0D3D3V

fixes #5216

## 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-05-25 15:08:27 +00:00
bors[bot] 00c167148d
Merge #5194
5194: Revert Ellipsis (alternative to #5193) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-05-25 14:46:16 +00:00
c0d3d3v 82a0354f97
do not dragger beam snap, if the target is out of reach 2022-05-25 16:43:05 +02:00
Dennis Felsing 049a249944 Crash fix (fixes #5217) 2022-05-25 16:28:00 +02:00
Chairn 0076edf499 Remove useless setting 2022-05-25 00:12:38 +02:00
bors[bot] 03f95108b4
Merge #5063
5063: Reworked Draggers and Turrets AND show always hooks if they are in the field of view  r=def- a=C0D3D3V

Fixes #3622, #4723 #4798 and #5054

Here you can find a comparison video with 16.0.3: https://youtu.be/bYwLB1cEMI8

This now also includes the changes from https://github.com/ddnet/ddnet/pull/4980 
So please also see my monologue here: https://github.com/ddnet/ddnet/pull/4980

Physic that got changed by this PR:
- Solo players are not included in the calculation of the next team players to the dragger/turrets. This does not affect any map.
- Turrets get switched correctly if players are solo
- Plasma bullets fired by turrets on solo player only explode for solo players and the other way around (except if they unsolo)
- Plasma bullets can no longer be intercepted by other teams 
- Turrets can shot now independently at the speed of sv_plasma_per_sec for  every team and every solo player


This should be tested by some more players before it get merged!

This reduces the use of snap id's tested here: https://youtu.be/G3nVtdH0--Q 
from 16000 to 69
test with the new dragger: https://youtu.be/mzNrDHP7HQs
I did not add the terminal of the server because you basically see no change in the used snap ids 
The videos are with cl_predict off

Comparison of the new turrets: https://streamable.com/8us8lk
left old turrets, right the new ones

We should delete ranks on (that where made after 13 Jun 2019):
https://ddnet.tw/maps/Increase-32-Your-32-Speed
https://ddnet.tw/maps/Fall-32-into-32-the-32-Future
https://ddnet.tw/maps/turboSeks

## 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
- [only on 3 maps] 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-05-24 18:26:08 +00:00
bors[bot] c929ef44e9
Merge #5204
5204: Fix pos1 only scrolling up one page in console r=heinrich5991 a=Robyt3

Holding down the pos1 key will still make the console text flash though.

Fixing that would require to first calculate the total number of pages in a separate pass before rendering the current page.

## 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-05-23 18:13:43 +00:00
Robert Müller 0c518baef4 Fix pos1 only scrolling up one page in console 2022-05-23 19:24:56 +02:00
heinrich5991 c93658f929 Make sure we don't accidentally initialize libcurl in a thread 2022-05-23 17:21:27 +02:00
heinrich5991 76ed324b66 Call HttpInit in server
Otherwise `curl_global_init` would be called from the first
`curl_easy_init`, but `curl_global_init` isn't threadsafe.

Fixes #5195.
2022-05-23 17:20:45 +02:00
c0d3d3v bf2d3d59ff
do not render freezebar if you are not freezed 2022-05-23 12:12:46 +02:00
bors[bot] 064dc2c0c5
Merge #5196
5196: Break early out of loop r=heinrich5991 a=ChillerDragon



Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-05-23 07:31:34 +00:00
bors[bot] 847454f3be
Merge #5189
5189: Fix 0 byte malloc in register.cpp (fixes #5187) r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-05-23 07:15:54 +00:00
ChillerDragon e54f0ee97b Break early out of loop 2022-05-23 08:32:00 +02:00
def 76efcc616b Fix 0 byte malloc in register.cpp (fixes #5187) 2022-05-23 00:24:22 +02:00
def 0c8bf5c3aa Revert "Ellipsis at end in scoreboard and hud"
This reverts commit f278399bd1.
2022-05-22 23:04:32 +02:00
def 590eb2c5d1 Revert "Render full text when it still fits"
This reverts commit c4bcf3d628.
2022-05-22 23:01:00 +02:00
c0d3d3v 60a95c6e4e
mark virtual methods in dragger_beam as overwritten 2022-05-22 22:01:07 +02:00
c0d3d3v 5175734432
Iterate over m_AttachedPlayers instead of MAX_CLIENTS 2022-05-22 21:59:52 +02:00
c0d3d3v f07d773492
Add a set of Players that are attached to a Tee 2022-05-22 21:59:51 +02:00
c0d3d3v 71c9a49776
revert to double explotion plasma bullets if the bullet hits obstacle
and player at the same time
2022-05-22 21:59:51 +02:00
c0d3d3v 9180fa70e4
revert change of dragger range 2022-05-22 21:59:50 +02:00
c0d3d3v 8d644d0638
Snap characters also when a hook is attached to them that is in the field of view 2022-05-22 21:59:49 +02:00
c0d3d3v c251b3d37c
fix server options in comments 2022-05-22 21:59:49 +02:00
c0d3d3v 8fc34ae7b9
Add Comments with Specifications to Turrets and Dragger
- Make Plasma Bullets explode only once if they hit a character and a
  obstacle
- Make turrets fire speed independend from teams and solo players
- Make draggers keep dragging the same tee, also if a closer tee exist
2022-05-22 21:59:48 +02:00
c0d3d3v ab37f95bb4
Do not clip players with hook in the field of view 2022-05-22 21:59:48 +02:00
c0d3d3v d64445d983
Rework Turrets
- Make the code look similar to the code of the draggers
- Make correct switching for solo players, as described here: https://github.com/ddnet/ddnet/pull/4980
- Remove NetworkClipping Bug
- Added intentionally the "Feature" to only explode at one tee
- Make plasma bullets only explode for solo tees if they are solo, not
  for the rest of the team
2022-05-22 21:59:47 +02:00
c0d3d3v 917d12e26c
use TeamMask() instead of Teams()->TeamMask(...) in projectile.cpp and laser.cpp 2022-05-22 21:59:47 +02:00
c0d3d3v 459a845373
use TeamMask() instead of Teams()->TeamMask(...) 2022-05-22 21:59:46 +02:00
c0d3d3v b8cbd8120c
Add ProximityRadius of a tee to the dragger range 2022-05-22 21:59:46 +02:00
c0d3d3v b5166f4048
Simplification of NetworkClippedLine 2022-05-22 21:59:45 +02:00
c0d3d3v 0a6902acae
Optimization of the closest_point_on_line function 2022-05-22 21:59:44 +02:00
c0d3d3v 87893ceca7
Move MapScreenToGroup from 3 classes to render.cpp; Rename MapscreenToWorld to MapScreenToWorld 2022-05-22 21:59:43 +02:00
c0d3d3v b751a2e098
Reworked Draggers 2022-05-22 21:59:33 +02:00
bors[bot] 344eeaf8aa
Merge #5192
5192: Add missing nanosecond conversions r=def- a=Jupeyy

fixes #5191

## 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-05-22 18:27:57 +00:00
bors[bot] 85ce4fc0a8
Merge #5185
5185:  Fix pickups moving on their own (fixes #5137) r=C0D3D3V a=def-

Supersedes #5181 

Objects should be initialized fully, otherwise they are super easy to misuse and get weird undefined behavior that happens rarely.

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-05-22 14:32:21 +00:00
Jupeyy 2677949e58 Add missing nanosecond conversions 2022-05-22 16:08:11 +02:00
Jupeyy 1e6df0c7a9 Lower max allowed FSAA on OpenGL 2022-05-22 14:42:21 +02:00
def 3116494f6e Fix some uninitialized variables, found with valgrind 2022-05-22 12:18:49 +02:00
def c4377bb7d9 Always initialize vec2/3/4
Because no tools can detect it uninitialized well, tried Memory
Sanitizer (needs all libs including libc++ compiled with it), valgrind
(only detects in LTO build), compiler warnings. Might be related to
unions.
2022-05-22 12:18:32 +02:00
bors[bot] 1738b0d51b
Merge #5032
5032: Make input handling teehistorian friendly r=def- a=Zwelf

Makes input handling more reproducible during respawn. Still WIP, because I haven't tested this particular patch (only a different one with the same effect).

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [x] Tested in combination with possibly related configuration options
  - [x] swap
  - [x] using timeout protection
  - [x] reconnecting
  - [x] respawning
  - [x] chat keeps movement
  - [x] pause keeps movement
- [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
- [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: Zwelf <zwelf@strct.cc>
2022-05-22 09:57:44 +00:00
Zwelf 4a39c846c3 Fix comments 2022-05-22 10:39:18 +02:00
bors[bot] 38c8b5b019
Merge #5182
5182: Fix chat prediction r=def- a=C0D3D3V

reported by nori 
https://cdn.discordapp.com/attachments/293493549758939136/977531792389177364/recording.mp4

I have somehow made the condition wrong xD although I had written correctly in the PR what it should do.

also i noticed that teeworlds does not allow you to hold the hook while chatting, but we have allowed this since 2014....

## 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-05-21 20:50:20 +00:00
Zwelf bc17b29100 Simplify chat check after rearranging player input 2022-05-21 21:40:11 +02:00
Zwelf 44e94ee75a Keep last input on respawn when chatting or pausing 2022-05-21 21:37:17 +02:00
Zwelf 86f57289c6 Record player switch in teehistorian 2022-05-21 21:37:17 +02:00
Zwelf 416af01e0a Sync chat/pause input with weapon and movement input 2022-05-21 21:37:15 +02:00
Zwelf 38c7a921d5 Already use second input 2022-05-21 21:34:30 +02:00
Zwelf b99d8dc259 Always apply last sent input
Makes teehistorian during spawn more reproduceable.
Currently during respawn the first applied input doesn't get recorded.
Always appliying the last sent input fixes this.
2022-05-21 21:34:30 +02:00
Zwelf 5e4722e8ba Bump teehistorian minor version due to different input handling 2022-05-21 21:34:30 +02:00
c0d3d3v ad06a05d7b
render allways the nameplate of a specchar 2022-05-21 19:22:50 +02:00
c0d3d3v 71669e3427
release hook in mods that do not allow inputs while chatting 2022-05-21 18:52:14 +02:00
c0d3d3v 2cb47583b8
fix condition of BugDDRaceInput, do only reset innputs on non ddnet mods 2022-05-21 18:17:10 +02:00
def c4bcf3d628 Render full text when it still fits 2022-05-21 12:12:00 +02:00
def 38b2a8d592 Add loglevel config (fixes #5178, fixes #5174) 2022-05-21 12:06:54 +02:00
def 2818c6e17c Fix HUD rebase (thanks to bencie for report) 2022-05-21 11:37:46 +02:00
bors[bot] a04079324d
Merge #5173
5173: revert to ground jump at the same tick r=def- a=C0D3D3V

Sorry I did make a mistake in #5172  I tricked myself, the code block I moved back down below the jumping physic (where it original was):
79f377b133/src/game/gamecore.cpp (L216-L221)
did not prevent instant ground jump, i somehow thought wrong and maybe combined it wrong with my new condition.

i tested everything again with 15.9.1 (and 16.0.3) and looked at the old code and noticed that it was allowed to make a ground jump directly in the same tick as you have contact with the ground. Therefore I revert this herewith (by fixing the condition)

xD is really a tricky thing to make changes at the gamecore, and keeping everything as it should be
Sorry!!

## 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-05-20 21:57:26 +00:00
c0d3d3v 82ef97f549
revert to ground jump at the same tick 2022-05-20 23:05:16 +02:00
bors[bot] 79f377b133
Merge #5171
5171: Extract CConsole::TraverseChain, fix toggle with multiple chains r=def- a=Robyt3

Extract `CConsole::TraverseChain` (https://github.com/teeworlds/teeworlds/pull/2933).

Fix `toggle`/`+toggle` commands with commands which are chained multiple times.

## 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-05-20 20:25:09 +00:00
c0d3d3v 9c97995679
Fix Spezial Jumps for players with 0, 1 and -1 Jumps
- Add some more documentation to the code
- reverted early ground jump to keep physics
2022-05-20 21:37:05 +02:00
Robert Müller fade4d2984 Extract CConsole::TraverseChain, fix toggle with multiple chains 2022-05-20 19:41:31 +02:00
bors[bot] e7140caf8b
Merge #5064
5064: Add HTTP masterserver registering and HTTP masterserver r=def- a=heinrich5991

Registering
-----------

The idea is that game servers push their server info to the
masterservers every 15 seconds or when the server info changes, but not
more than once per second.

The game servers do not support the old registering protocol anymore,
the backward compatibility is handled by the masterserver.

The register call is a HTTP POST to a URL like
`https://master1.ddnet.tw/ddnet/15/register` and looks like this:
```http
POST /ddnet/15/register HTTP/1.1
Address: tw-0.6+udp://connecting-address.invalid:8303
Secret: 81fa3955-6f83-4290-818d-31c0906b1118
Challenge-Secret: 81fa3955-6f83-4290-818d-31c0906b1118:tw0.6/ipv6
Info-Serial: 0

{
	"max_clients": 64,
	"max_players": 64,
	"passworded": false,
	"game_type": "TestDDraceNetwork",
	"name": "My DDNet server",
	"map": {
		"name": "dm1",
		"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
		"size": 5805
	},
	"version": "0.6.4, 16.0.3",
	"clients": []
}
```

The `Address` header declares that the server wants to register itself as
a `tw-0.6+udp` server, i.e. a server speaking a Teeworlds-0.6-compatible
protocol.

The free-form `Secret` header is used as a server identity, the server
list will be deduplicated via this secret.

The free-form `Challenge-Secret` is sent back via UDP for a port forward
check.  This might have security implications as the masterserver can be
asked to send a UDP packet containing some user-controlled bytes. This
is somewhat mitigated by the fact that it can only go to an
attacker-controlled IP address.

The `Info-Serial` header is an integer field that should increase each
time the server info (in the body) changes. The masterserver uses that
field to ensure that it doesn't use old server infos.

The body is a free-form JSON object set by the game server. It should
contain certain keys in the correct form to be accepted by clients. The
body is optional if the masterserver already confirmed the reception of
the info with the given `Info-Serial`.

Not shown in this payload is the `Connless-Token` header that is used
for Teeworlds 0.7 style communication.

Also not shown is the `Challenge-Token` that should be included once the
server receives the challenge token via UDP.

The masterserver responds with a `200 OK` with a body like this:

```
{"status":"success"}
```

The `status` field can be `success` if the server was successfully
registered on the masterserver, `need_challenge` if the masterserver
wants the correct `Challenge-Token` header before the register process
is successful, `need_info` if the server sent an empty body but the
masterserver doesn't actually know the server info.

It can also be `error` if the request was malformed, only in this case
an HTTP status code except `200 OK` is sent.

Synchronization
---------------

The masterserver keeps state and outputs JSON files every second.

```json
{
	"servers": [
		{
			"addresses": [
				"tw-0.6+udp://127.0.0.1:8303",
				"tw-0.6+udp://[::1]:8303"
			],
			"info_serial": 0,
			"info": {
				"max_clients": 64,
				"max_players": 64,
				"passworded": false,
				"game_type": "TestDDraceNetwork",
				"name": "My DDNet server",
				"map": {
					"name": "dm1",
					"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
					"size": 5805
				},
				"version": "0.6.4, 16.0.3",
				"clients": []
			}
		}
	]
}
```

`servers.json` (or configured by `--out`) is a server list that is
compatible with DDNet 15.5+ clients. It is a JSON object containing a
single key `servers` with a list of game servers. Each game server is
represented by a JSON object with an `addresses` key containing a list
of all known addresses of the server and an `info` key containing the
free-form server info sent by the game server. The free-form `info` JSON
object re-encoded by the master server and thus canonicalized and
stripped of any whitespace characters outside strings.

```json
{
	"kind": "mastersrv",
	"now": 1816002,
	"secrets": {
		"tw-0.6+udp://127.0.0.1:8303": {
			"ping_time": 1811999,
			"secret": "42d8f991-f2fa-46e5-a9ae-ebcc93846feb"
		},
		"tw-0.6+udp://[::1]:8303": {
			"ping_time": 1811999,
			"secret": "42d8f991-f2fa-46e5-a9ae-ebcc93846feb"
		}
	},
	"servers": {
		"42d8f991-f2fa-46e5-a9ae-ebcc93846feb": {
			"info_serial": 0,
			"info": {
				"max_clients": 64,
				"max_players": 64,
				"passworded": false,
				"game_type": "TestDDraceNetwork",
				"name": "My DDNet server",
				"map": {
					"name": "dm1",
					"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
					"size": 5805
				},
				"version": "0.6.4, 16.0.3",
				"clients": []
			}
		}
	}
}
```

`--write-dump` outputs a JSON file compatible with `--read-dump-dir`,
this can be used to synchronize servers across different masterservers.
`--read-dump-dir` is also used to ingest servers from the backward
compatibility layer that pings each server for their server info using
the old protocol.

The `kind` field describe that this is `mastersrv` output and not from a
`backcompat`. This is used for prioritizing `mastersrv` information over
`backcompat` information.

The `now` field contains an integer describing the current time in
milliseconds relative an unspecified epoch that is fixed for each JSON
file. This is done instead of using the current time as the epoch for
better compression of non-changing data.

`secrets` is a map from each server address and to a JSON object
containing the last ping time (`ping_time`) in milliseconds relative to
the same epoch as before, and the server secret (`secret`) that is used
to unify server infos from different addresses of the same logical
server.

`servers` is a map from the aforementioned `secret`s to the
corresponding `info_serial` and `info`.

```json
[
	"tw-0.6+udp://127.0.0.1:8303",
	"tw-0.6+udp://[::1]:8303"
]
```

`--write-addresses` outputs a JSON file containing all addresses
corresponding to servers that are registered to HTTP masterservers. It
does not contain the servers that are obtained via backward
compatibility measures.

This file can be used by an old-style masterserver to also list
new-style servers without the game servers having to register there.

An implementation of this can be found at
https://github.com/heinrich5991/teeworlds/tree/mastersrv_6_backcompat
for Teeworlds 0.5/0.6 masterservers and at
https://github.com/heinrich5991/teeworlds/tree/mastersrv_7_backcompat
for Teeworlds 0.7 masterservers.

All these JSON files can be sent over the network in an efficient way
using https://github.com/heinrich5991/twmaster-collect. It establishes a
zstd-compressed TCP connection authenticated by a string token that is
sent in plain-text. It watches the specified file and transmits it every
time it changes. Due to the zstd-compression, the data sent over the
network is similar to the size of a diff.

Implementation
--------------

The masterserver implementation was done in Rust.

The current gameserver register implementation doesn't support more than
one masterserver for registering.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-05-20 17:01:20 +00:00
c0d3d3v bd9a04b1d2
fix HUD assets Tab 2022-05-20 17:35:22 +02:00
heinrich5991 ee8896d014 Make mastersrv compile with Rust 1.48.0 2022-05-20 16:29:01 +02:00
heinrich5991 6b65ccb945 Add HTTP masterserver registering and HTTP masterserver
Registering
-----------

The idea is that game servers push their server info to the
masterservers every 15 seconds or when the server info changes, but not
more than once per second.

The game servers do not support the old registering protocol anymore,
the backward compatibility is handled by the masterserver.

The register call is a HTTP POST to a URL like
`https://master1.ddnet.tw/ddnet/15/register` and looks like this:
```json
POST /ddnet/15/register HTTP/1.1
Address: tw-0.6+udp://connecting-address.invalid:8303
Secret: 81fa3955-6f83-4290-818d-31c0906b1118
Challenge-Secret: 81fa3955-6f83-4290-818d-31c0906b1118:tw0.6/ipv6
Info-Serial: 0

{
	"max_clients": 64,
	"max_players": 64,
	"passworded": false,
	"game_type": "TestDDraceNetwork",
	"name": "My DDNet server",
	"map": {
		"name": "dm1",
		"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
		"size": 5805
	},
	"version": "0.6.4, 16.0.3",
	"clients": []
}
```

The `Address` header declares that the server wants to register itself as
a `tw-0.6+udp` server, i.e. a server speaking a Teeworlds-0.6-compatible
protocol.

The free-form `Secret` header is used as a server identity, the server
list will be deduplicated via this secret.

The free-form `Challenge-Secret` is sent back via UDP for a port forward
check.  This might have security implications as the masterserver can be
asked to send a UDP packet containing some user-controlled bytes. This
is somewhat mitigated by the fact that it can only go to an
attacker-controlled IP address.

The `Info-Serial` header is an integer field that should increase each
time the server info (in the body) changes. The masterserver uses that
field to ensure that it doesn't use old server infos.

The body is a free-form JSON object set by the game server. It should
contain certain keys in the correct form to be accepted by clients. The
body is optional if the masterserver already confirmed the reception of
the info with the given `Info-Serial`.

Not shown in this payload is the `Connless-Token` header that is used
for Teeworlds 0.7 style communication.

Also not shown is the `Challenge-Token` that should be included once the
server receives the challenge token via UDP.

The masterserver responds with a `200 OK` with a body like this:

```
{"status":"success"}
```

The `status` field can be `success` if the server was successfully
registered on the masterserver, `need_challenge` if the masterserver
wants the correct `Challenge-Token` header before the register process
is successful, `need_info` if the server sent an empty body but the
masterserver doesn't actually know the server info.

It can also be `error` if the request was malformed, only in this case
an HTTP status code except `200 OK` is sent.

Synchronization
---------------

The masterserver keeps state and outputs JSON files every second.

```json
{
	"servers": [
		{
			"addresses": [
				"tw-0.6+udp://127.0.0.1:8303",
				"tw-0.6+udp://[::1]:8303"
			],
			"info_serial": 0,
			"info": {
				"max_clients": 64,
				"max_players": 64,
				"passworded": false,
				"game_type": "TestDDraceNetwork",
				"name": "My DDNet server",
				"map": {
					"name": "dm1",
					"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
					"size": 5805
				},
				"version": "0.6.4, 16.0.3",
				"clients": []
			}
		}
	]
}
```

`servers.json` (or configured by `--out`) is a server list that is
compatible with DDNet 15.5+ clients. It is a JSON object containing a
single key `servers` with a list of game servers. Each game server is
represented by a JSON object with an `addresses` key containing a list
of all known addresses of the server and an `info` key containing the
free-form server info sent by the game server. The free-form `info` JSON
object re-encoded by the master server and thus canonicalized and
stripped of any whitespace characters outside strings.

```json
{
	"kind": "mastersrv",
	"now": 1816002,
	"secrets": {
		"tw-0.6+udp://127.0.0.1:8303": {
			"ping_time": 1811999,
			"secret": "42d8f991-f2fa-46e5-a9ae-ebcc93846feb"
		},
		"tw-0.6+udp://[::1]:8303": {
			"ping_time": 1811999,
			"secret": "42d8f991-f2fa-46e5-a9ae-ebcc93846feb"
		}
	},
	"servers": {
		"42d8f991-f2fa-46e5-a9ae-ebcc93846feb": {
			"info_serial": 0,
			"info": {
				"max_clients": 64,
				"max_players": 64,
				"passworded": false,
				"game_type": "TestDDraceNetwork",
				"name": "My DDNet server",
				"map": {
					"name": "dm1",
					"sha256": "0b0c481d77519c32fbe85624ef16ec0fa9991aec7367ad538bd280f28d8c26cf",
					"size": 5805
				},
				"version": "0.6.4, 16.0.3",
				"clients": []
			}
		}
	}
}
```

`--write-dump` outputs a JSON file compatible with `--read-dump-dir`,
this can be used to synchronize servers across different masterservers.
`--read-dump-dir` is also used to ingest servers from the backward
compatibility layer that pings each server for their server info using
the old protocol.

The `kind` field describe that this is `mastersrv` output and not from a
`backcompat`. This is used for prioritizing `mastersrv` information over
`backcompat` information.

The `now` field contains an integer describing the current time in
milliseconds relative an unspecified epoch that is fixed for each JSON
file. This is done instead of using the current time as the epoch for
better compression of non-changing data.

`secrets` is a map from each server address and to a JSON object
containing the last ping time (`ping_time`) in milliseconds relative to
the same epoch as before, and the server secret (`secret`) that is used
to unify server infos from different addresses of the same logical
server.

`servers` is a map from the aforementioned `secret`s to the
corresponding `info_serial` and `info`.

```json
[
	"tw-0.6+udp://127.0.0.1:8303",
	"tw-0.6+udp://[::1]:8303"
]
```

`--write-addresses` outputs a JSON file containing all addresses
corresponding to servers that are registered to HTTP masterservers. It
does not contain the servers that are obtained via backward
compatibility measures.

This file can be used by an old-style masterserver to also list
new-style servers without the game servers having to register there.

An implementation of this can be found at
https://github.com/heinrich5991/teeworlds/tree/mastersrv_6_backcompat
for Teeworlds 0.5/0.6 masterservers and at
https://github.com/heinrich5991/teeworlds/tree/mastersrv_7_backcompat
for Teeworlds 0.7 masterservers.

All these JSON files can be sent over the network in an efficient way
using https://github.com/heinrich5991/twmaster-collect. It establishes a
zstd-compressed TCP connection authenticated by a string token that is
sent in plain-text. It watches the specified file and transmits it every
time it changes. Due to the zstd-compression, the data sent over the
network is similar to the size of a diff.

Implementation
--------------

The masterserver implementation was done in Rust.

The current gameserver register implementation doesn't support more than
one masterserver for registering.
2022-05-20 08:58:32 +02:00
bors[bot] 8b31dbb108
Merge #5155
5155: Remove cl_show_console and -c / --console command line options, attach to existing console r=heinrich5991 a=Robyt3

Alternative to #5154. 

Closes #5150.

If you want to open the client with a console window, instead create a new shortcut with the following target:

```
cmd /c "C:\path\to\your\DDNet.exe"
```

You can change the icon of the shortcut to the DDNet icon in the properties of the shortcut file.

## 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-05-20 06:49:41 +00:00
bors[bot] 0fbfcad242
Merge #5153
5153: keep input if chat is closed r=heinrich5991 a=C0D3D3V

fixes #4653

## Checklist

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-05-20 06:32:44 +00:00
Dennis Felsing 7e5049e656 Version 16.1 2022-05-20 01:26:17 +02:00
c0d3d3v f5ff227561
fix inputs on vanilla server if chat is open 2022-05-19 23:18:14 +02:00
Robert Müller d1acb3644d Try attaching to existing console 2022-05-19 21:24:46 +02:00
Robert Müller 2ebaa76194 Remove cl_show_console and -c / --console cmdline options 2022-05-19 21:24:19 +02:00
heinrich5991 96f1fbcc70 Make dbg_curl 1 use the normal logging 2022-05-19 21:06:05 +02:00
heinrich5991 177cdfdde9 Fix memleak of multiply chained console commands 2022-05-19 21:06:05 +02:00
c0d3d3v 789d7d81fc
keep input if chat is closed 2022-05-19 19:50:51 +02:00
Dennis Felsing 4b72f7d95c Minor clang-tidy fix with -DWEBSOCKETS=ON -DUPNP=ON 2022-05-19 18:57:49 +02:00
bors[bot] cd16459e9b
Merge #5147
5147: Use `check_cxx_compiler_flag` instead of `check_c_compiler_flag` r=def- a=heinrich5991

We only have C++ source files left, take advantage of this and check
whether the C++ compiler supports the flags, not the C compiler. GCC for
example warns about `-Wsuggest-override` in C mode, but supports it in
C++ mode.

## 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>
2022-05-19 12:34:27 +00:00
bors[bot] 8ff87f6e6f
Merge #5001
5001: Ellipsis at end in scoreboard and hud r=heinrich5991 a=def-

Looks nicer to have consistent length in HUD, more clear that something is cut off with the ellipsis.
![screenshot_2022-04-18_12-57-22](https://user-images.githubusercontent.com/2335377/163799128-89788d67-cf3e-4215-b716-7ee0a348f1b2.png)
Thoughts on kill message?
## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-05-19 09:18:11 +00:00
heinrich5991 2b7e1c629e Make Objective-C file Objective-C++
This removes the last C file we have, allows us to set C++ options
unilaterally.
2022-05-19 11:16:03 +02:00
Dennis Felsing d1eba47cf8 Add override in mysql code too (fixes #5139) 2022-05-19 10:35:24 +02:00
def f278399bd1 Ellipsis at end in scoreboard and hud 2022-05-18 23:46:11 +02:00
bors[bot] 609987730c
Merge #5075
5075: Switch to nanoseconds r=def- a=Jupeyy

Modern hardware is too fast, updates sometimes take less than a few microseconds.
It's easier in the long run if we use a bigger range to avoid calculation problems.

possibly f i x e s #5051 (needs testing from bencie for the main bug, but fixes what `@sjrc6` found)

Also took the moment to use more chrono so we can at some point switch to a typesafe time.

Hopefully I didnt miss any value ^^

## 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: Dennis Felsing <dennis@felsin9.de>
2022-05-18 16:59:36 +00:00
Dennis Felsing a1fc561434 No more system.h include in client.m 2022-05-18 18:58:31 +02:00
Jupeyy a7bc8781a9 Put assert for text containers after printing all non empty text containers 2022-05-18 18:25:48 +02:00
Jupeyy 3c597aff95 Switch to nanoseconds 2022-05-18 18:05:41 +02:00
bors[bot] 53d77e86b2
Merge #5119
5119: Use STUN to determine UDP connectivity and show diagnostics r=def- a=heinrich5991

These diagnostics are supposed to guide the user to problem resolution.
They're displayed if no packet is received from the server within one
second of connecting.

No message if we don't have STUN servers.

"Trying to determine UDP connectivity..." if no answer has been received
from the STUN server yet and it hasn't timed out yet.

"UDP seems to be filtered." if the STUN request has timed out.

"UDP and TCP IP addresses seem to be different. Try disabling VPN,
proxy or network accelerators." if the STUN request has returned an IP
address different from the one obtained via HTTP from info2.ddnet.tw.

"No answer from server yet." otherwise, if the STUN request has returned
no interesting data, indicating that it's likely the game server's
fault.

## 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: heinrich5991 <heinrich5991@gmail.com>
2022-05-18 07:43:55 +00:00
heinrich5991 4fb050ccb7 Use STUN to determine UDP connectivity and show diagnostics
These diagnostics are supposed to guide the user to problem resolution.
They're displayed if no packet is received from the server within one
second of connecting.

No message if we don't have STUN servers.

"Trying to determine UDP connectivity..." if no answer has been received
from the STUN server yet and it hasn't timed out yet.

"UDP seems to be filtered." if the STUN request has timed out.

"UDP and TCP IP addresses seem to be different. Try disabling VPN,
proxy or network accelerators." if the STUN request has returned an IP
address different from the one obtained via HTTP from info2.ddnet.tw.

"No answer from server yet." otherwise, if the STUN request has returned
no interesting data, indicating that it's likely the game server's
fault.
2022-05-18 09:21:31 +02:00
heinrich5991 ec45a7338a Add bare-bones STUN protocol support
Implemented according to RFC 5389.
2022-05-18 09:20:54 +02:00
heinrich5991 407644deef Change IClient::ServerAddress to give the actual server address
Previously, it'd take the string entered by the user, before applying
its transformations. Add `IClient::ConnectAddressString` for the old
behavior.
2022-05-18 09:20:53 +02:00
heinrich5991 6977bdc782 Make NETADDR forward-declarable 2022-05-18 09:16:08 +02:00
bors[bot] 3d6e683fdd
Merge #5133 #5138
5133: Fix IPO build problems r=heinrich5991 a=def-

`@Kaffeine` 

Windows x86-64 with MinGW worked, previously:
```
-rwxr-xr-x 1 deen deen 755K May 15 11:38 config_retrieve.exe*
-rwxr-xr-x 1 deen deen 756K May 15 11:38 config_store.exe*
-rwxr-xr-x 1 deen deen 2.8M May 15 11:38 DDNet.exe*
-rwxr-xr-x 1 deen deen 2.1M May 15 11:38 DDNet-Server.exe*
-rwxr-xr-x 1 deen deen 761K May 15 11:38 dilate.exe*
-rwxr-xr-x 1 deen deen 763K May 15 11:38 map_convert_07.exe*
-rwxr-xr-x 1 deen deen 756K May 15 11:38 map_diff.exe*
-rwxr-xr-x 1 deen deen 761K May 15 11:38 map_extract.exe*
```
Now:
```
-rwxr-xr-x 1 deen deen 256K May 16 00:26 config_retrieve.exe*
-rwxr-xr-x 1 deen deen 282K May 16 00:26 config_store.exe*
-rwxr-xr-x 1 deen deen 2.8M May 16 00:26 DDNet.exe*
-rwxr-xr-x 1 deen deen 2.0M May 16 00:26 DDNet-Server.exe*
-rwxr-xr-x 1 deen deen 271K May 16 00:26 dilate.exe*
-rwxr-xr-x 1 deen deen 289K May 16 00:26 map_convert_07.exe*
-rwxr-xr-x 1 deen deen 261K May 16 00:26 map_diff.exe*
-rwxr-xr-x 1 deen deen 278K May 16 00:26 map_extract.exe*
```

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


5138: No gold preference (fixes #5136) r=heinrich5991 a=def-

`@Kaffeine` lld is used on some systems, we also have instructions for mold in readme, both are faster than gold.

## 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: Dennis Felsing <dennis@felsin9.de>
2022-05-18 07:12:29 +00:00
bors[bot] bae4324ea1
Merge #5140
5140: Enable clang-tidy's modernize-use-override (fixes #5139) 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>
Co-authored-by: Chairn <chairn.nq@hotmail.fr>
2022-05-18 06:50:23 +00:00
Dennis Felsing 402cccf8f2 Add override in code behind CONF_DISCORD, disable clang-tidy check 2022-05-18 01:19:35 +02:00
Chairn 583d6e6c01 Mark virtual function as override using a script:
while IFS= read -r line; do file=${line%%:*}; lineno=$(echo $line | cut
-d':' -f2); echo "Treating $file line $lineno"; sed -i -e
"${lineno}s/virtual //" -e "${lineno}s/);\$/) override;/" -e
"${lineno}s/)\$/) override/" -e "${lineno}s/const\$/const override/" -e
"${lineno}s/) {/) override {/" -e "${lineno}s/) const {/) const override
{/" -e "${lineno}s/const;$/const override;/" "$file"; done < a
2022-05-17 23:47:32 +02:00
Robert Müller 4036cda4e3 Handle file/pipe stdout and add fallback on Windows 2022-05-17 22:37:43 +02:00
Dennis Felsing 8d5693d483 Enable clang-tidy's modernize-use-override (fixes #5139)
except for destructors
2022-05-17 20:33:29 +02:00
Dennis Felsing 5947755c99 Fix unread variable clang-tidy warning on macOS
src/engine/client/backend_sdl.cpp:580:3: warning: Value stored to 'RetBackendType' is never read [clang-analyzer-deadcode.DeadStores]
                RetBackendType = BACKEND_TYPE_OPENGL_ES;
                ^                ~~~~
2022-05-17 20:31:25 +02:00
bors[bot] 47874fb57f
Merge #5085
5085: New DDRace HUD r=def- a=C0D3D3V

If you want to test this PR, you have to test it on a Server that includes this PR too.

Textures are made by Ravie 

Here a showcase video with most parts shown: https://youtu.be/gPTVj-s3pgc 

Added to the new HUD
- A display of the weapons available to the player
- The weapon the player is carrying is highlighted
- Indicators for the special abilities of the player (Endless Hook, Endless Jumps, Jetpack, Teleport Weapons)
- Indicators for abilities taken away from the player (Deep/Life Freeze, No Hook, No Weapons collision, No Collision)
- Control indicators for dummy controls (dummy hammer, dummy copy) (bottom right)
- Jump indicator (max 10 jumps ar displayed, and greyed out as soon as a jump is used) 
- Ninja status bar that indicates how long a player is capable of using ninja (next to the ninja sword)
- Freeze status bar that indicates the thawing time of a player (below player)
- Movement Information can be displayed in a clean way above the mini score HUD (Position, Speed, Target Angle)
- Indicator if you are in practice mode

The complete HUD also works for players you spectate

I Added a new NetObj since the predicted values are not perfect and would make the display of the information a lot less good: DDNetCharacterDisplayInfo that contains the following information
```
NetIntRange("m_JumpedTotal", -2, 255),
NetTick("m_NinjaActivationTick"),
NetTick("m_FreezeTick"),
NetBool("m_IsInFreeze"),
NetBool("m_IsInPracticeMode"),

NetIntAny("m_TargetX"),  # used for the Movement Information display
NetIntAny("m_TargetY"),
NetIntAny("m_RampValue"),
```
So if someone has an idea what data we could also need in the client for making the display more nice, now is the right moment to add more data to this network object.

A few screenshots:
Assets Tab:
![grafik](https://user-images.githubusercontent.com/14315968/167703792-f0fa86be-159d-4e11-baf4-9539cee38aae.png)
HUD Settings:
![grafik](https://user-images.githubusercontent.com/14315968/167704336-dc7a314e-5603-40a2-98b4-9c03377906dd.png)
Mini Debug HUD:
![grafik](https://user-images.githubusercontent.com/14315968/168302791-c377d93e-33a2-4eb2-9d8d-b78f0808a009.png)
Speed.X is calculated using the players ramp vaule


## 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>
Co-authored-by: Jupeyy <jupjopjap@gmail.com>
2022-05-16 22:23:08 +00:00
c0d3d3v d6833b6fd6
fix jump display 2022-05-16 23:17:19 +02:00
c0d3d3v 796b2add95
Fix Weapon Shields rendering and Clean up Sprite Offsets in items.cpp 2022-05-16 15:31:46 +02:00
def dc03f410ad Disable IPO on mingw win32
/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld: /usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/bin/ld: DWARF error: could not find variable specification at offset 378
/usr/lib/gcc/i686-w64-mingw32/11.2.0/../../../../i686-w64-mingw32/lib/../lib/libstdc++.a(string-inst.o): in function `ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag':
/build/mingw-w64-gcc/src/build-i686-w64-mingw32/i686-w64-mingw32/libstdc++-v3/include/bits/basic_string.tcc:206: multiple definition of `void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag)';
glsl_shader_compiler.cpp.obj (symbol from plugin):(.gnu.linkonce.t._ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag+0x0): first defined here
...
2022-05-16 10:12:43 +02:00
def bbb1b42bb5 Fix -Walloc-size-larger-than= in maplayers.cpp
Fails on Linux x86 with IPO:

In member function '_ZN10CMapLayers17STileLayerVisuals4InitEjj.part.18',
    inlined from 'OnMapLoad' at /ddnet-source-steam/src/game/client/components/maplayers.cpp:301:6:
/ddnet-source-steam/src/game/client/components/maplayers.cpp:312:74: warning: argument 1 value '4294967295'
 exceeds maximum object size 2147483647 [-Walloc-size-larger-than=]
   m_pBorderTop = new CMapLayers::STileLayerVisuals::STileVisual[Width - 2];
                                                                          ^
2022-05-16 00:53:55 +02:00
bors[bot] a041ff8aed
Merge #5069
5069: Some HTTP fixes factored out of the HTTP masterserver PR r=def- a=heinrich5991

CC #5064

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-05-15 22:20:11 +00:00
bors[bot] fadcb344e4
Merge #5132
5132: Refactoring: Use std::swap in editor r=heinrich5991 a=Robyt3

<!-- 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: Robert Müller <robytemueller@gmail.com>
2022-05-15 20:31:11 +00:00
bors[bot] 61cca6ca16
Merge #5131
5131: Remove base/tl/base.h r=heinrich5991 a=Robyt3



## 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 <robytemueller@gmail.com>
2022-05-15 20:11:13 +00:00
Robert Müller f0df8ad85a Use std::swap in editor 2022-05-15 21:00:14 +02:00
Robert Müller aeb8790649 Remove base/tl/base.h 2022-05-15 20:36:16 +02:00
Robert Müller f634f66008 Fix memory leaks in auto stat CSV output, refactoring
And fix stringop-overflow warning:

In function 'str_copy',
    inlined from 'FormatStats' at src\game\client\components\statboard.cpp:541:10:
src\base\system.cpp:2524:16: warning: 'strncat' specified bound depends on the length of the source argument [-Wstringop-overflow=]
 2524 |         strncat(dst, src, dst_size - 1);
      |                ^
src\game\client\components\statboard.cpp: In member function 'FormatStats':
src\base\system.cpp:2557:27: note: length computed here
 2557 |         return (int)strlen(str);
      |                           ^
2022-05-15 20:24:26 +02:00
Robert Müller 53f4001fb1 Fix stringop-overflow warning
In function 'str_copy',
    inlined from 'GetServerInfo' at src\engine\client\client.cpp:951:11,
    inlined from 'GetServerInfo' at src\engine\client\client.cpp:946:6:
src\base\system.cpp:2524:16: warning: 'strncat' specified bound 13 equals source length [-Wstringop-overflow=]
 2524 |         strncat(dst, src, dst_size - 1);
      |                ^
2022-05-15 19:45:14 +02:00
Robert Müller 52100dbbe7 Use qualified std::swap only 2022-05-15 19:25:36 +02:00
Robert Müller 535fbd28fa Replace usages of tl_assert with dbg_assert 2022-05-15 19:25:18 +02:00
bors[bot] f3e8984bfc
Merge #5126
5126: Fix /cmdlist output not being shown in chat r=def- a=ChillerDragon

## Checklist

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


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
2022-05-15 11:40:50 +00:00
ChillerDragon 2693eff72e Show "No such command" and "Invalid arguments" 2022-05-15 13:37:30 +02:00
ChillerDragon 0ff129a19e Fix /cmdlist output not being shown in chat 2022-05-15 13:24:57 +02:00
bors[bot] e346e3e186
Merge #5072
5072: Updated unicode script generation (fixes https://github.com/ddnet/ddnet/issues/5017) r=def- a=Chairn

I also updated the version to 15.0.0. However, confusables are still from version 14 as https://www.unicode.org/Public/security/15.0.0/ is empty.

CC `@heinrich5991` 

## 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-05-15 11:17:15 +00:00
bors[bot] 450e6a53f7
Merge #5125
5125: Fix server loading map twice on startup r=def- a=Zwelf

Fixes creating two teehistorian files. And probably increases performance :). Fixes #5121 

## 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: Zwelf <zwelf@strct.cc>
2022-05-14 19:58:21 +00:00
Zwelf 8385726a5f Fix server loading map twice on startup 2022-05-14 21:50:03 +02:00
bors[bot] 1110e1592a
Merge #5123
5123: Add Cellegen, srdante, Nouaa to credits r=heinrich5991 a=def-

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

## Checklist

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


Co-authored-by: def <dennis@felsin9.de>
2022-05-14 18:47:39 +00:00
def 17fe0ec8e3 Add Cellegen, srdante, Nouaa to credits 2022-05-14 19:56:08 +02:00
bors[bot] 3d244b728d
Merge #5122
5122: Cleanup CRenderTools r=heinrich5991 a=Robyt3



## 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-05-14 17:41:04 +00:00
Robert Müller 51d0d76e11 Rename parameters id -> Id 2022-05-14 19:08:43 +02:00
bors[bot] 92be4a67d7
Merge #4959
4959: Revert "CGameClient::LoadMapSettings: Load the default tuning params … r=heinrich5991 a=def-

…by default"

This reverts commit 754562ce0b.

This breaks rendering for ddnet mode, thanks to cheeser0613 for report

`@Kaffeine` I'd prefer to have it working with DDNet instead of vanilla. A fix that doesn't break DDNet demos would be welcome.

## 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-05-14 16:31:54 +00:00
bors[bot] 6eab58fa24
Merge #5120
5120: Add basic driver version parsing for Vulkan r=def- a=Jupeyy

From 5c3986798a/includes/functions.php (L364)

I dunno how reliable that is, but https://gpuinfo.org is quite good, so probs reliable enough for our needs :D

Similar to how OpenGL also prints the driver version in the GL_VERSION string. Can be quite useful and is easier for the end user

## 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-05-14 15:34:11 +00:00
Jupeyy 77196ed571 Add basic driver version parsing for Vulkan 2022-05-14 14:06:06 +02:00
Robert Müller 25c4270cb4 Fix comments 2022-05-14 13:44:12 +02:00
Robert Müller 485d61d4f8 Use std::swap 2022-05-14 13:43:26 +02:00
Robert Müller 1690a9703d Rename variable cs -> ColorScale 2022-05-14 13:40:46 +02:00
Robert Müller 3708abe8e0 Remove CRenderTools' pointers to CUI and CGameClient 2022-05-14 13:31:07 +02:00
bors[bot] ec75563dad
Merge #5109 #5110 #5112 #5115 #5117
5109: Only print zone messages when there is one r=heinrich5991 a=def-

```
src/game/server/entities/character.cpp: In member function ‘void CCharacter::SendZoneMsgs()’:
src/game/server/entities/character.cpp:2013:78: warning: the address of ‘CGameContext::m_aaZoneLeaveMsg’ will never be NULL [-Waddress]
 2013 |         if(m_TuneZoneOld >= 0 && GameServer()->m_aaZoneLeaveMsg[m_TuneZoneOld])
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from src/game/server/entities/character.cpp:7:
src/game/server/gamecontext.h:179:14: note: ‘CGameContext::m_aaZoneLeaveMsg’ declared here
  179 |         char m_aaZoneLeaveMsg[NUM_TUNEZONES][256];
      |              ^~~~~~~~~~~~~~~~
src/game/server/entities/character.cpp:2028:53: warning: the address of ‘CGameContext::m_aaZoneEnterMsg’ will never be NULL [-Waddress]
 2028 |         if(GameServer()->m_aaZoneEnterMsg[m_TuneZone])
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
src/game/server/gamecontext.h:178:14: note: ‘CGameContext::m_aaZoneEnterMsg’ declared here
  178 |         char m_aaZoneEnterMsg[NUM_TUNEZONES][256]; // 0 is used for switching from or to area without tunings
      |              ^~~~~~~~~~~~~~~~
```
<!-- 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)


5110: Assert client id in SetSolo r=heinrich5991 a=def-

I could not find a way that an invalid client ID is used here, but
compiler warns anyway:
```
In member function ‘void CTeamsCore::SetSolo(int, bool)’,
    inlined from ‘void CCharacter::SetSolo(bool)’ at src/game/client/prediction/entities/character.cpp:29:22,
    inlined from ‘void CCharacter::HandleTiles(int)’ at src/game/client/prediction/entities/character.cpp:882:10:
src/game/teamscore.h:45:34: warning: array subscript [0, 63] is outside array bounds of ‘bool [64]’ [-Warray-bounds]
   45 |                 m_IsSolo[ClientID] = Value;
      |                 ~~~~~~~~~~~~~~~~~^
src/game/teamscore.h: In member function ‘void CCharacter::HandleTiles(int)’:
src/game/teamscore.h:27:14: note: while referencing ‘CTeamsCore::m_IsSolo’
   27 |         bool m_IsSolo[MAX_CLIENTS];
      |              ^~~~~~~~
```
<!-- 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)


5112: Update traditional_chinese.txt r=def- a=Cheeser0613

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


5115: Update simplified_chinese.txt r=def- a=Cheeser0613

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


5117: Update tooltip text after changing language r=Jupeyy a=def-

Thanks to cheeser0613 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: Cheeser0613 <54943099+Cheeser0613@users.noreply.github.com>
2022-05-14 11:15:03 +00:00
bors[bot] 8fa59061ce
Merge #5116
5116: Move create/destroy window ntf dbg_msg to log_debug r=def- a=Jupeyy

Most messages in the backend are warnings.
At least these two are send every time you minimize/maximize the window, so kinda annoying 


## 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-05-14 10:50:55 +00:00
def 0f2d464dbf Update tooltip text after changing language
Thanks to cheeser0613 for report
2022-05-14 12:49:12 +02:00
Jupeyy 4268f891fc Move create/destroy window ntf dbg_msg to log_debug 2022-05-14 12:48:41 +02:00
def 2f68b50fe1 Assert client id in SetSolo
I could not find a way that an invalid client ID is used here, but
compiler warns anyway:

In member function ‘void CTeamsCore::SetSolo(int, bool)’,
    inlined from ‘void CCharacter::SetSolo(bool)’ at src/game/client/prediction/entities/character.cpp:29:22,
    inlined from ‘void CCharacter::HandleTiles(int)’ at src/game/client/prediction/entities/character.cpp:882:10:
src/game/teamscore.h:45:34: warning: array subscript [0, 63] is outside array bounds of ‘bool [64]’ [-Warray-bounds]
   45 |                 m_IsSolo[ClientID] = Value;
      |                 ~~~~~~~~~~~~~~~~~^
src/game/teamscore.h: In member function ‘void CCharacter::HandleTiles(int)’:
src/game/teamscore.h:27:14: note: while referencing ‘CTeamsCore::m_IsSolo’
   27 |         bool m_IsSolo[MAX_CLIENTS];
      |              ^~~~~~~~
2022-05-14 11:28:01 +02:00
def b557e25650 Only print zone messages when there is one
src/game/server/entities/character.cpp: In member function ‘void CCharacter::SendZoneMsgs()’:
src/game/server/entities/character.cpp:2013:78: warning: the address of ‘CGameContext::m_aaZoneLeaveMsg’ will never be NULL [-Waddress]
 2013 |         if(m_TuneZoneOld >= 0 && GameServer()->m_aaZoneLeaveMsg[m_TuneZoneOld])
      |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
In file included from src/game/server/entities/character.cpp:7:
src/game/server/gamecontext.h:179:14: note: ‘CGameContext::m_aaZoneLeaveMsg’ declared here
  179 |         char m_aaZoneLeaveMsg[NUM_TUNEZONES][256];
      |              ^~~~~~~~~~~~~~~~
src/game/server/entities/character.cpp:2028:53: warning: the address of ‘CGameContext::m_aaZoneEnterMsg’ will never be NULL [-Waddress]
 2028 |         if(GameServer()->m_aaZoneEnterMsg[m_TuneZone])
      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
src/game/server/gamecontext.h:178:14: note: ‘CGameContext::m_aaZoneEnterMsg’ declared here
  178 |         char m_aaZoneEnterMsg[NUM_TUNEZONES][256]; // 0 is used for switching from or to area without tunings
      |              ^~~~~~~~~~~~~~~~
2022-05-14 11:18:08 +02:00
def cfe8cce91d Add translation string "Adjust the opacity..."
Reported by cheeser0613
2022-05-14 11:05:32 +02:00
Tater 3380fd8122 Fix dummy intended tick sent to server 2022-05-14 01:07:36 -05:00
bors[bot] e9b59e72ff
Merge #5103
5103: Remove unused DoButtonLogic pText argument r=def- a=Robyt3

<!-- 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: Robert Müller <robytemueller@gmail.com>
2022-05-13 23:02:29 +00:00
bors[bot] 497d47044a
Merge #5102
5102: Enhance teehistorian test output a bit r=def- a=Zwelf

Looks cleaner now, e.g. for TeamPractice:

```
[ RUN      ] TeeHistorian.TeamPractice
pOutput = {
	0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81, 0xd1, 0x34
	0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3, 0xbc, 0x02
	0x17, 0x01, 0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x01, 0x01, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x17, 0x00, 0x40
}
[       OK ] TeeHistorian.TeamPractice (0 ms)
```

## Checklist

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


Co-authored-by: Zwelf <zwelf@strct.cc>
2022-05-13 22:45:12 +00:00
Robert Müller fc93ba0539 Remove unused DoButtonLogic pText argument 2022-05-14 00:26:15 +02:00
Zwelf 7ada897478 Enhance teehistorian test output a bit
Looks cleaner now, e.g. for TeamPractice:

```
[ RUN      ] TeeHistorian.TeamPractice
pOutput = {
	0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81, 0xd1, 0x34
	0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3, 0xbc, 0x02
	0x17, 0x01, 0x41, 0x00, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x01, 0x01, 0x4a, 0x57, 0x92, 0x83, 0x4e, 0x81
	0xd1, 0x34, 0xc9, 0xa2, 0x9b, 0xb5, 0xff, 0x25, 0xda, 0xc3
	0xbc, 0x02, 0x17, 0x00, 0x40
}
[       OK ] TeeHistorian.TeamPractice (0 ms)
```
2022-05-13 23:36:05 +02:00
Robert Müller ca091d87b2 Support nesting editboxes, pickers and scrollbars in clipping areas 2022-05-13 21:39:25 +02:00
Robert Müller 1e8278ca95 Smooth clipping when scrolling in controls settings 2022-05-13 21:38:02 +02:00
Robert Müller 8c7cdb5936 Rename UiDoGetButtons to DoSettingsControlsButtons 2022-05-13 21:38:01 +02:00
Robert Müller 60347fde1a Use MouseHovered instead of clipping manually 2022-05-13 21:38:01 +02:00
Robert Müller 7bda9d4118 Fix variable spelling CheckAble -> Checkable 2022-05-13 20:46:54 +02:00
Robert Müller 8d12529f1e Move variable declaration 2022-05-13 20:46:54 +02:00
Robert Müller cae2b49ed6 Reuse MouseInside variable 2022-05-13 20:46:54 +02:00
Robert Müller 0f6572ebf6 Rename static variables ButtonUsed -> s_ButtonUsed 2022-05-13 20:46:54 +02:00
Robert Müller 6241c8483d Use bool instead of int with MouseInside 2022-05-13 20:46:50 +02:00
Robert Müller a248822ea5 Add CUI:MouseHovered and MouseInsideClip 2022-05-13 20:24:10 +02:00
Robert Müller 1855b4aea1 Support nested CUI clipping regions 2022-05-13 20:20:04 +02:00
heinrich5991 8049d64964 Add @Learath2's suggestion about buffer size handling 2022-05-13 13:57:35 +02:00
bors[bot] d87edb9b41
Merge #5089
5089: Render tees in skin selector with default emote r=def- a=sjrc6

suggested in https://github.com/ddnet/ddnet/issues/5057
works for player and dummy

![image](https://user-images.githubusercontent.com/22122579/167973498-bccaac07-756e-4e59-a19d-66d3e24542d0.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: Tater <Mr.Potatooh@gmail.com>
2022-05-13 08:24:15 +00:00
bors[bot] bab2defc26
Merge #5093
5093: Fix /practice chat responses and a few others r=Learath2 a=heinrich5991

Fixes #5087.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-05-13 07:58:07 +00:00
bors[bot] e4ed71f3ef
Merge #5088
5088: do not assert on entities without snap id r=heinrich5991 a=C0D3D3V

fixes #5054

## 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: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-05-13 07:34:22 +00:00
heinrich5991 15e3a0193f Fix version number for curl bug workaround
0x076800 corresponds to version 0x7.0x68.0x0 = 7.104.0, not 7.68.0 =
0x7.0x44.0x0, so we need 0x074400 instead.
2022-05-13 09:16:15 +02:00
heinrich5991 c9136121f2 Add HTTP header and plain HTTP post feature 2022-05-13 09:16:15 +02:00
heinrich5991 40bd85b552 Refactor HTTP code to no longer use inheritance
This gives us the same API interface for all different request types
(HEAD, GET, POST).
2022-05-13 09:16:15 +02:00
heinrich5991 0c2bb5a549 Fix /practice chat responses and a few others
Fixes #5087.
2022-05-13 09:14:05 +02:00
heinrich5991 b9e255a7a1 Mark dbg_break as [[noreturn]] 2022-05-13 09:04:39 +02:00
heinrich5991 246f213905 Remove a couple of game/-includes from the engine code 2022-05-13 09:04:39 +02:00
heinrich5991 1b233ab95c Add the HTTP client methods to the server 2022-05-13 09:04:39 +02:00
heinrich5991 14803d7605 Remove HTTP include from demoedit 2022-05-13 09:00:48 +02:00
heinrich5991 52d0dc8b5b Add functions to encode/decode base64 2022-05-13 09:00:48 +02:00
Tater b6a9389fe8 Render tees in skin selector with default emote 2022-05-12 17:17:19 -05:00
Zwelf 30f67573f4 Output corresponding array to EXPECTED in teehistorian test cases 2022-05-12 16:21:13 +02:00
c0d3d3v ed03945685
do not assert on entities without snap id 2022-05-12 11:28:21 +02:00
Jupeyy 915a27d803 Use dynamically allocated memory for the CacheChunk 2022-05-11 17:32:03 +02:00
c0d3d3v fa2ac1bb64
Merge branch 'master' into New_HUD
* master: (87 commits)
  Remove base/tl/string.h
  Replace remaining usage of base/tl/string with std::string
  Remove unused includes of base/tl/string.h
  Store localized strings in a CHeap instead of using tl/string.h
  Mark methods as const
  Add CHeap::StoreString method
  Rules are chat responses too
  Add margins to demo slice popup, decrease error font size, UI scaling
  Remove redundant parameters which are overridden later
  Use Margin instead of both VMargin and HMargin
  Move variable declaration
  Only output messages intended for chat to the user of a chat command
  Remove unused chat response variables
  Don't print the first "Waiting for score threads to complete"
  fix usage of undefined behavior for default eyes
  remove duplicate HOOK_RETRACTED assignment
  do not send swap request notification to complete team 0
  make swap messages more personal
  Move ninja shield to other position (fixes #5047)
  do not release the hooks if you swap
  ...
2022-05-10 19:03:09 +02:00
c0d3d3v 0c4dfb694c
Add Options for new HUD
- Change FontSize of MovementInfo to 6 and add a little morre padding at
  the sides
2022-05-10 18:41:46 +02:00
Chairn 2cb4a4d8f5 Changed file names to match classic source.c include header.h 2022-05-07 00:54:29 +02:00
Robert Müller 22562094bd Remove base/tl/string.h 2022-05-07 00:17:29 +02:00
Robert Müller a1d092be27 Replace remaining usage of base/tl/string with std::string 2022-05-07 00:17:29 +02:00
Robert Müller dee7393555 Remove unused includes of base/tl/string.h 2022-05-07 00:02:43 +02:00
Robert Müller 3e1cfcd306 Store localized strings in a CHeap instead of using tl/string.h 2022-05-07 00:02:43 +02:00
Robert Müller e2a049f0ca Mark methods as const 2022-05-06 23:24:58 +02:00
Robert Müller bc5f46e136 Add CHeap::StoreString method 2022-05-06 23:21:26 +02:00
Chairn 5925181acc Updated unicode script generation 2022-05-06 20:31:24 +02:00
Dennis Felsing b42fad604e Rules are chat responses too
Thanks to bencie for report
2022-05-06 00:12:03 +02:00
bors[bot] 14927684eb
Merge #5060
5060: Only output messages intended for chat to the user of a chat command r=def- a=heinrich5991

Fixes #5052.

The problem seems to be that there are two different concepts tangled up
in console/logging. One is actual logging as in other programs. The
other is "responses to the user of the command that was just entered",
like for rcon or chat commands. This issue isn't fixed by this commit.

## 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-05-01 15:01:02 +00:00
bors[bot] 21433f7553
Merge #5061
5061: Improve demo slice popup, minor refactoring of UI/menus r=def- a=Robyt3

Improve demo slice popup:
- add more margins
- decrease font size of error message slightly
- correct handling of all allowed UI scale values:
   - fix overlapping elements on some UI scales by laying out all CUIRects (except the buttons) from top to bottom
   - make `New name:` label scaled

Refactoring:
- Use `CUI::Margin` instead of both `HMargin` and `VMargin`, when the margin value is identical.
- Pass 0 instead of CUIRect pointer in some cases where the value is never used, i.e. never read and overridden in the next line.

Before:

![screenshot_2022-05-01_00-18-26](https://user-images.githubusercontent.com/23437060/166140703-1050b122-bb8f-49a4-b398-f7b0b6e677a7.png)

After:

![screenshot_2022-05-01_12-05-00](https://user-images.githubusercontent.com/23437060/166141455-50876142-13f9-4563-af0f-9f78a519ed60.png)

Tested with `ui_scale 50/90/100/110/150`.

## 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: Robert Müller <robytemueller@gmail.com>
2022-05-01 10:28:41 +00:00
bors[bot] 68b6027114
Merge #5037
5037: Add logging macros `log_{error,warn,info,debug,trace}` r=def- a=heinrich5991

This makes it almost as short to log as with `dbg_msg` (one to two more
characters), and much shorter than
`Console()->Print(IConsole::OUTPUT_LEVEL_{STANDARD,ADDINFO,DEBUG})`.

Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
2022-05-01 10:10:22 +00:00
Robert Müller cc9ed7e9d3 Add margins to demo slice popup, decrease error font size, UI scaling 2022-05-01 12:03:56 +02:00
Robert Müller f4642472b2 Remove redundant parameters which are overridden later 2022-05-01 11:40:26 +02:00
Robert Müller a1614e4709 Use Margin instead of both VMargin and HMargin 2022-05-01 11:40:21 +02:00
Robert Müller e291a3a70c Move variable declaration 2022-05-01 11:38:58 +02:00
heinrich5991 d5f8bc2783 Only output messages intended for chat to the user of a chat command
Fixes #5052.

The problem seems to be that there are two different concepts tangled up
in console/logging. One is actual logging as in other programs. The
other is "responses to the user of the command that was just entered",
like for rcon or chat commands. This issue isn't fixed by this commit.
2022-05-01 11:18:22 +02:00
heinrich5991 4061069b73 Remove unused chat response variables 2022-05-01 11:18:22 +02:00
heinrich5991 23ef309d0a Don't print the first "Waiting for score threads to complete"
Looks nicer IMO if you don't show the message if there's no actual
waiting.
2022-05-01 11:10:15 +02:00
Tater 488b781f79 fix usage of undefined behavior for default eyes
fix using the same buffer as dest and source.
2022-05-01 03:04:10 -05:00
bors[bot] 567aeb7d9e
Merge #5049
5049: do not release the hooks if you swap r=C0D3D3V a=C0D3D3V

Needs more testing, but first test looks good
https://streamable.com/ypra11

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


Co-authored-by: c0d3d3v <c0d3d3v@mag-keinen-spam.de>
2022-04-30 20:09:20 +00:00
c0d3d3v a289503411
remove duplicate HOOK_RETRACTED assignment 2022-04-30 21:41:13 +02:00
c0d3d3v eae74fe91e
do not send swap request notification to complete team 0 2022-04-30 21:24:25 +02:00
c0d3d3v 808526bdd8
make swap messages more personal 2022-04-30 12:16:38 +02:00
c0d3d3v 0ea811f70e
do not release the hooks if you swap 2022-04-30 10:21:38 +02:00