Commit graph

20018 commits

Author SHA1 Message Date
Robert Müller f94053bd66 Rename variable w to Weapon 2024-06-03 21:43:48 +02:00
Robert Müller 2904c4a2e8 Restructure input send checks without ifs 2024-06-03 21:43:48 +02:00
Andriy 950bbf31af
Make "Tee" tab name localisable 2024-06-03 22:24:31 +03:00
Robert Müller 178a0dabfa Remove dead code and unused variables 2024-06-03 20:55:39 +02:00
Robert Müller b7579b0f0f Ensure last input send time is reset when disconnecting
Reset send time when disconnecting so input sending should always behave consistently like on the first connection.
2024-06-03 20:54:57 +02:00
Robert Müller a7229e9892 Use array of size NUM_DUMMIES instead of two variables
Reduce duplicate code and improve clarity.

Remove unnecessary casts to `void *`.
2024-06-03 20:54:49 +02:00
Robert Müller 64f4ea1512
Merge pull request #7588 from ChillerDragon/pr_stop_demo_on_reset
Stop demo when gameworld is reset
2024-06-02 17:14:57 +00:00
ChillerDragon 05d97cafb2 Stop demo when gameworld is reset
Currently the per tee demos are only stopped when a character dies.
But the Reset() method in the gameworld destroys characters without
killing them.

This allows to do world resets without calling gamecontext shutdown
while sv_player_demo_record is active. Which is nice for round based
game modes.

```C++
void CGameWorld::Reset()
{
	// reset all entities
	for(auto *pEnt : m_apFirstEntityTypes)
		for(; pEnt;)
		{
			m_pNextTraverseEntity = pEnt->m_pNextTypeEntity;
			pEnt->Reset();
			pEnt = m_pNextTraverseEntity;
		}
	RemoveEntities();

	GameServer()->m_pController->OnReset();
	RemoveEntities();

	m_ResetRequested = false;

	GameServer()->CreateAllEntities(false);
}
```
2024-06-02 21:35:05 +08:00
Dennis Felsing 19b704d600
Merge pull request #8433 from Robyt3/Scoreboard-Recording-Notification-Refactoring
Fix truncated scoreboard recording notification, refactoring
2024-06-02 11:30:53 +00:00
Dennis Felsing 9986eaf6e9
Merge pull request #8435 from Robyt3/Translations-Ellipsis-Consistency
Consistently use `…` instead of `...` in translations
2024-06-02 11:28:15 +00:00
Dennis Felsing 3ba9fee8a8
Merge pull request #8430 from Robyt3/Localization-Fixes
Fix language file being loaded twice when starting, improve error handling for invalid translation files
2024-06-02 11:20:59 +00:00
Dennis Felsing da0df30497
Merge pull request #8356 from furo321/split-practice-commands
Add `/practicecmdlist`
2024-06-02 11:19:06 +00:00
Dennis Felsing bcc7412847
Merge pull request #8406 from l-ouis/master
Add confetti particles on finish
2024-06-02 11:15:16 +00:00
Robert Müller 37abc9039a Consistently use instead of ... in translations 2024-06-02 12:57:15 +02:00
Robert Müller cc7d6c393d Fix truncated scoreboard recording notification, refactoring
With some languages the buffers for the scoreboard recording notification were not large enough when recording all 4 types of demos at the same time.

Reduce duplicate code. Avoid unnecessary, slow `str_format` for concatenation. Use UI functions for drawing the background and text.
2024-06-02 11:54:23 +02:00
Robert Müller bbf54ec625
Merge pull request #8318 from ChillerDragon/pr_clang_tidy_19
Add support for clang tidy 19
2024-06-02 08:52:47 +00:00
Robert Müller 6cfe54b9c5
Merge pull request #8338 from ChillerDragon/pr_goto_tele_refactor
Fix `goto_tele` not finding all teleporters
2024-06-02 08:47:30 +00:00
Robert Müller 94325cdf78 Improve error handling for invalid translation files
Fix crash when reading a translation file that ends unexpectedly after a context line.

Make error messages about malformed translation files more detailed.

Fix incorrect line numbers in the error message because context lines were not counted.

