14 Commits

Author SHA1 Message Date
Dylan K. Taylor
4b41b2f9ae
Merge remote-tracking branch 'origin/next-minor' into next-major 2022-09-28 16:15:35 +01:00
Dylan T
b87e4d8bd3
Introduce and use TextFormat::addBase() (#5268)
This function adds "base" format to a string. The given formats are inserted directly after any RESET code in the sequence.

An example of where this is needed is in the logger.

Without this change, the following code:
$logger->notice("I'm a " . TextFormat::RED . "special" . TextFormat::RESET . " cookie");

causes the "cookie" part of the message to show as grey, instead of the expected aqua for NOTICE level messages.

There are also many workarounds for this problem throughout the server, mostly in command outputs, being forced to use WHITE instead of RESET to avoid breaking the logger output.
2022-09-28 16:13:11 +01:00
Dylan K. Taylor
6f4ea886b0
Merge branch 'next-minor' into next-major 2022-09-28 00:39:00 +01:00
Dylan K. Taylor
cfb0cad7e0
Console commands now write to stdout directly, instead of being fed through the logger
this has a number of implications:
- Console command outputs are now (obviously) not logged. This is consistent with every other type of command sender, be it RCON, players, or anything else.
- The assumption that the console command sender must be able to see the logger output is now broken, since the command sender can receive output separately from the logs.

In the future, it might be desirable to send the console command output to stderr instead of stdout, so that stdout can be silenced while still allowing commands to be used.

closes #2543
2022-09-27 21:03:03 +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
20eb80fc9a
Modernize private property declarations in src/console 2022-05-17 20:34:55 +01:00
Dylan K. Taylor
856fd2a33b
fix PHPStan failures 2022-03-09 17:26:05 +00:00
Dylan K. Taylor
22bc3bc3f9
Replace disallowed operators in src/console/ 2022-01-20 16:49:04 +00:00
Dylan K. Taylor
5da90b9530
Stop auto-translating strings when not asked
fixes #4371
2021-08-15 20:44:27 +01:00
Dylan K. Taylor
789a669395
Rename TranslationContainer -> Translatable 2021-08-15 16:17:46 +01:00
Dylan K. Taylor
b4c0ddd155
Use native union types for TranslationContainer|string 2021-08-10 15:17:26 +01:00
Dylan K. Taylor
a70bd115f1
Moved console-specific stuff to its own namespace
this stuff has different functionality than everything else in the
command namespace (specifically console handling), so it doesn't belong
in here.

I know that this will probably break some plugins, but I don't care,
because plugins shouldn't have been abusing ConsoleCommandSender in the
first place.
2021-06-26 19:24:46 +01:00