Commit graph

15647 commits

Author SHA1 Message Date
Robert Müller 9a1bd192c4 Add popup to select envelope curve type, support shift+left click
Show popup to select the envelope curve type from a list when right clicking the curve type button, as selecting the curve type by pressing the button multiple times is inconvenient.

Switch to previous curve type on shift+left clicking the curve type button.
2024-10-16 22:31:02 +02:00
Robert Müller 7ac0a8f6c6 Reduce indent, avoid C style casts in CLayers::InitTilemapSkip 2024-10-15 21:11:31 +02:00
Robert Müller e0461f4c21 Combine CLayers::Init and CLayers::InitBackground functions
The `CLayers::InitBackground` function implemented a subset of the `CLayers::Init` function, only loading the game layers and not the other entities layers, so a Boolean parameter can be used to reduce the duplicate code.
2024-10-15 21:11:31 +02:00
Robert Müller b991a44b40 Rename variables l/g to LayerIndex/GroupIndex 2024-10-15 21:11:24 +02:00
heinrich5991 8290db97b8
Merge pull request #9142 from ChillerDragon/pr_07_fav_urls
Store 0.7 favorites in url format
2024-10-14 15:38:54 +00:00
heinrich5991 c829639d65
Merge pull request #9123 from Robyt3/Client-Skin-Download-Refactoring
Improve skin downloading: load from `downloadedskins` if possible
2024-10-14 15:37:35 +00:00
Dennis Felsing 0f074aa773 Fix top5team sql 2024-10-14 17:33:23 +02:00
Dennis Felsing e21915074c
Merge pull request #9149 from dobrykafe/pr-nameplates-preview
Add nameplates preview
2024-10-13 21:44:37 +00:00
Dennis Felsing c3e627e443 Fix clang-tidy 2024-10-13 23:24:31 +02:00
dobrykafe f3473c7f73 add nameplates preview 2024-10-13 19:33:36 +02:00
Robert Müller e725432a7f Cleanup envelope updating during demo playback
The additional code to evaluate envelopes during demo playback is obsolete, as client ticks are already properly synchronized with the demo playback.

From teeworlds/teeworlds#2750 and teeworlds/teeworlds#2768.
2024-10-13 17:45:38 +02:00
Robert Müller 21e0cdd0bc Ensure lock is held when modifying condition of condition variable
See #9145.
2024-10-13 15:09:51 +02:00
Robert Müller ad8349b7e9 Avoid busy waiting in CHttpRequest::Wait function
Use a condition variable instead of busy waiting until HTTP requests are done.

Also set the state `EHttpState::RUNNING` which was previously unused.

Closes #7811.
2024-10-13 12:48:24 +02:00
KebsCS cd96eea8ce
Fix toggle arg validation 2024-10-12 21:02:17 +02:00
ChillerDragon 0c797893d5 Store 0.7 favorites in url format 2024-10-12 19:19:43 +09:00
ChillerDragon bb53b9eae0 Revert "Fix 0.7 server favorites"
This reverts commit 4c57f2d9f8.
2024-10-12 15:13:14 +09:00
Robert Müller ab60d0bf70 Fix server-side demos with maps in folders
When maps are loaded from folders on the server, the same folders were used for demos but recording would usually fail due to the folders not existing in the demos folder.

Furthermore, the map name being written in the demo header also included the folder names, which causes the client to not find the map unless it also exists at that location.

Closes #9033.
2024-10-11 21:36:32 +02:00
Robert Müller e24b87adbd Make CServer::GetMapName function more efficient by caching
Store the current map filename (without path) separately when loading a new map instead of determining it again each time that the `CServer::GetMapName` function is called.

Use the `fs_filename` function for this.

