116 Commits

Author SHA1 Message Date
Dylan T.
61560ec375
Support for collecting timings from threads, and implement async task timings (#6333)
The following callbacks can now be registered in timings, to allow threads to be notified of these events:
- Turning on/off (`TimingsHandler::getToggleCallbacks()->add(...)`)
- Reset (`TimingsHandler::getReloadCallbacks()->add(...)`)
- Collect (`TimingsHandler::getCollectCallbacks()->add(...)`)

Collect callbacks must return `list<Promise>`. The promises must be `resolve()`d with `list<string>` of printed timings records, as returned by `TimingsHandler::printCurrentThreadRecords()`. It's recommended to use 1 promise per thread.

A timings report will be produced once all promises have been resolved.

This system is used internally to collect timings for async tasks (closes #6166).

For timings viewer developers:
Timings format version has been bumped to 3 to accommodate this change. Timings groups should now include a `ThreadId`  at the end of timings group names to ensure that their record IDs are segregated correctly, as they could otherwise conflict between threads. The main thread is not required to specify a thread ID. See pmmp/timings@13cefa6279 for implementation examples.

New PHPStan error is caused by phpstan/phpstan#10924
2024-12-01 14:49:27 +00:00
Dylan K. Taylor
12ae8dc03b
Merge branch 'stable' into minor-next 2024-11-25 14:32:30 +00:00
Dylan K. Taylor
5325ecee37
Deal with a whole lot of PHPStan suppressed key casting errors
closes #6534
2024-11-25 14:30:58 +00:00
Dylan K. Taylor
2d9cee3d62
Update Language dependency 2024-11-14 23:14:23 +00:00
Dylan K. Taylor
886b40a455
ÂLocalize disconnect reasons for RakLib disconnects 2023-02-13 14:10:25 +00:00
Dylan K. Taylor
c55e23a2c6
Localized disconnect message for spawn selection failure 2023-01-14 20:59:27 +00:00
Dylan K. Taylor
5c2ed210fc
Merge branch 'next-minor' into next-major 2023-01-14 20:53:41 +00:00
Dylan K. Taylor
1bbe053848
Language: fixed another couple of hardcoded translation keys 2023-01-13 17:52:20 +00:00
Dylan K. Taylor
8909aa6a18
Merge branch 'next-minor' into next-major 2023-01-13 17:29:25 +00:00
Dylan K. Taylor
a9f06fc5f4
Replaced hardcoded record.nowPlaying with KnownTranslationKeys 2023-01-13 17:27:57 +00:00
Dylan K. Taylor
ecd8f151f1
Merge branch 'next-minor' into next-major 2023-01-12 22:08:25 +00:00
Dylan K. Taylor
4df1f7f502
Updated composer dependencies (next-minor) 2023-01-12 19:03:55 +00:00
Dylan K. Taylor
81ca0c8fbf
Language: do not parse translations if the text was a plain key
this unintentionally allowed translations to reference other translations 1 level deep, which is not desired behaviour.
This also improves performance for the cases where formatting isn't used.
2023-01-08 20:56:12 +00:00
Dylan K. Taylor
d4b8c47a65
Language: document poorly-named function parseTranslation() 2023-01-08 16:46:25 +00:00
Dylan K. Taylor
c2918709a3
Merge branch 'next-minor' into next-major 2023-01-06 01:59:04 +00:00
Alexey
172ce659b8
Use str_starts_with, str_ends_with and str_contains instead of strpos (#5485) 2022-12-31 13:02:23 +00:00
Dylan K. Taylor
7ac6bd79a9
Localized remaining disconnection screens (except one or two that should never actually happen) 2022-12-27 20:05:59 +00:00
Dylan K. Taylor
d03caafc2b
Merge branch 'next-minor' into next-major 2022-11-25 15:00:39 +00:00
Dylan K. Taylor
641d35a30f
Updated pocketmine/locale-data to get new translations 2022-11-25 14:59:58 +00:00
Dylan K. Taylor
b6982a84ef
Merge branch 'next-minor' into next-major 2022-11-25 14:52:56 +00:00
Dylan K. Taylor
cca22046ab
Updated pocketmine/locale-data 2022-11-15 20:21:39 +00:00
Dylan K. Taylor
d19f0bf7be
Language: added getAll() 2022-11-15 15:27:14 +00:00
Dylan K. Taylor
fba4895a17
Merge branch 'next-minor' into next-major 2022-10-31 19:11:39 +00:00
Dylan K. Taylor
b6f6671a81
Merge branch 'stable' into next-minor 2022-10-31 15:34:24 +00:00
Dylan K. Taylor
6da467b142
Updated composer dependencies 2022-10-31 15:27:56 +00:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
f88ae93897
BC break: Replaced webmozart/path-util with symfony/filesystem, closes #5332 2022-10-13 16:43:36 +01:00
Dylan K. Taylor
f80ffd8de0
Merge branch 'next-minor' into next-major 2022-09-15 13:59:21 +01:00
Dylan K. Taylor
222049927a
Language: fixed bogus callable reference in array_map
for some reason phpstan only reports this under checkImplicitMixed.
2022-09-02 19:15:05 +01:00
DiamondStrider1
9e0b4621be
Fixed languages-not-found bug (#5272)
* Fixed languages-not-found bug

* Update Language.php

Co-authored-by: Dylan T <odigiman@gmail.com>
2022-09-02 03:51:31 +01:00
Dylan K. Taylor
456439566b
Language: treat empty translation files the same as missing ones 2022-08-31 01:53:15 +01:00
Dylan K. Taylor
aa9f8781ff
Merge branch 'next-minor' into next-major 2022-06-07 19:56:26 +01:00
Dylan K. Taylor
083a35f970
Modernize property type declarations 2022-06-04 18:16:32 +01:00
Dylan K. Taylor
38d6284671
Use PHP-CS-Fixer to enforce file header presence 2022-06-04 17:34:49 +01:00
Dylan K. Taylor
3b7e274c34
Server: localize 'forcing server shutdown' message 2022-05-11 14:54:29 +01:00
Dylan K. Taylor
212c94ce98
PluginManager: Log an error message when a plugin disables itself during enabling 2022-05-11 13:07:45 +01:00
Dylan K. Taylor
3353a00641
List command aliases in /help <commandName> 2022-04-10 21:32:46 +01:00
Dylan K. Taylor
ac3a6033b9
PluginManager: account for possible abstract main classes
idk why anyone does this, but it shouldn't cause a core crash ...
2022-04-01 23:42:37 +01:00
Dylan K. Taylor
4e956d5d1d
Replace remaining disallowed operators 2022-01-20 19:23:19 +00:00
Dylan K. Taylor
8532e9c8e0
Merge remote-tracking branch 'origin/stable' into next-minor 2022-01-04 14:38:15 +00:00
Dylan K. Taylor
0d595e4324
Update Language dependency 2022-01-04 00:47:04 +00:00
Dylan K. Taylor
57e1509c3a
Updated translation APIs 2021-12-15 03:24:13 +00:00
Dylan K. Taylor
c04b00d09d
Updated Language to 2.2.0 2021-12-15 02:15:24 +00:00
Dylan K. Taylor
8a94aa10a4
Merge branch 'stable' into next-minor 2021-12-14 00:34:54 +00:00
Dylan K. Taylor
c334e6dec7
Updated locale-data dependency 2021-12-14 00:31:44 +00:00
Dylan K. Taylor
e06eefeab0
build/generate-known-translation-apis: fixed incorrect positional parameter order
closes #4639
2021-12-11 21:28:52 +00:00
Dylan K. Taylor
ede07c4314
Mark KnownTranslationKeys and KnownTranslationFactory as @internal 2021-12-11 21:24:18 +00:00
Dylan K. Taylor
889d048ca3
Make use of Utils::assumeNotFalse() in a bunch of places
I've stuck to only doing this in the places where I'm sure we should never get false back. Other places I'm less sure of (and I found more bugs along the way).
2021-12-08 19:39:04 +00:00
Dylan K. Taylor
e4754ab029
PluginBase: Improved error messages for commands containing illegal characters 2021-11-12 00:16:53 +00:00
Dylan K. Taylor
6b316dc29a
PluginManager: Make declaration of duplicate permissions a load error 2021-11-06 17:05:37 +00:00