Commit graph

14035 commits

Author SHA1 Message Date
Robert Müller f8af7542c6 Move CHostLookup to separate compilation unit
The host lookup job and the engine interface are independent so they are moved to separate files.

The include of `engine.h` in `client.h` is therefore unnecessary and other includes also had to be adjusted because of this.

The variable `m_VersionServeraddr` is unused and therefore removed. The host lookup job is currently not used on the client-side.
2023-10-22 13:38:35 +02:00
Robert Müller 1fde694565 Improve positioning of IME candidate window for multi-line text
Previously, the IME candidate window was aligned with the top-right corner of the text bounding box (when rendering the text until the caret offset). This does not work correctly for text spanning multiple lines, causing the IME candidate window to be displayed at the X position of the longest line instead. Additionally, text clipping in the chat was not considered, as `CLineInput` is not aware of the clipping implemented in `CChat`, causing the IME candidate window to be moved up too far.

This is fixed by getting the correct rendered position of the caret offset using `m_CursorRenderedPosition`. Vertical alignment is also changed so only one line of text is considered, which makes the behavior more consistent with Windows' native IME candidate window and avoids larger changes in `CLineInput` to make it aware of clipping.
2023-10-20 17:51:01 +02:00
Robert Müller 0e4f174f78 Check for all file errors in demo player, show demo error popup
Handle the return values of all uses of the `io_read`, `io_skip` and `io_tell` functions in `CDemoPlayer`, to handle truncated demo files and other unexpected file reading and seeking errors during demo playback.

Show more detailed error message popups when demos cannot be loaded due to errors and when demo playback is stopped unexpectedly due to errors. Previously, only a generic message "Error loading demo" was shown when loading failed and no error message was shown when demo playback is stopped due to errors.
2023-10-19 21:48:04 +02:00
Robert Müller 92e2e17f0f Validate ticks when reading demo chunk headers
Add checks to ensure that the ticks read from demo chunk headers are in the valid range (cf. `MIN_TICK` and `MAX_TICK` constants). Playing demos with invalid ticks is prevented entirely, as the invalid ticks would cause issues in other places. The server never uses ticks outside the valid range, so invalid ticks should never occur in correctly recorded demos.

Additionally, checks are added to detect if a tickmarker chunk with a tick delta occurs before a tickmarker chunk defining an initial tick. The tick delta is only meaningful when an initial tick has already been defined, so if this is not the case the demo is also considered invalid.
2023-10-19 21:41:20 +02:00
Robert Müller 6951795619 Add title to engine warnings and make auto-hiding optional
Make the title of warnings adjustable, with the default title being "Warning" to preserve existing code.

Make auto-hiding configurable, so the automatic closing of warning popups after 10 seconds can be toggled.
2023-10-19 21:40:55 +02:00
Robert Müller 60807b5de9 Fix io_skip return type and documentation
The function returns 0 on success and -1 on error, as it delegates to `io_seek`, instead of returning the number of bytes skipped, which the documentation previously suggested. The return type is changed from `unsigned` to `int`, as this is also the type of `io_seek` and this better handles -1 as a return value.
2023-10-19 21:40:35 +02:00
dobrykafe 697bd8980d stop sound preview in more places 2023-10-18 14:47:47 +02:00
dobrykafe aafee689ca stop/pause sound previews 2023-10-18 13:27:31 +02:00
Robert Müller 8fea5998aa Mark functions as const when possible 2023-10-17 20:27:58 +02:00
Robert Müller 59b5fd2793 Fix graphs initially rendering incorrect values
Ensure only valid graph entries are used to render curve line segments.
2023-10-17 20:27:31 +02:00
Robert Müller 11423b88b1 Use full graph width for rendering curve
Previously, roughly one percent of the graph width was not used for the curve values.
2023-10-17 20:25:35 +02:00
Robert Müller 1a01d7657f Remove unused m_Graph member of CSmoothTime 2023-10-17 20:25:32 +02:00
Robert Müller a0c0d7efba Fix incorrect minimum value of dbg_tuning velramp graph
This was causing the curve to clip outside the graph area.
2023-10-17 20:24:47 +02:00
Robert Müller e187bda620 Use bool instead of int 2023-10-17 20:24:45 +02:00
Robert Müller d92b7b5c5f Add enum for CSmoothTime adjust direction 2023-10-17 20:24:38 +02:00
Robert Müller fb96217147 Fix first value in graphs being incorrect
As the index was incremented before setting the value, the value at index 0 was not set correctly until the ringbuffer wraps around.
2023-10-17 20:23:35 +02:00
Robert Müller dc7fa1fbb2 Use ColorRGBA for CGraph entry color 2023-10-17 20:23:16 +02:00
Robert Müller 912355f9ec Move CSmoothTime class to separate compilation unit 2023-10-17 20:23:07 +02:00
Robert Müller ee51cac9e6 Move CGraph class to separate compilation unit 2023-10-17 20:22:48 +02:00
Robert Müller f1e74c12e9 Remove unused IDemoPlayer::GetDemoType and enum literals
We only show the string value directly in the UI instead of using the demotype enum literals. There also should not be any reason to change any logic depending on whether the current demo is a server- or client-demo.
2023-10-16 22:06:28 +02:00
Robert Müller af4b1c9c97 Remove tick error debug message
This is shown every time demo playback ends when reaching the end of the file and it does not really help debugging.
2023-10-16 22:06:19 +02:00
Robert Müller ed92a9e8c7 Remove redundant checks for missing SHA256 when recording demo
The SHA256 was effectively not optional anymore when recording demos, as it and the SHA256 extension UUID were always written to the demo file without checking for `nullptr`. Therefore the SHA256 is now passed by const reference instead of by pointer and redundant checks for `nullptr` are removed.
2023-10-16 21:53:37 +02:00
Robert Müller f7b8738f91 Remove obsolete TODO about improving demo player map checking
We already use `CClient::LoadMapSearch` to load maps for demo playback, so maps in the `maps` folder are already considered. Using the map CRC is deprecated, we do not want to check it.
2023-10-16 21:53:37 +02:00
Robert Müller dbbae72ca7 Move variable declarations closer to usages 2023-10-16 21:53:37 +02:00
Robert Müller 9b68b9deef Use bool instead of int 2023-10-16 21:53:36 +02:00
Robert Müller 1333ac34f4 Use nullptr instead of 0 and NULL 2023-10-16 21:53:36 +02:00
Robert Müller 568177114f Remove unnecessary parentheses 2023-10-16 21:53:36 +02:00
Robert Müller 82d94faf28 Refactor GetDemoName using IStorage::StripPathAndExtension
The functions were effectively identical already.
2023-10-16 21:53:32 +02:00
Robert Müller c3b8c94212 Use std::vector for demo player keyframes
Using an `std::vector` is simpler and more readable than first allocating a linked list on a heap and later copying the list to an array.