Avoid the usage of the `sv_map` config variable for this, which may have caused the returned map filename to be out-of-sync with the real map on the server due to the map specified by the config variable not being reloaded immediately.
2024-10-11 21:35:36 +02:00
Dennis Felsing 52d860a823
Merge pull request #9135 from furo321/no-delay-rescue
Don't check `sv_rescue_delay` in practice
2024-10-11 06:31:41 +00:00
Dennis Felsing e47bf55051
Merge pull request #9052 from ChillerDragon/pr_fav7
Fix 0.7 server favorites
2024-10-11 06:31:28 +00:00
Dennis Felsing 8cee3a6275
Merge pull request #8889 from KebsCS/pr-regional-top5team
Add regional rankings to /top5team
2024-10-11 06:26:38 +00:00
Dennis Felsing e4a3631bf4
Merge pull request #9138 from furo321/tiles-hookcoll-preview
Render hookable and unhookable tiles for hook collision preview
2024-10-11 06:26:16 +00:00
furo 9fdb246724 Render hookable and unhookable tiles for hook collision preview 2024-10-11 01:09:38 +02:00
KebsCS 279b14cc44
Add regional rankings to /top5team 2024-10-11 00:09:32 +02:00
Robert Müller 3f829b4ac2 Refactor CTeeRenderInfo usage
- Add `CTeeRenderInfo::ApplyColors` function to reduce duplicate code.
- Use `CTeeRenderInfo::Apply` function in more cases.
- Use `CSkins::Find` function instead of implementing default skin handling manually with the `FindOrNullptr` function for chat settings preview.
- Remove redundant initialization of `CTeeRenderInfo::m_CustomColoredSkin` member.
- Replace empty client skin with `default` instead of checking for empty skin names later.
- Remove unnecessary check for empty skin name for ghost rendering. The `CSkins::Find` function will return the default skin for an empty skin name, which is more correct than invalidating the ghost skin render info.
2024-10-10 23:29:38 +02:00
Robert Müller 85b836723a
Merge pull request #9136 from KebsCS/pr-hook-coll-preview
Add hook collisions preview
2024-10-10 20:43:26 +00:00
KebsCS bfe2e4dc80
Add hook collisions preview 2024-10-10 22:23:03 +02:00
Robert Müller f2090d6551
Merge pull request #8961 from KebsCS/pr-teleport-numbers
Change editor teleport number behavior
2024-10-10 17:26:51 +00:00
furo a4bb1ec0dc Don't check sv_rescue_delay in practice 2024-10-10 15:39:47 +02:00
KebsCS a2fedd0589
Change editor teleport number behavior 2024-10-10 01:34:39 +02:00
ChillerDragon 1bf350c6f8 Use .data() in mysql code for better readability
Fixes https://clang.llvm.org/extra/clang-tidy/checks/readability/container-data-pointer.html
2024-10-10 08:18:51 +09:00
Robert Müller 181b6d8b9c Improve skin downloading: load from downloadedskins if possible
Previously, skins not found in the `skins` folder were downloaded from the configured URL and saved to the `downloadedskins` folder, but the saved files were never used, leading to wasted downloads and write operations.

Now, if a skin to be downloaded already exists in the `downloadedskins` folder, the modified time of the skin file is determined and included in the HTTP GET request as `If-Modified-Since` header. If the file was not modified on the server since that time, the server will answer with status 304 Not Modified and an empty response body, in which case the existing skin file is loaded. If the skin file was modified, then it will be downloaded like usual. The download will also be retried without including the `If-Modified-Since` header, if the local file is more recent but it failed to be loaded. If a skin could not be downloaded when it should but a file already exists in the `downloadedskins` folder then that file will be loaded instead.

Instead of checking whether the number of skins is different to determine whether to reload the list of skins in the settings menus, the last time that the list of skins was refreshed is now saved and compared, which is more robust. The additional check to refresh the skin list while skins are being downloaded is unnecessary, as any updates to the skin list are now covered by checking the last refresh time.
2024-10-09 22:56:44 +02:00
Dennis Felsing 76e7317685
Merge pull request #9114 from Pioooooo/infjump-command
Add rcon commands (un)infinite_jump, practice commands /(un)infjump
2024-10-09 20:27:03 +00:00
heinrich5991 7e04b8c521 Allow 2048 bans, we hit the limit of 1024… 2024-10-09 20:47:20 +02:00
ChillerDragon f7955a50e6 Fix empty vector element access in mysql prepare
If the sql statement does not contain placeholders
``NumParameters`` can be empty.

In that case accessing the first element will cause an asan error:

```
runtime error: reference binding to null pointer of type 'st_mysql_bind'
```
2024-10-09 09:48:42 +09:00
Dennis Felsing 4dbf9a1d54
Merge pull request #9025 from dobrykafe/pr-fix-reset-file-crash
Fix `CFGFLAG_STORE` commands not getting stored when executed from reset file
2024-10-08 06:55:59 +00:00
Dennis Felsing 5fd083c674
Merge pull request #9127 from dobrykafe/pr-adjust-console-search
Adjust console search behaviour
2024-10-07 22:20:10 +00:00
dobrykafe bde82d57d9 adjust console search behaviour 2024-10-07 23:45:08 +02:00
KebsCS 6d7aeaba1c
Fix color validation in some commands 2024-10-07 16:07:26 +02:00
Tater b6bc5d1884 apply exponential easing to smooth camera 2024-10-06 22:45:48 -05:00
Robert Müller 0bb829b7b8 Add IStorage::RetrieveTimes function as fs_file_time wrapper 2024-10-06 22:11:13 +02:00
Dennis Felsing a1d7f0f1f0
Merge pull request #9115 from Pioooooo/fix-help-command
Fix /help not printing help for several chat commands
2024-10-05 22:06:54 +00:00
Robert Müller 768d95dce4 Add MAX_SKIN_LENGTH constant
Add constant to replace the magic number `24` used for the size of skin names. Skin names in the server info/browser were sized `24 + 1` but the additional byte was unnecessary.
2024-10-05 17:04:40 +02:00
Pioooooo 4f7aa0ed52 Fix /help not printing help for several chat commands and improve help message 2024-10-05 22:47:29 +08:00
Pioooooo 3f676794f6 Add rcon commands (un)infinite_jump, practice commands /(un)infjump 2024-10-05 21:21:13 +08:00
ChillerDragon 161adf967e Remove null pointer mem copy
Closed https://github.com/ddnet-insta/ddnet-insta/issues/175
2024-10-05 10:32:17 +08:00
Dennis Felsing dd82b1e25d
Merge pull request #9111 from timakro/pr-add-missing-practice-commands
Add practice commands /totele(cp), /(un)livefreeze, /(un)endless
2024-10-04 23:14:02 +00:00
Tim Schumacher 38d297f367 Add practice commands /totele(cp), /(un)livefreeze, /(un)endless 2024-10-05 00:47:53 +02:00
Dennis Felsing fa285811fa
Merge pull request #9110 from Robyt3/Datafile-Reader-Assertions
Add assertions to `CDataFileReader` checking if file open/closed
2024-10-04 22:34:28 +00:00
Dennis Felsing d51a726129
Merge pull request #9047 from timakro/pr-add-invincible-mode
Add invincible mode
2024-10-04 22:05:09 +00:00
Robert Müller e63d7386be Remove unused datafile reader variable in dummy_map tool 2024-10-04 21:12:54 +02:00
Robert Müller a3b2146a16 Add assertions to CDataFileReader checking if file open/closed
When the datafile is closed, only the `CDataFileReader::Open` and `CDataFileReader::Close` functions may be called. All other functions will now assert instead of returning some default-values if no file is open. The `CDataFileReader::Open` function will now assert if the file is already open instead of implicitly closing the previous one.
2024-10-04 21:12:21 +02:00
Tim Schumacher 5457e8fc3b Render sparkling trail for invincible players 2024-10-04 19:41:30 +02:00
Dennis Felsing a56e5324d8
Merge pull request #9106 from ChillerDragon/pr_break_peer
Break early in peer matching
2024-10-04 07:06:39 +00:00
ChillerDragon 11047d1b80 Break early in peer matching 2024-10-04 14:46:33 +08:00
dobrykafe 184f07a912 fix server settings command help text overwriting other tooltips 2024-10-03 21:55:07 +02:00
Dennis Felsing 29523e4972
Merge pull request #9102 from Jupeyy/pr_no_warning_fail
Don't emit a warning if no capable vulkan GPU was found
2024-10-03 11:37:39 +00:00
Jupeyy bbab3478f6
Don't emit a warning to the user if no capable vulkan GPU was found 2024-10-03 11:49:09 +02:00
heinrich5991 154b6d79f7
Merge pull request #9099 from infclass/ddnet-sound-channels
Use CHN_WORLD for MAPSOUNDWORLD and CHN_GLOBAL for MAPSOUNDGLOBAL
2024-10-03 09:22:52 +00:00
Jupeyy 47db90d8e9
Block AMD drivers from after 19.12.1 & before 22.4.1 2024-10-03 10:49:58 +02:00
Alexander Akulich 03a06a144d Use CHN_WORLD for MAPSOUNDWORLD and CHN_GLOBAL for MAPSOUNDGLOBAL
The whole idea behind custom sounds was to use them as replacement for
built-in sounds (depending on the gameplay). We have to use the same channels
instead of the MAP (aka 'ambient') channel to have the same volume for both
sets of messages.
Otherwise we have situation of players reporting 'no sound' because they have
`snd_ambient_volume 0` in the configs.