Use `log_error` for error messages.
2024-06-02 10:36:00 +02:00
Louis Geer 9492ca574b Add confetti particles on finish
Add confetti particles on finish

added common base to finish netevent

review fixes

change netevent to ddnet.org
2024-06-02 11:00:06 +09:00
Robert Müller f762e2364f Fix language file being loaded twice when starting
Ignore language file config variable being set initially in the conchain (i.e. when `GlobalTime` still returns zero) and check whether the value changed before reloading the language.
2024-06-01 22:24:05 +02:00
heinrich5991 64fec2cd37
Merge pull request #8427 from Robyt3/Translation-Brazilian-Portuguese-Fix
Fix invalid format string in Brazilian Portuguese translation
2024-06-01 20:02:59 +00:00
Robert Müller 3a12c16dac Fix invalid format string in Brazilian Portuguese translation 2024-06-01 21:31:09 +02:00
furo 4e552d0f98 Add /practicecmdlist 2024-06-01 18:51:53 +02:00
Dennis Felsing cb563bf267
Merge pull request #8425 from gerdoe-jr/patch-4
Small changes in `russian.txt`
2024-06-01 16:29:58 +00:00
gerdoe 8ad414bd8c
small changes in russian.txt 2024-06-01 19:12:22 +03:00
Dennis Felsing f1c2d10cd7
Merge pull request #8424 from Robyt3/Cleanup-str_copy
Consistently use `str_copy` instead of `mem_copy` for strings
2024-06-01 15:18:37 +00:00
Dennis Felsing 3233492fd3
Merge pull request #8423 from Robyt3/Client-Mapdownload-Speed-Localize
Make map download progress and speed label translatable
2024-06-01 15:18:35 +00:00
Robert Müller 24d12e4820 Consistently use str_copy instead of mem_copy for strings 2024-06-01 13:55:20 +02:00
Robert Müller 2a3cc8fd55 Make map download progress and speed label translatable 2024-06-01 13:01:37 +02:00
Robert Müller 7f5330b7d1
Merge pull request #8421 from Robyt3/Android-Unused-Flag-Cleanup
Remove unnecessary `DDNET_TEST_NO_LINK=1` in Android build
2024-05-31 16:05:03 +00:00
Robert Müller 60bbbcd424 Remove unnecessary DDNET_TEST_NO_LINK=1 in Android build
Verified with clean build, the variable is not necessary. Closes #8420.
2024-05-31 17:43:12 +02:00
heinrich5991 a5ca7c64e0
Merge pull request #8409 from ChillerDragon/pr_const_char
Mark some character methods const
2024-05-29 00:31:19 +00:00
ChillerDragon ffd0da09e9 Mark some character methods const 2024-05-29 08:13:16 +08:00
Dennis Felsing 1460081d8c
Merge pull request #8402 from Robyt3/Menus-Keyreader-UI-Inactive
Prevent UI elements from being hovered while key reader is active
2024-05-28 02:04:17 +00:00
Robert Müller bd5ca951a7 Prevent UI elements from being hovered while key reader is active
Since the key reader will intercept the next input, the other UI elements should not react to the hovered mouse.
2024-05-27 20:20:25 +02:00
ChillerDragon c1a5e59d9f Exclude enough checks to pass with clang tidy 19 2024-05-26 19:31:54 +08:00
ChillerDragon 59cb7ef5a9 Fix clang-analyzer-unix.StdCLibraryFunctions
```
/home/chiller/Desktop/git/ddnet/src/base/system.cpp:1989:10: error: The 1st argument to 'connect' is < 0 but should be >= 0 [clang-analyzer-unix.StdCLibraryFunctions,-warnings-as-errors]
 1989 |                 return connect(sock->ipv4sock, (struct sockaddr *)&addr, sizeof(addr));
      |                        ^
```
2024-05-26 19:31:54 +08:00
ChillerDragon 64505273a9 Remove redundant casts 2024-05-26 19:31:54 +08:00
ChillerDragon 0a505c25d7 Don't return from void methods 2024-05-26 19:31:54 +08:00
ChillerDragon c4f68f50ea Remove unnecessary object creation in emplace_front
Fixes