The variable `m_SeekablePoints` is removed from `CPlaybackInfo`, as it does not need to be exposed outside of `CDemoPlayer` and can be replaced with the size of the vector.
2023-10-16 21:53:29 +02:00
Robert Müller cd4a13e74c Remove unnecessary check for open file in ReadChunkHeader
The function is only used internally and never called when the file is not open.
2023-10-16 20:50:43 +02:00
Dennis Felsing a60eb31ede
Merge pull request #7351 from Robyt3/Client-Snap-PlayerInfo-Crash-Fix
Fix client crash on player info snapshot item with invalid ID
2023-10-15 22:30:02 +00:00
Dennis Felsing 042a04d610
Merge pull request #7353 from Robyt3/Engine-Jobpool-Refactoring
Minor refactoring of engine jobpool
2023-10-15 22:29:33 +00:00
Robert Müller 22352316d8 Give jobpool worker threads different names based on index 2023-10-15 22:10:50 +02:00
Robert Müller ba5a974353 Increase jobpool thread count based on hardware concurrency
The client/server jobpools were previously only using a fixed number of 2 threads. Now the pools use `2 * hardware-concurrency + 2` threads, which should provide better performance overall, as we expect threads to often wait on I/O.
2023-10-15 22:10:49 +02:00
Robert Müller 2dcec6496f Use std::vector for jobpool threads
To simplify the usage and to support an arbitrary number of threads.
2023-10-15 22:00:25 +02:00
Robert Müller 97c1046104 Add assertions to ensure that thread_init is successful
Ensure that `pthread_create`/`CreateThread` are successful.
2023-10-15 21:59:42 +02:00
Robert Müller 9cbbc0aca6 Replace static variables in MouseRelative with member variable
Avoid using a global variable for last mouse position on Android.
2023-10-15 20:36:59 +02:00
Robert Müller 1a83a17db8 Fix client crash on player info snapshot item with invalid ID
The player info snapshot item (`CNetObj_PlayerInfo`) has its own `m_ClientID` member variable in addition to the generic snapshot item ID. The snapshot item ID was only used to set `m_Snap.m_LocalClientID` but without being checked for invalid values. Now it is checked that both IDs are identical and only `m_ClientID` is used consistently.
2023-10-15 17:06:12 +02:00
Robert Müller 60bb48c725 Fix map version checks in map_diff and map_extract tools
The map version was only checked if the version item is present, which is different from how client and editor load maps. Now a missing version item is considered an unsupported version. Additional log messages are also added to the tools.
2023-10-14 17:03:48 +02:00
Dennis Felsing 46c7229a22
Merge pull request #7345 from Robyt3/Tests-Swap-Endian
Add tests and documentation for `swap_endian` function
2023-10-14 12:02:30 +00:00
Robert Müller d9a7df0f92 Add tests and documentation for swap_endian function 2023-10-14 13:29:24 +02:00
Robert Müller d00283e885 Enable use of video recording for each demo player individually
Previously all demo players checked `IVideo::Current` to render a video, which would cause issues when rendering a demo while a demo slicing background job is running. Now video rendering can be toggled for each demo player individually and is only enabled for the main demo player.
2023-10-14 10:52:24 +02:00
Robert Müller 668e6fb14e Use member variables for demo player snapshot data
Use member instead of static variables for demo player snapshot data. The static variables would otherwise cause issues when multiple demo players are playing at the same time, especially demo players used in background jobs for replay demo slicing. This hopefully closes #7068.
2023-10-14 10:51:45 +02:00
Dennis Felsing 90466689d3
Merge pull request #7343 from Robyt3/Engine-Demo-Editor-Type-Preservation
Preserve demo type when slicing
2023-10-13 21:58:20 +00:00
Robert Müller 3af7de307a Preserve demo type when slicing
Previously all sliced demos used type "client", even if the original demo had type "server". Now the type of the original demo is copied when slicing.
2023-10-13 22:11:49 +02:00
Robert Müller 172f316a40 Disable demo slice button while demo is being rendered
There is no reason to slice a demo while currently rendering it and it may cause issues because multiple demo players would access the same `IVideo` instance.
2023-10-13 22:06:17 +02:00
Robert Müller 9030c5b155 Refactor CDemoEditor, fix clang-tidy NOLINT
Use composition instead of inheritance for demo player listener to avoid temporarily storing a pointer to a local variable in a member variable.

Fix demo player file not being closed when demo recorder file cannot be opened during demo slicing.
2023-10-13 20:46:08 +02:00
Robert Müller a0b708a0b2 Assert that demo recording/playback are properly started/stopped
Add assertions to check that demo recording/playback is not started when already running.