NETMSGTYPE_SV_MAPSOUNDGLOBAL is NETMSGTYPE_SV_SOUNDGLOBAL which uses map
assets as the sounds container. Use the same CSounds::CHN_GLOBAL to make
the sound messages equivalent.

NETEVENTTYPE_MAPSOUNDWORLD is NETEVENTTYPE_SOUNDWORLD which uses map assets
as the sounds container. Use the same CSounds::CHN_WORLD to make the sound
events equivalent.
2024-10-03 03:51:33 +03:00
Robert Müller f10d476964
Merge pull request #9091 from dobrykafe/pr-editor-ui-debug
Show UI debug info inside editor
2024-10-02 20:30:07 +00:00
dobrykafe 045738daf3 show ui debug info inside editor 2024-10-02 21:25:24 +02:00
KebsCS 21d378e4cb
Fix switch overlay text order 2024-10-02 17:25:14 +02:00
Robert Müller d3d4c187fb
Merge pull request #9059 from dobrykafe/pr-fix-drag-nav
Editor: fix click drag navigation selecting quads/sounds
2024-10-01 17:51:06 +00:00
ChillerDragon 547a9a0285 Explicitly set m_LastSetTeam to zero
It is compared to 0 in gamecontext.cpp but it is never explicitly set to 0.

```C++
if(pPlayer->GetTeam() == pMsg->m_Team || (g_Config.m_SvSpamprotection && pPlayer->m_LastSetTeam && pPlayer->m_LastSetTeam + Server()->TickSpeed() * g_Config.m_SvTeamChangeDelay > Server()->Tick()))
	return;
```
2024-10-01 15:25:17 +08:00
dobrykafe 7564a065c2 fix context menu showing up after canceling quad rotation 2024-09-30 23:56:59 +02:00
dobrykafe 2e77c4bd59 fix click drag navigation selecting quads/sounds 2024-09-30 22:46:56 +02:00
Robert Müller 65f118f840 Fix use of deprecated member variables in video recorder
Use the new `avcodec_get_supported_config` function instead of the deprecated `sample_fmts` and `supported_samplerates` members with libavcodec 61.13.100 and newer.

See 76eb3e5ff3/doc/APIchanges (L53-L56)

Closes #9085.
2024-09-30 21:59:47 +02:00
Robert Müller 7abeaf5600
Merge pull request #9078 from ChillerDragon/pr_browser_arrow_left_right
Arrow left and right in browser (internet/lan/favorites)
2024-09-30 13:23:46 +00:00
ChillerDragon 2b0fb83140 Arrow left and right in browser (internet/lan/favorites)
Closed #9038
2024-09-30 20:45:57 +08:00
ChillerDragon baeab0eaa9 Fix tabs being used in ascii art browser comment
Spaces are more portable if alignment matters
2024-09-30 14:07:17 +08:00
Dennis Felsing 5a893c8e52 Update credits 2024-09-29 13:42:17 +02:00
Dennis Felsing b32e7bea0a Version 18.7 (new scheme: nightly should have higher version than released)
Things that land in main now won't be part of 18.6 anymore
2024-09-29 11:41:55 +02:00
tobi 56f09e9d92 Add actually setting m_LastRescue variable 2024-09-28 23:25:05 +02:00
Robert Müller c573427609
Merge pull request #9054 from KebsCS/pr-rightclick-layer
Add right-click to solo editor layer
2024-09-28 18:04:10 +00:00
KebsCS cc2ce6ea9b
Add right-click to solo editor layer 2024-09-28 19:43:46 +02:00
Dennis Felsing 27e29a1ba7
Merge pull request #9045 from KebsCS/pr-smooth-spectating
Add smooth spectating
2024-09-28 11:55:01 +00:00
KebsCS 486de46f9d
Add custom editor entities 2024-09-27 22:07:57 +02:00
KebsCS e70aaf2fe8
Add smooth spectating 2024-09-27 14:19:52 +02:00
Dennis Felsing 2a64dac091
Merge pull request #9050 from ChillerDragon/pr_sql_convention
Cleanup sql worker request/result naming convention
2024-09-27 11:19:09 +00:00
Dennis Felsing 0628f74e64
Merge pull request #9049 from ChillerDragon/pr_rm_unused_sql_clientid
Remove unused m_ClientId from score worker
2024-09-27 11:11:42 +00:00
Dennis Felsing 205a7084a5
Merge pull request #9048 from KebsCS/pr-fix-spectate-closest
Fix SpectateClosest switching to random player
2024-09-27 11:11:00 +00:00
ChillerDragon 4c57f2d9f8 Fix 0.7 server favorites 2024-09-27 18:53:08 +08:00
ChillerDragon 82af705542 Cleanup sql worker request/result naming convention
There are two interfaces for score worker data:

There is ``ISqlResult`` and every class inheriting from it should have
the suffix ``Result``

Then there is ``ISqlData`` and every class inheriting from it should
have the suffix ``Data`` if it is data that should be written in an
INSERT statement. Or ``Request`` if it is used to perform a read
operation and will be used in a SELECT statament.

The convention was mostly established alreay. In this commit the last
three classes that broke this convention got fixed.
2024-09-27 06:51:35 -04:00
ChillerDragon f2ec87d4e0 Remove unused m_ClientId from score worker 2024-09-27 06:51:15 -04:00
KebsCS 2646de0a7a Fix SpectateClosest switching to random player 2024-09-27 06:50:50 -04:00
Robert Müller 1021fdf7ae Consistently order I/O functions declarations and definitions 2024-09-27 11:17:41 +02:00
Robert Müller b18073a5cd Minor improvement of I/O functions documentation 2024-09-27 11:17:41 +02:00
Tim Schumacher c91be7b19f Add practice command /invincible to toggle invincible mode 2024-09-26 19:18:58 +02:00
Tim Schumacher b564110675 Make invincible players immune to freeze, death and teleport tiles and give them unlimited jumps
Specifically:
* Ignore freeze, deep freeze, deep unfreeze, live freeze, and live unfreeze tiles
* Ignore also the switched variants of those tiles
* Allow movement when deep and live frozen
* Ignore death tiles
* Ignore red tele, blue tele, red checkpoint tele, and blue checkpoint tele tiles
* Unlimited jumps
* Disable /rescue

Switches, doors, draggers, etc. are not disabled for invincible players in this patch
2024-09-26 19:18:52 +02:00
Tim Schumacher f51664e5ce Add rcon command "invincible" which does nothing yet
This commit adds the rcon command "invincible" which toggles the new m_Invincible variable on CCharacterCore. The feature is supposed to be an alterantive to super that is safe for /practice mode. The state of m_Invincible is synchronized to the client via the DDNetCharacter net object. Future commits will change checks for m_Super to check for m_Invincible as well in places where this is safe such as e.g. preventing freezing of the player. The ability to interact with players that are in other teams will remain exclusive to super.
2024-09-26 19:05:03 +02:00
Tim Schumacher a3e19fc39a Make CCharacter::SetSuper() idempotent
Specifically, SetSuper(false) followed by SetSuper(false) should not change teams. The following commit relies on this, but it is generally a good idea to remove this footgun.
2024-09-26 18:57:23 +02:00
Dennis Felsing 89474ae2b0
Merge pull request #9041 from bencie/tee-hover-tooltip
Show skin name as tooltip in friendlist and serverinfo
2024-09-26 01:42:00 +00:00
Dennis Felsing 525803a62b
Merge pull request #9043 from furo321/dont-reset-zoom
Don't reset zoom on team switch
2024-09-26 01:39:14 +00:00
furo 2dcbd5ecbb Don't reset zoom on team switch 2024-09-26 00:09:41 +02:00
bencie 36c3656883 Make cl_show_direction change alpha with cl_show_others_alpha 2024-09-25 18:19:45 +02:00
bencie 7de1d3058f Show skin name as tooltip in friendlist and serverinfo 2024-09-25 16:42:10 +02:00
dobrykafe 9630e1658c fix CFGFLAG_STORE commands not getting stored when executed from reset file 2024-09-25 14:32:55 +02:00
TsFreddie 18ff7f9a5f
Fix Leak IP check 2024-09-25 18:01:24 +08:00