```
/home/chiller/Desktop/git/ddnet/src/engine/client/updater.cpp:186:27: error: unnecessary temporary object created while calling emplace_front [modernize-use-emplace,-warnings-as-errors]
  186 |         m_FileJobs.emplace_front(std::make_pair(pFile, Job));
      |                                  ^~~~~~~~~~~~~~~          ~
```
2024-05-26 19:31:54 +08:00
heinrich5991 5ad62b5732
Merge pull request #8398 from Robyt3/Base-secure_random_init-check
Ensure return value of `secure_random_init` is always checked
2024-05-26 10:21:26 +00:00
Robert Müller 583845fc60 Ensure return value of secure_random_init is always checked 2024-05-26 11:59:26 +02:00
Dennis Felsing 9bd5aacc2b
Merge pull request #8396 from Robyt3/Android-Storage-Refactoring
Improve Android storage usage, faster launch, remove permissions
2024-05-26 04:19:27 +00:00
Robert Müller 986508e091 Improve Android storage usage, faster launch, remove permissions
Split the user storage location and the data folder in the app specific external storage in the folders `data` and `user` instead of writing the user setting directly to the external storage.

Remove unnecessary storage permissions. The client only accesses files in its own external storage location, hence these permissions are not necessary for Android API 19 and higher, which is always given as we only target API 19 and higher.

Only unpack changed assets when their hash in the integrity index is different instead of unpacking all assets again, so the app starts faster after updates. Avoid unpacking the entire integrity index file unless it changed, by initially reading only the first hash directly from the asset, so the app starts faster when the data is up-to-date.

Add error handling for external storage not being accessible and other I/O errors during unpacking of assets.

Add `android_main.h` header to export the `InitAndroid` function and potentially other functions in the future. The `extern "C"` and `__attribute__((visibility("default")))` attributes seem to be unnecessary, as this function is only called directly from the native code like many other functions without these attributes.

Initialize the Android storage after the loggers, so the log message are printed properly.

Add documentation for the use of `std::exit` on Android, which is used to forcefully terminate the entire process, to ensure that static variables will be initialized correctly when the app is started again after quitting. Returning from the main function is not enough, as this only results in the native thread terminating, but the Java thread will continue. Java does not support unloading libraries once they have been loaded, so all static variables will not have their expected initial values anymore when the app is started again after quitting.

Use `fs_chdir` and `fs_makedir` instead of `chdir` and `mkdir`.
2024-05-25 21:09:42 +02:00
Dennis Felsing dd85209a8e
Merge pull request #8394 from Robyt3/Android-Building-Cleanup
Further clean up and improve the Android building scripts, lower minimum target API to 19
2024-05-24 00:47:38 +00:00
Robert Müller 1dfed5434e Lower minimum SDK to 19, remove unnecessary Gradle dependencies
SDK 19 is the lowest API level support by SDL2 because it is the lowest API level supported by the latest NDK toolchain. According to https://www.composables.com/tools/distribution-chart this should cover virtually all Android devices.

The dependencies on Kotlin and various `androidx`-Packages were entirely unnecessary and can be removed.
2024-05-23 22:09:23 +02:00
Robert Müller 63710a18a4 Preserve filenames and line numbers in ProGuard for debugging 2024-05-23 22:08:42 +02:00
Robert Müller 7de52fd46f Improve Android build script output, improve colors
Abort the Android CMake build immediately if any of the command line arguments is not specified, instead of assuming default values.

Add more log messages for different build steps to improve progress reporting and improve the existing log messages.

Improve and fix colors of log messages. Previously, some log message colors were not terminated properly, causing the output color of subsequent commands to change.

Avoid some error messages when the build script is executed for the first time, i.e. when cleanup of the previous build is not necessary because the files do not exist yet.

Make some related variable names more readable by removing the unnecessary underscore and `DEFAULT` prefixes.
2024-05-23 22:08:34 +02:00
Robert Müller 1a3b2eac10 Abort build script if CMake build failed for any architecture
Abort the build script when the CMake build fails for any of the selected architectures. Previously, the build may have continued and caused an APK without the respective library files to be built.
2024-05-23 20:48:56 +02:00
Robert Müller c8f0391c62 Remove unnecessary copy_dummy_files_rec function
Create the folder and copy the file manually instead of using a separate function for this, as the function is only used once.
2024-05-23 20:48:20 +02:00