Add assertions to check that demo recording/playback is stopped before the respective demo recorder/player is destroyed.
2023-10-13 20:45:22 +02:00
Robert Müller 543e63ee71 Use IO_MAX_PATH_LENGTH for demo recorder/player filenames 2023-10-13 20:45:07 +02:00
Robert Müller 7a624d7911 Ensure demo player listener is initialized
Using `SetListener` is optional.
2023-10-13 20:02:13 +02:00
Robert Müller a19c51f545 Remove unused CHUNKFLAG_BIGSIZE 2023-10-13 20:02:13 +02:00
Robert Müller aeb1530966 Improve layout of demo render popup on 5:4 resolutions 2023-10-12 19:20:12 +02:00
Dennis Felsing 01958378f1
Merge pull request #7336 from Robyt3/Demo-Render-Popup-Android
Remove Android-specific layout code for demo render popup
2023-10-11 21:54:21 +00:00
dobrykafe ee115bf824 dont go below default zoom 2023-10-11 21:08:37 +02:00
Robert Müller 1dfdd752f8 Remove Android-specific layout code for demo render popup
The filename editbox and buttons of the demo render popup were rendered excessively large on Android. While too small buttons could be an issue with smaller screens, this should not be implemented solely this popup, if Android support is revived in the future, as it makes the UI layout code harder to maintain.
2023-10-11 18:20:11 +02:00
heinrich5991 5fbf02ae91
Merge pull request #7333 from Robyt3/Clang-Tidy-Remove-Nolint
Remove obsolete clang-tidy `NOLINT` comments
2023-10-11 15:49:46 +00:00
Robert Müller aa03aa0f60 Remove obsolete clang-tidy NOLINT comments
The TODO in the `Dilate` function is removed, as the code already appears to be safe without additional checks. The variable `k` is at most `(w * h - 1) * BPP`, as `ix` and `iy` are clamped to maximum `w - 1` and `h - 1` respectively. Because `p < BPP - 1` the index `k + p` is therefore always valid for the buffers. (The caller must ensure that the source and destination buffers are of size `w * h * BPP`.)
2023-10-11 17:22:59 +02:00
Dennis Felsing 60fa51ff13
Merge pull request #7309 from infclass/kaffeine/merge-client-data-structs
Extract client 'six' data types and use them for 'seven' data
2023-10-10 21:55:55 +00:00
Zwelf 1d6771ea9d Fix save_dry command 2023-10-09 16:36:40 +02:00
Zwelf 9be7ad554d Save/load ninja
Add ninja state to save string. Previously ninja was lost during load.
2023-10-09 11:11:55 +02:00
Dennis Felsing 1fb0235f4b
Merge pull request #7327 from furo321/correct-max-length
Show correct max length in help text for `MACRO_CONFIG_STR`
2023-10-09 06:52:43 +00:00
furo f39792f330 Show correct max length in help text for MACRO_CONFIG_STR 2023-10-09 00:53:28 +02:00
Dennis Felsing cc62d958c6
Merge pull request #7253 from JSaurusRex/midTickAim
firing/hooking takes aim when action happened not when tick
2023-10-08 21:29:34 +00:00
JSaurusRex 3c7ad1490b done requested code changes 2023-10-08 17:31:43 +02:00
Robert Müller 34b91fc63c
Merge pull request #7326 from def-/pr-notif
Make sure notification object exists
2023-10-08 12:39:50 +00:00
Dennis Felsing 1f5a764cf5 Make sure notification object exists 2023-10-08 14:01:02 +02:00
Dennis Felsing 1130ebc3b7
Merge pull request #7324 from furo321/solo-kill-team
Don't announce team killed if it's a solo server.
2023-10-08 11:38:26 +00:00
furo 703db2c124 Don't announce team killed if it's a solo server. 2023-10-08 13:06:39 +02:00
Dennis Felsing f7d23844db
Merge pull request #7322 from Robyt3/Editor-External-Image-Name-Fix
Fix names of external images not being loaded in editor
2023-10-08 10:59:53 +00:00
Dennis Felsing dc57cc38c4
Merge pull request #7323 from furo321/move-background-setting
Move "Regular background color" setting to background
2023-10-08 10:59:34 +00:00
furo 88e1988d96 Move "Regular background color" setting to background
Fixed capitalization (only captialize first letter)
2023-10-08 12:26:03 +02:00
Robert Müller 97ae362bd6 Fix names of external images not being loaded in editor
The entire `CEditorImage` was being overwritten when loading external images, which was causing the already loaded image name to be cleared, due to the changed order of operations (regression from #7008). This is fixed by using `CImageInfo` to load the image and only copying the relevant members to the `CEditorImage`.
2023-10-08 11:38:13 +02:00
Robert Müller d4fed2360e
Merge pull request #7208 from dobrykafe/pr-editor-toolbar-sounds
Enhance editor toolbar sounds
2023-10-08 09:06:15 +00:00
Dennis Felsing e4ccd79851
Merge pull request #7318 from furo321/editor-mode-icons
Use icons for editor mode switching.
2023-10-08 08:17:07 +00:00
furo e1979d9c9b Use icons for editor mode switching.
Make the icons bigger.

Make it the same size as "group"
2023-10-08 01:17:20 +02:00
Dennis Felsing 454194489b
Merge pull request #7319 from furo321/reset-zoom-on-change
Reset zoom when adjusting default zoom in settings
2023-10-07 22:09:43 +00:00
Dennis Felsing 7034ca84ec
Merge pull request #7314 from furo321/keep-practice
Don't disable practice on death.
2023-10-07 21:28:28 +00:00
furo 8c9597667a Reset zoom when adjusting default zoom in settings 2023-10-07 23:24:36 +02:00
dobrykafe 0838fd9d04 fix requested changes 2023-10-07 15:52:36 +02:00
dobrykafe fc23f451b2 show clanmates in different color 2023-10-07 15:05:36 +02:00
dobrykafe 8adbbc433c fix requested changes 2023-10-07 14:49:51 +02:00
Robert Müller 093edb7803
Merge pull request #7308 from Marmare314/add-editor-object
Add `CEditorObject` class
2023-10-07 10:26:28 +00:00
furo d4ec8cf8b4 Don't disable practice on death. 2023-10-07 09:34:20 +02:00
marmare314 719b2bdadd add editor object class
This class is slightly more light-weight than a CEditorComponent
and its naming makes it more natural to inherit for envelope points,
proof-mode positions etc.
2023-10-07 00:46:47 +02:00
Robert Müller 076a902684 Overhaul demo browser UI
Improve layout of demo browser buttons, search and checkbox. Use icons for most buttons. Decrease size of UI elements.

Move demo details from below the file browser to a side panel on the right, which is the same size as the server browser side panel. Use ellipsis to truncate the SHA256 instead of rendering only half of it with reduced font size. Show "map not included" instead of "0.00 KiB" for the map size of demos that don't include a map.

Remove the "Markers" column, as it is not very useful to see for all demos and sort by.

Closes #7275.
2023-10-06 21:46:13 +02:00
JSaurusRex 03fad41def let fix_style.py do its course 2023-10-06 21:23:39 +02:00
Robert Müller 706f021f68 Add CUIRect::Margin with vec2 argument
To more conveniently create different margins in horizontal and vertical directions at the same time.
2023-10-06 18:08:03 +02:00
Alexander Akulich b6470e5a43 Use client 'six' data structs for client 'seven' data 2023-10-06 18:14:38 +03:00
dobrykafe 5b609c8e06 extract CEditor::DoAudioPreview, also use in file dialog 2023-10-06 17:10:43 +02:00
dobrykafe 6e2ddfbeaf use nullptr instead of 0, add missing return statement 2023-10-06 17:09:20 +02:00
dobrykafe ca517f27b8 enhance editor toolbar sounds 2023-10-06 17:09:19 +02:00
Robert Müller 5a10ef049a Fix clang-tidy readability-static-accessed-through-instance
The crash that was occurring with this check was fixed in clang 15.
2023-10-06 14:07:02 +02:00
Robert Müller 4e31052821 Fix clang-tidy clang-analyzer-deadcode.DeadStores 2023-10-06 14:06:55 +02:00
Robert Müller fb7669ebb0 Fix clang-tidy modernize-use-override 2023-10-06 14:06:52 +02:00
Robert Müller 05ddf4a081 Fix clang-tidy performance-no-automatic-move 2023-10-06 14:06:47 +02:00
Robert Müller 59f4ae06d0 Fix clang-tidy clang-analyzer-optin.portability.UnixAPI
Assumes that `argc` is `0`, which is impossible.
2023-10-06 14:06:30 +02:00
Robert Müller 63a7063242 Fix clang-tidy readability-container-data-pointer 2023-10-06 14:06:27 +02:00
Robert Müller b81fb37f82 Fix clang-tidy modernize-use-emplace 2023-10-06 14:06:20 +02:00
Robert Müller 48a92f1eac
Merge pull request #7303 from Marmare314/refactor-env-editor
Refactor `CEnvelope` class
2023-10-06 11:29:08 +00:00
Dennis Felsing bdcf3e67f7
Merge pull request #7306 from Marmare314/component-single-member
store only pointer to editor in CEditorComponent
2023-10-06 11:25:16 +00:00
marmare314 73914b3cae store only pointer to editor in CEditorComponent 2023-10-06 12:46:56 +02:00
marmare314 c2adfc5628 make CEnvelope::m_PointsAccess private 2023-10-06 11:39:26 +02:00
marmare314 855ae8885c make CEnvelope::Resort private 2023-10-06 11:39:26 +02:00
marmare314 95528ca0b9 refactor CEnvelope::FindTopBottom
- rename to GetValueRange
- return pair of floats instead of storing them as members
2023-10-06 11:39:26 +02:00
marmare314 283226ef59 init member variables of CEnvelope on declaration 2023-10-06 11:39:26 +02:00
marmare314 08b825439e use type enum in CEnvelope 2023-10-06 11:39:22 +02:00
marmare314 073f208808 split implementations from CEnvelope class 2023-10-06 00:32:12 +02:00
Dennis Felsing 74383124da
Merge pull request #7301 from Robyt3/Demo-Browser-Search-Improvement
Fix selected demo index being desynced with selected demo name
2023-10-05 21:45:29 +00:00
marmare314 1bd3e65c2a extract CEnvelope into seperate header 2023-10-05 22:42:24 +02:00
Robert Müller a42ca9f638 Fix leak of command line arguments on Windows
See https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw#remarks
2023-10-05 22:37:12 +02:00
marmare314 1ccb83b2ae make IEnvelopePointAccess destructor virtual 2023-10-05 22:34:51 +02:00
Robert Müller c0b8bf313c Fix selected demo index being desynced with selected demo name
When using the demo filter and the selected demo name does not match any visible demo item, temporarily reset the selected demo index instead of keeping an incorrect demo index. This makes the behavior consistent with the server browser.
2023-10-05 21:29:34 +02:00
Robert Müller 48ba1f463a Ensure CDemoItem member variables are initialized
The variable `m_Valid` was not initialized in all cases.
2023-10-05 21:29:33 +02:00
JSaurusRex f1dd707c46 fixed clang formatting error 2023-10-05 20:10:52 +02:00
Dennis Felsing 2b115b92fa
Merge pull request #7300 from Robyt3/Demo-Render-Dialog-Fixes
Fix demo render complete popup opening on error, improve layout
2023-10-05 11:45:39 +00:00
Dennis Felsing d1cd0aeb20
Merge pull request #7287 from Marmare314/string-tooltip
store editor tooltip in optional string
2023-10-05 10:01:01 +00:00
Robert Müller 39057d7b87 Fix demo render complete popup opening on error, improve layout
The popup to show the completed demo rendering was also shown when the demo to be rendered could not be loaded or if the demo render popup was cancelled. Now the popup is only shown when the demo rendering was successful.

The layout of the popup is made consistent with other message popups. Long text is wrapped over multiple lines instead of decreasing the font size.
2023-10-05 11:58:48 +02:00
marmare314 25da78a00e store editor tooltip in optional string 2023-10-04 23:48:14 +02:00
Dennis Felsing b7de3d1e22
Merge pull request #7295 from Learath2/pr_fixfixfix
Vanilla tunings should be used for reckoning
2023-10-04 16:19:10 +00:00
Dennis Felsing a07679d33a
Merge pull request #6990 from Marmare314/project-onto
implement project-onto operation for envelopes
2023-10-04 14:30:01 +00:00
Edgar f5f57ee24c
Merge pull request #7283 from Robyt3/ImageLoader-Indexed-Fix
Fix images using indexed color palette not being loadable
2023-10-04 13:55:21 +00:00
Learath f865679cb4 Vanilla tunings should be used for reckoning 2023-10-04 15:21:10 +02:00
JSaurusRex 922a167c65 disable by default 2023-10-03 23:04:56 +02:00
Dennis Felsing 2e5ee8287e
Merge pull request #7008 from Robyt3/Datafile-String-Util
Add functions for reading/writing strings from/to datafile, minor refactoring of datafile/map reader
2023-10-03 20:54:40 +00:00
Dennis Felsing fb3c32a31f
Merge pull request #7292 from Robyt3/Client-Encapsulation
Encapsulate/move `IClient` member variables
2023-10-03 20:53:33 +00:00
Dennis Felsing 1c88adf4fd
Merge pull request #7294 from furo321/angle-paused
Don't use mouse position for angle if paused.
2023-10-03 20:53:11 +00:00
hardliner66 6c94e84e29 make sub-tick-aiming configurable 2023-10-03 21:08:03 +02:00
furo a08e306aa4 Don't use "direct input" if paused. 2023-10-03 20:59:12 +02:00
Learath 3f8ca70eb3 Fix the fix to the fix to dead reckoning 2023-10-03 20:18:17 +02:00
hardliner66 6532d1be6f fix mouse position for hook/shots 2023-10-03 19:27:53 +02:00
Robert Müller 6f1e08b6f4 Encapsulate/move IClient member variables 2023-10-03 17:56:17 +02:00
Robert Müller 7acf2c1573 Add functions for reading/writing strings from/to datafile
Simplify the usage of datafile reader and writer by adding utility functions to read and write zero-terminated UTF-8 strings.

Improve validation of string data read from datafiles. It is ensure that string data is null-terminated, has no internal NUL-characters and is valid UTF-8.

Fix loading of external sounds in the editor. The wrong path variable was being used, so the sound files would not be loaded from correct folder.

Add tests for new datafile reader/writer functions.
2023-10-03 16:07:15 +02:00
Robert Müller 106b04ee79 Add assertion for Index argument of ReplaceData function 2023-10-03 15:58:58 +02:00
Robert Müller 4716791c6d Add missing IMap::FindItemIndex delegate function 2023-10-03 15:58:58 +02:00
Robert Müller 6a5752d71e Use bool instead of int for Swap parameter 2023-10-03 15:58:58 +02:00
Robert Müller e68caafc07 Consistently order CDataFileReader and IMap functions 2023-10-03 15:58:58 +02:00
Dennis Felsing dbd9da3c7b
Merge pull request #7289 from Robyt3/Map-Version-Check
Ensure current map is not corrupted when loading another fails
2023-10-03 13:17:03 +00:00
Dennis Felsing 1a8e8f4638
Merge pull request #7291 from Robyt3/Dilate-PixelSize-Cleanup
Remove redundant argument of `Dilate` function
2023-10-03 12:28:41 +00:00
Robert Müller 9096b089b9 Ensure current map is not corrupted when loading another fails
When `IMap::Load` fails, other components will continue to use the old map. However, if `IMap::Load` failed after the map was already successfully read with the datafile reader then other components kept their pointers to the old, invalid datafile reader items and data, causing random crashes in collision code. This is fixed by using a separate datafile reader to read the new map and only applying the datafile reader globally when loading was entirely successfully.

An error message is added for the case that a map has an unsupported version, which is currently the only case where a map can fail to load after the datafile was read successfully.

In particular, the block maps `blmapPepe`, `blmapV5` and `blmapDT-UPTU` did not have a version map item and were fixed separately.

Closes #7218. Regression from #5737.
2023-10-03 14:27:11 +02:00
Robert Müller 2d56676f17 Improve editor map version check, reduce code indentation
Add error message in editor when loading a map that has an unsupported version.

Ensure error messages are not closed immediately when loading a map fails.

Remove unnecessary indentation by returning early.
2023-10-03 14:27:09 +02:00
Dennis Felsing c15dfb8bd9
Merge pull request #7290 from ChillerDragon/pr_quote_team_name
Teeworlds style name quoting for team joins
2023-10-03 11:55:37 +00:00
Robert Müller b7e1e61988 Remove redundant argument of Dilate function
The pixel size (bytes per pixel) always has to be 4 for the `Dilate` function to work correctly. This is already checked before calling the function, so the redundant argument which is always `4` can be removed.
2023-10-03 13:52:37 +02:00
ChillerDragon 42e5f27ee9 Teeworlds style name quoting for team joins 2023-10-03 13:16:27 +02:00
marmare314 227d074254 implement project-onto operation for envelopes 2023-10-02 23:45:08 +02:00
marmare314 ac6f6bd28e take pointer to editor in CLayer constructor 2023-10-02 23:15:31 +02:00
marmare314 d400687876 extract editor layers into seperate headers 2023-10-02 23:07:08 +02:00
Dennis Felsing 78b70ebcf8
Merge pull request #7282 from furo321/tele-cursor
Teleport the player to their cursor if they aren't in pause
2023-10-02 16:12:00 +00:00
Robert Müller 589b047ee4 Track team killmessage victims separately, ensure initialization
Store client IDs of all victims for team killmessages instead of storing only the first victim ID, so the render info for all victims can be properly restored when skins are updated.

Ensure all killmessages are properly initialized.
2023-10-02 15:39:12 +02:00
Robert Müller 96ef1fbc88 Fix client render info not being updated when skin not found
The skin info was always updated, but the render info was only being updated for skins that can be found. Now the render info is also always updated.
2023-10-02 15:37:49 +02:00
Robert Müller 6094061a81 Add CTeeRenderInfo::Reset, ensure everything is initialized 2023-10-02 15:37:30 +02:00
Robert Müller e41b3a9b57 Use bool instead of int for m_GotAirJump 2023-10-02 15:37:26 +02:00
Robert Müller 1dedde542a Refactor ghost skin updating, ensure current ghost is updated
Rename function for consistency.
2023-10-02 15:35:12 +02:00
Robert Müller 9029fb9593 Remove CTeeRenderInfo member variables of CPlayers
The variables can be local variables in `CPlayers::OnRender`.
2023-10-02 15:34:39 +02:00
furo 7e045d4f32 Teleport the player to their cursor if no argument is specified.
Check for `NumArguments()`
2023-10-02 13:26:34 +02:00
Robert Müller dab88177dd Fix images using indexed color palette not being loadable
The wrong color channel count was being used for loading images that use an indexed color palette, which was causing the loading to fail with the error "bytes in row incorrect". Now the correct color channel count is retrieved using the libpng API.

Closes #7157.
2023-10-02 12:21:20 +02:00
Dennis Felsing fe77f63a58
Merge pull request #7278 from Robyt3/Menus-Images-Scan-Refactoring
Refactor menu image scan
2023-10-01 22:22:24 +00:00
Dennis Felsing 887522ea5b
Merge pull request #7279 from Robyt3/Menus-Performance
Improve performance of menus checker background, improve server browser performance
2023-10-01 22:21:58 +00:00
Dennis Felsing 624f4aef21
Merge pull request #7280 from furo321/move-lasttelepos
Don't reset `/lasttp` position on death
2023-10-01 22:21:34 +00:00
Dennis Felsing 879a88933c
Merge pull request #7277 from furo321/send-ping-menu
Send the player's latency if a menu is open
2023-10-01 22:19:50 +00:00
Robert Müller fa07f64982 Improve performance of menus checker background, refactoring
Avoid duplicate `SetColor` calls in loop.

Avoid `QuadsDrawTL` calls by batching quads together before drawing.

Use `SetColor` instead of `SetColorVertex`.
2023-10-01 21:01:10 +02:00
Robert Müller b1d90aaaf2 Store number of filtered players when filtering
Only update total number of filtered players when the filter is updated instead of calculating it every frame.
2023-10-01 20:53:29 +02:00
Robert Müller fe27752d40 Refactor menu image scan
Remove unnecessary check for duplicate menu images. Listing directories with the storage now prevents duplicates, so this additional check is not needed anymore.

Ensure menu images are in RGBA format.

Ensure menu image names are not truncated.

Minor code format improvements.
2023-10-01 19:39:04 +02:00
furo 6dd43fb086 Don't reset LastTelePos on death 2023-10-01 18:34:07 +02:00
furo 0661eafb49 Send the player's latency if a menu is open 2023-10-01 17:32:51 +02:00
Robert Müller 7743981e02
Merge pull request #7273 from Marmare314/quad-selection-iv
revert quad selection correctly fixes #7248
2023-10-01 09:51:24 +00:00
furo f55086f2bf Use m_aInputData for dummy in cl_show_direction 2023-10-01 01:14:35 +02:00
marmare314 a7748ba87e revert quad selection correctly fixes #7248 2023-09-30 23:43:21 +02:00
Dennis Felsing e0d906d9e1
Merge pull request #7272 from furo321/afk-optional2
Don't run `GET_INT` on afk attribute in `ProcessServerInfo`
2023-09-30 20:43:37 +00:00
furo a3064ae105 Don't run GET_INT on afk attribute in ProcessServerInfo 2023-09-30 20:51:20 +02:00
Dennis Felsing c8401aa38f
Merge pull request #7271 from furo321/afk-optional
Make IsAfk attribute optional
2023-09-30 18:22:09 +00:00
Dennis Felsing 49a5a591d7
Merge pull request #7269 from Robyt3/Serverbrowser-Favorite-Resort-Fix
Fix large FPS drop rendering server details of favorite server
2023-09-30 18:15:50 +00:00
furo 3b2389daa4 Make IsAfk attribute optional 2023-09-30 19:56:01 +02:00
Robert Müller d55822bc4f
Merge pull request #7270 from furo321/editor-export-sound
Add export button to sounds
2023-09-30 16:10:20 +00:00
furo f07e7fef76 Add export button to sounds 2023-09-30 17:28:47 +02:00
Robert Müller 0025b6c1f3 Fix large FPS drop rendering server details of favorite server
The server list was being resorted every frame when the server details of a favorite server were being rendered, which was causing the FPS to drop by a factor of 5.
2023-09-30 15:48:10 +02:00
Dennis Felsing c731d5345f
Merge pull request #7087 from ChillerDragon/pr_streamer_mode
Add streamer mode to avoid leaks
2023-09-30 13:34:32 +00:00
ChillerDragon ca8d9d4f18 Add streamer mode to avoid leaks 2023-09-30 15:10:44 +02:00
Robert Müller cf35594fa4 Extract UpdateServerFriends function, cache friends on server
Calculate the number of friends on each server when refreshing the friend state of the server info instead of every time the server entry is rendered.
2023-09-30 13:32:36 +02:00
Robert Müller 7e8442d394 Move and rename UpdateFilteredPlayers function, mark as const 2023-09-30 13:29:28 +02:00
Robert Müller 28d4451057 Add local variable Info to reduce duplicate code 2023-09-30 13:29:28 +02:00
Robert Müller 034962ae24 Add enum ERankState to replace magic numbers 2023-09-30 13:29:28 +02:00
Robert Müller dcff6d92f0 Add name for enum EClientScoreKind 2023-09-30 13:29:28 +02:00
Robert Müller 721a55c603 Remove game menus includes in engine
Use config manager to reset `ui_page` to the default, instead of using `CMenus::PAGE_DDNET` directly (which is the default).

Check current type of serverbrowser instead of checking the current `ui_page` against `CMenus::PAGE_DDNET` and `CMenus::PAGE_KOG`.
2023-09-30 13:29:28 +02:00
Robert Müller 6753e37772 Move function definitions to remove and organize includes 2023-09-30 13:29:27 +02:00
Robert Müller e78305e1cd Remove unused m_aFilter(Gametype)String variables 2023-09-30 13:29:27 +02:00
Dennis Felsing 359d9ab00b
Merge pull request #7176 from Marmare314/export-image
add export image button
2023-09-30 11:01:26 +00:00
Dennis Felsing 1452b36dc0
Merge pull request #7172 from furo321/render-done-popup
Add a popup for when video render is done
2023-09-30 09:38:01 +00:00
Dennis Felsing 3e2893e638
Merge pull request #7182 from dobrykafe/pr-show-direction
Ability to show local keypresses only
2023-09-30 09:35:20 +00:00
Dennis Felsing aacfc9a357
Merge pull request #7241 from Robyt3/UI-LabelStreamed-HighlightedFix
Fix mangled highlighted text in server browser
2023-09-30 09:24:58 +00:00
Learath fcffac6fa8 Fix the fix to dead reckoning 2023-09-30 01:29:33 +02:00
Steinchen99 7b58b77c5e QoL ; Made it so f2 cmd 'tele' resets speed and unfreezes the tee upon teleporting 2023-09-29 14:53:24 +02:00
Robert Müller c64ec0f677 Limit effects of dbg_stress to features useful for debugging
Using `dbg_stress 1` now only does the following (in debug build):

- Randomly send inputs.
- Randomly send chat messages.
- Randomly connect/disconnect to server configured with `dbg_stress_server` (`localhost` by default).

Previously it also did the following, which is not useful for this debugging feature and only complicates the code unnecessarily:

- Cause images and sounds not to be loaded.
- Render only every tenth frame.
- Always use inactive graphics refresh rate.
2023-09-28 20:14:54 +02:00
Robert Müller 06948ddecd Remove remains of dbg_stress from server
Using `dbg_stress 1` on a server made clients always auto-join team 0 and nothing else, which is not useful on its own for stress testing.
2023-09-28 20:14:23 +02:00
Robert Müller 247ce38094 Remove unused variables m_RenderFrameTimeLow/High 2023-09-28 20:12:55 +02:00
Dennis Felsing 6a030e1a2b
Merge pull request #7262 from furo321/expire-server-info-afk
Expire server info when changing `m_Afk`
2023-09-27 10:44:55 +00:00
Dennis Felsing 5b3738dc17
Merge pull request #7261 from furo321/demo-show-pred
Don't show cl_showpred in demos
2023-09-27 10:31:36 +00:00
furo 4f0552a8df Expire server info when changing m_Afk 2023-09-27 12:12:12 +02:00
furo 23477584d1 Don't show cl_showpred in demos 2023-09-27 11:31:53 +02:00
Robert Müller 74192b9051 Add CSnapshot::EmptySnapshot, mark pointer arguments as const
Instead of keeping track of a permanently empty `CSnapshot` object in client and server separately, add `CSnapshot::EmptySnapshot` to access a singleton empty `CSnapshot`.

Mark pointer parameters of snapshot functions as `const` when possible.
2023-09-26 20:13:27 +02:00
Dennis Felsing 875c51e28f
Merge pull request #7257 from furo321/votes-command
Add votes command to rcon
2023-09-26 11:45:32 +00:00
furo eabe59b413 Change format of votes 2023-09-26 12:13:49 +02:00
furo d165f9e8a9 Add votes command to rcon 2023-09-26 02:24:00 +02:00
Jupeyy 958676ae84
Merge pull request #7251 from Robyt3/Graphics-Texture-Index-DoubleFree-Assertion
Add assertion when double-freeing texture index, ensure OpenGL texture vectors are large enough
2023-09-25 18:51:04 +00:00
heinrich5991 296d141c0e
Merge pull request #7254 from Robyt3/Windows-File-Buffering
Use `FILE *` on Windows again, only use `HANDLE` for opening
2023-09-25 17:41:47 +00:00
Robert Müller 8ebe3c1b35 Use FILE * on Windows again, only use HANDLE for opening
This mostly reverts #6937 by making our `IOHANDLE` effectively `FILE *` on all systems again. We still use `CreateFileW` to open a `HANDLE` initially so we can specify the necessary flag so the file can be moved/deleted while open, which we can't do with the `FILE *` based `fopen` functions on Windows. This brings back the automatic I/O buffering on Windows, causing significantly less system calls when saving files. Closes #7226.
2023-09-25 18:24:48 +02:00
furo 25101d2cb0 Add missing descriptions of commands. 2023-09-24 23:21:10 +02:00
Robert Müller 96a68455ca Ensure OpenGL texture vectors are large enough
In the unlikely case that the wanted texture slot is larger than twice the size of the original texture vector.
2023-09-24 22:27:16 +02:00
Robert Müller 99cee23de4 Add assertion when double-freeing texture index
Simplify the handling of free texture indices by using `-1` only for indices which are currently in use, whereas the size of the vector is now used to indicate the last free index. Otherwise the assertions incorrectly detect the last texture index always being in use because `-1` was used for both states.
2023-09-24 22:24:51 +02:00
Dennis Felsing 60046c7e18
Merge pull request #7247 from Learath2/pr_reckon
Fix dead reckoning
2023-09-24 18:38:53 +00:00
Dennis Felsing 708b263766
Merge pull request #7249 from Robyt3/Gameclient-ConfigManager-Getter
Add `IConfigManager` getter to `CGameClient` and `CComponent`
2023-09-24 18:38:29 +00:00
Dennis Felsing bca21dc640
Merge pull request #7250 from Robyt3/Cleanup-Background-Foreground-Names
Rename variables containing `ForeGround` and `BackGround`
2023-09-24 18:38:15 +00:00
Robert Müller 2a17d1b8ac Rename variables containing ForeGround and BackGround
To `Foreground` and `Background` respectively.
2023-09-24 20:01:36 +02:00
Robert Müller 003d96e1c8 Add IConfigManager getter to CGameClient and CComponent 2023-09-24 19:55:20 +02:00
Robert Müller 9933c1350d
Merge pull request #7246 from furo321/register_conchain
Configs used in Register OnConfigChange should have Conchain
2023-09-24 17:54:31 +00:00
Learath ecaded8cce Fix dead reckoning 2023-09-24 18:14:09 +02:00
furo 4476dfacde Configs used in OnConfigChange should trigger Conchain 2023-09-24 15:31:43 +02:00
Dennis Felsing bcb84d612e
Merge pull request #7245 from furo321/freeview-radius
Increase freeview radius to kill tile border
2023-09-24 06:58:05 +00:00
furo e93325b141 Increase freeview radius to kill tile border 2023-09-24 01:19:50 +02:00
Dennis Felsing 5d220e337c
Merge pull request #7244 from furo321/suicide-penalty
Remove unused config, `sv_suicide_penalty`
2023-09-23 22:17:43 +00:00
furo 436c977f7e Remove unused config, sv_suicide_penalty 2023-09-23 23:51:16 +02:00
Robert Müller 2d4bac8c0c Ensure strings in demo header are zero-terminated and valid UTF-8
Previously, if the demo header strings did not contain zero-termination, the client would render the strings and any following non-zero memory from the demo header.

Now, demos will not be loaded, if any string in the header is not zero-terminated or not valid UTF-8.
2023-09-23 22:14:34 +02:00
Robert Müller 95675a97ad Fix mangled highlighted text in server browser
Refresh UI label text containers when the glyph count of the read-cursor has changed.

Regression from #7203.
2023-09-23 16:34:13 +02:00
Dennis Felsing cc67723beb
Merge pull request #7239 from furo321/editor-zoom-envelope
Add numpad shortcuts and button for zooming in envelope editor
2023-09-23 13:51:27 +00:00
Dennis Felsing 1193361f1c Version 17.3 2023-09-23 15:28:55 +02:00
furo 57ad88d6ee Add numpad shortcuts and button for zooming in envelope editor 2023-09-23 14:45:56 +02:00
Robert Müller 25b110c153
Merge pull request #7236 from furo321/add-is-process-alive
Detect if server started from client is no longer running
2023-09-23 08:50:39 +00:00
VoxelDoesCode c4d325e09b Show if your friend is AFK through friends list
resolve mege conflict

AFK -> Afk (for consistency)
2023-09-23 00:54:13 +02:00
furo 3da0b34444 Don't close handle if TerminateProcess failed 2023-09-22 23:15:53 +02:00
furo 1a36743185 kill_process return true if process doesn't exist 2023-09-22 22:18:20 +02:00
Robert Müller 1d711d6cf0 Correctly update auth keys when using auth_remove
When using `auth_remove`, the key indices for the default helper, mod and admin passwords were not properly adjusted, causing the wrong passwords to be used for the username-less logins.

The key indices for connected clients were also not properly adjusted, causing the wrong identity to be shown for currently authenticated clients when using the `status` command.

Closes #6427.
2023-09-22 21:12:20 +02:00
furo 367f06a7f9 Detect if server started from client is no longer running
Add function to check if a process is alive.

Fix requsted changes
2023-09-22 20:17:40 +02:00
Dennis Felsing c042835c1d
Merge pull request #7234 from Robyt3/Input-PumpEvents
Fix double-click handling with `gfx_asyncrender_old 0`
2023-09-22 15:38:17 +00:00
Robert Müller 98bfed7859 Fix double-click handling with gfx_asyncrender_old 0
We need to call `SDL_PumpEvents()` to ensure that we have the latest keyboard, mouse and joystick state before we use it.

See:
- https://wiki.libsdl.org/SDL2/SDL_GetKeyboardState
- https://wiki.libsdl.org/SDL3/SDL_GetMouseState#code-examples

Closes #7052.
2023-09-22 17:09:39 +02:00
Robert Müller 774d32713d
Merge pull request #7227 from furo321/swap-without-name
Add ability to swap without a name when team only has 2 players.
2023-09-22 14:33:48 +00:00
Dennis Felsing cc2bdbd0ed
Merge pull request #7232 from furo321/initial-chat-delay-message
Use a different message when muted by sv_chat_initial_delay
2023-09-22 11:06:56 +00:00
furo 5793891d91 Add a message when using sv_chat_initial_delay 2023-09-22 12:43:36 +02:00
Robert Müller b9951dd411 Refactor and reorder RateConvert, DecodeOpus, DecodeWV
Pass sample by reference instead of by index, as the functions are only used internally and a valid sample is assured.
2023-09-21 23:52:44 +02:00
Robert Müller 7fe854d861 Reduce indentation, rename variables in Mix function 2023-09-21 23:52:40 +02:00
Robert Müller 07e18ebecb Replace most global variables in engine sound with member variables
Most variables used in the sound engine were static globals, as they are used in the static sound mixing function. The global variables are replaced by member variables, by passing the sound interface as user-data for the SDL mixing callback. The `Mix` function is made a public member function of `ISound` instead of being exposed using `ISoundMixFunc GetSoundMixFunc()`.

This allows to remove the direct dependency of the engine sound on the engine video, by instead passing the sound mixing function as a lambda to the engine video in the engine client.

The old WavPack reader function interface does support passing a user-data pointer to the callback function, so global variables are still used here.
2023-09-21 23:52:13 +02:00
Robert Müller a2de08a8db Add UpdateVolume function, remove unnecessary lock usage
Using the lock is not necessary, as the volume is already an atomic variable.
2023-09-21 23:44:59 +02:00
Robert Müller beaf263f3d Reorder SetChannel and SetListenerPos functions 2023-09-21 23:44:58 +02:00
Robert Müller b0356aea13 Rename argument, reduce indentation of SetVoiceTimeOffset 2023-09-21 23:44:58 +02:00
Robert Müller f169ce1c8c Use nullptr instead of 0, 0x0 and NULL 2023-09-21 23:44:58 +02:00
furo f23e5ceb6f Correct value of TeamSize. 2023-09-21 23:15:42 +02:00
Dennis Felsing 2c8a798f3f
Merge pull request #7230 from furo321/practice-lasttp
Add /lasttp
2023-09-21 20:51:41 +00:00
furo a7ef9c7c6f Add /lasttp 2023-09-21 21:02:55 +02:00
furo 992a26c7ca Add ability to swap without a name when team only has 2 players. 2023-09-21 19:40:37 +02:00
Dennis Felsing 545852b7f1
Merge pull request #7224 from Robyt3/Demo-Hud-Intratick
Fix 1-tick delay of player position, speed, angle HUD
2023-09-20 22:45:51 +00:00
dobrykafe 7c710ddb96 add another value instead of new variable 2023-09-20 22:47:09 +02:00
Robert Müller cd37c2d5b3
Merge pull request #7223 from furo321/preview-only-friends
Chat preview respect cl_show_chat_friends
2023-09-20 19:56:21 +00:00
Robert Müller b7cbbb48be
Merge pull request #7222 from furo321/update-server-browser
Update server browser when adding friends from ingame.
2023-09-20 19:49:00 +00:00
Robert Müller ed9a95ac23 Fix 1-tick delay of player position, speed, angle HUD
Respect the intratick when displaying the player position, speed and angle, to fix this information always being shown for the next tick. See #6417. This does not resolve the issue yet, as there are more HUD and player elements that need to make use of the intratick.
2023-09-20 21:39:42 +02:00
furo 4e9556e3da Chat preview respect cl_show_chat_friends 2023-09-20 21:32:13 +02:00
Robert Müller cf0df5bc03 Use GameTickSpeed instead of 50 and SERVER_TICK_SPEED 2023-09-20 21:17:12 +02:00
furo 5a4e3b1c2d Update server browser when adding friends from ingame. 2023-09-20 18:32:34 +02:00
Dennis Felsing 4dda7949d1
Merge pull request #7221 from Robyt3/Serverbrowser-Filter-Background-Fix
Fix background color in ingame server browser filter tab
2023-09-20 16:22:46 +00:00
Robert Müller 23cb2ff8c8 Fix background color in ingame server browser filter tab
Make background color of the tab content consistent with the color of the tab bar.

Regression from #7190.
2023-09-20 17:52:42 +02:00
Dennis Felsing fb6f04e9dc
Merge pull request #7220 from Robyt3/UI-Label-Streamed-Fixes
Track UI elements separately for each server browser tab
2023-09-20 15:48:25 +00:00
Robert Müller da47ebe0b5 Track UI elements separately for each server browser tab
Fix highlighted text of server browser entries not being refresh correctly when switching tabs.

This also reduces lag when switching tabs, as the UI elements for all tabs are now cached and don't need to be recreated when switching.

Regression from #7203.
2023-09-20 17:23:34 +02:00
Robert Müller 5d4affac55 Fix text containers always being recreated for empty text
Because text containers are not created for empty text, it was being tried again every frame.
2023-09-20 17:22:16 +02:00
Robert Müller 2c7df07fd7
Merge pull request #7196 from furo321/add-optional-arguments
Add optional argument to movement commands
2023-09-20 15:04:54 +00:00
Robert Müller 61a9095fc3 Remove unused IServerBrowser::TYPE_NONE, add NUM_TYPES 2023-09-20 17:03:24 +02:00
Robert Müller 48671dc866 Remove unnecessary temporary variables 2023-09-20 17:03:24 +02:00
Dennis Felsing 60de0f191e
Merge pull request #7217 from furo321/gfx-screen-conchain
Add console chain for screen resolution commands.
2023-09-20 09:25:14 +00:00
furo 597350010f Add console chain for screen resolution commands. 2023-09-20 11:01:43 +02:00
trml b62754915a Add flag to ddnetlaser for enabling prediction, let server control starttick 2023-09-19 23:22:15 +02:00
Jupeyy fcbe429d4c Decrease descriptor pool's current size when descriptor is freed 2023-09-19 18:28:48 +02:00
Robert Müller ce65d57f2e Support dynamic list of "communities" in engine serverbrowser
Replace existing hard-coded support for two "networks" with support for a dynamic list of "communities" which are indexed by a string-ID, though right now the DDNet and KoG communities are still hard-coded. The communities now also support an arbitrary number of associated countries, types and servers. This is a refactoring to prepare for getting the list of communities dynamically from the server and removing the DDNet and KoG tabs from the serverbrowser.
2023-09-18 19:37:04 +02:00
Robert Müller 2973eee036 Refactor json parser usage in CServerInfo2::FromJsonRaw 2023-09-18 17:37:21 +02:00
Robert Müller ca1bec5bac Refactor json parser usage in CServerBrowser::LoadDDNetRanks 2023-09-18 17:37:15 +02:00
Robert Müller e82e197109 Use NUM_LOCS as static assertion for array size 2023-09-18 17:29:43 +02:00
Edgar c6f666bee2
Merge pull request #7209 from Robyt3/Server-Mutes-Maximum-Increase
Increase maximum number of mutes and vote mutes
2023-09-18 14:53:05 +00:00
Robert Müller ce8e47ee63 Increase maximum number of mutes and vote mutes 2023-09-18 16:22:51 +02:00
marmare314 3f21597b6c check if quadpoint is selected and not if quad is selected
fixes #7199 (partially?)
2023-09-18 10:24:16 +02:00
Dennis Felsing a706074c82
Merge pull request #7203 from Robyt3/Serverbrowser-Memory-Leak
Fix memory leak of server browser entry UI elements
2023-09-17 20:13:01 +00:00
Robert Müller 816f1a5a01 Fix memory leak of server browser entry UI elements
New UI elements were being created for every server info after refreshing the server list. At the same time, old UI elements were not being deleted when the server info objects are deleted. The use of `mutable` for this purpose was also rather unclean.

Now, a separate `std::vector` of UI elements is kept for all server browser entries, instead of associating the UI elements directly with the server info.
2023-09-17 21:37:36 +02:00
Robert Müller 8dfa0b2198 Rename UpdateFilteredPlayers, remove mutable variable 2023-09-17 21:37:32 +02:00
Robert Müller ca308cccd8
Merge pull request #7195 from def-/pr-password-128
Increase password size limit from 32 to 128
2023-09-17 15:56:11 +00:00
furo 107af9c902 Add optional argument tiles to movement commands
Add optional argument to movement and console page commands

Remove optional argument to console page commands
2023-09-17 17:19:40 +02:00
Dennis Felsing 971fa6d024
Merge pull request #7186 from infclass/for-ddnet2
CMake: Revert versioning (move it back to version.h)
2023-09-17 14:51:47 +00:00
Dennis Felsing e33b747a4c Increase password size limit from 32 to 128 2023-09-17 14:32:23 +02:00
Dennis Felsing de8d373215
Merge pull request #7194 from furo321/fix-swap
Fix everyones swap getting reset when someone swaps
2023-09-17 12:29:11 +00:00
furo 77840a9c97 Fix everyones swap getting reset when someone swaps 2023-09-17 13:49:52 +02:00
Dennis Felsing a598831361
Merge pull request #7190 from Robyt3/Browser-Layout-Overhaul
Overhaul server browser filter, details and friends tabs
2023-09-16 22:17:38 +00:00
furo 67e753bd6b Don't include .demo in demo slice input 2023-09-16 22:09:26 +02:00
Robert Müller 0b57d56f48 Overhaul server browser filter, details and friends tabs
Move the "Filter", "Info" and "Friends" tabs to the top, above the tab content. Use icons instead of text for the tabs. Use animator to animate the tabs on mouse-over. Closes #6613.

Make spacings, corners and font sizes used in the filter, details and friends tabs more consistent.

Remove some unnecessary dark UI rect backgrounds.

Improve alignment of the number of friends with the heart icon for entries in the server list.

Improve layout of countries and types filters. Make the filters scrollable when there are many entries.

Refactor most of the server browser in preparation for replacing the DDNet and KoG tabs with a community filter, which will work like the countries and types filters. Split rendering of different server browser sections into multiple functions to improve readability. Reduce duplicate code for the countries and types filters.
2023-09-16 13:45:52 +02:00
Robert Müller 673b7facbe Remove unnecessary return value of net_init
The return value is unused and always 0, as the function fails with an assertion instead of returning an error value.
2023-09-16 13:37:53 +02:00
Robert Müller 3e548f0f66 Make listbox scrollbar width and margin adjustable 2023-09-16 13:24:19 +02:00
heinrich5991 286104cf08
Merge pull request #7181 from furo321/color-vote
Color vote if you have voted f3 or f4.
2023-09-16 10:40:15 +00:00
heinrich5991 b22956e7c6
Merge pull request #7188 from Robyt3/Server-Missing-Testing-Commands
Add `unninja`, `solo` and `deep` testing commands
2023-09-16 10:25:53 +00:00
furo b423ee59af Color text if you have voted f3 or f4
Add Sv_YourVote packet
2023-09-16 12:17:11 +02:00
Robert Müller 643a23aad3 Add unninja, solo and deep testing commands
Closes #7161.
2023-09-16 11:59:21 +02:00
Alexander Akulich 11a16f553f CMake: Revert versioning (move it back to version.h) 2023-09-16 12:48:36 +03:00
Robert Müller f42e39a9e2 Consistently name CScrollRegion and CListBox getters
Remove `Is` from the getter names for the same reason that removing `Get` from the name is preferred. The word `Is` was inconsistently used as a prefix in `CScrollRegion` but as an infix in `CListBox`.
2023-09-16 11:37:19 +02:00
Dennis Felsing 6b8997b64a
Merge pull request #7185 from furo321/editor-use-pack-functions
Use colour pack functions for editor
2023-09-15 22:37:03 +00:00
Dennis Felsing 15bdef32a1
Merge pull request #7136 from infclass/for-ddnet2
Refactor some core classes (step 1/xxx to shared CGameWorld)
2023-09-15 22:34:53 +00:00
furo 25c3e1616e Use colour pack functions for editor 2023-09-15 22:30:25 +02:00
Dennis Felsing 5e3d97f635
Merge pull request #7174 from Robyt3/Demo-Player-Skipping-Overhaul
Overhaul demo player skipping UI and UX
2023-09-15 20:12:44 +00:00
Robert Müller 350ba77a74 Minor refactoring of ingame server browser
- Remove unnecessary variable `Page`.
- Use `IGraphics::CORNER_NONE` instead of `0` and instead of the inconsistent-looking `CORNER_BR` for the KoG-button.
- Simplify UI rect layout.
2023-09-15 20:57:56 +02:00
dobrykafe 74567a1a62 ability to show local keypresses only 2023-09-15 20:34:23 +02:00