166 Commits

Author SHA1 Message Date
Dylan K. Taylor
db6abfb227
Stop the server if generators specified for new worlds are not valid
I thought I did this already in eff856d8e513a1f01eca16ab55bacf6e83399527, but it looks like my brain slipped a gear.

Without this change, it's possible to crash the server by specifying an invalid generator for the default world if it doesn't yet exist.
2022-05-11 14:35:20 +01:00
Dylan K. Taylor
ded7e24f67
Merge branch 'stable' into next-minor 2022-04-19 15:27:55 +01:00
Dylan K. Taylor
f2e8824242
fix CS 2022-04-15 16:24:15 +01:00
Dylan K. Taylor
a0e47b5a64
phpstan 1.5.6 2022-04-15 16:21:05 +01:00
Dylan K. Taylor
eff856d8e5
Stop the server if any world listed by config fails to load or be generated during startup
closes #3162

this does not affect worlds loaded by plugins; they may continue to handle errors as they see fit
2022-03-03 18:40:11 +00:00
Dylan K. Taylor
4e956d5d1d
Replace remaining disallowed operators 2022-01-20 19:23:19 +00:00
Dylan K. Taylor
a5c0958adf
Filesystem::safeFilePutContents() now consistently throws RuntimeException in all expected failure cases
unexpected cases may still throw ErrorException (such as undefined variables) but we don't want to capture those.
2022-01-09 16:33:31 +00:00
Dylan K. Taylor
4466166f8b
Merge branch 'stable' into next-minor 2021-12-15 03:12:41 +00:00
Dylan K. Taylor
6e67c7532a
Bump default max render radius to 16 chunks
It's 2021, this is making PM look bad to new users (as if we need something else to make PM look bad...)
2021-12-15 01:46:50 +00:00
Dylan K. Taylor
5f8ebd81d7
it's MAX view distance, not fixed 2021-12-15 01:42:29 +00:00
Dylan K. Taylor
79b5109953
Move some configuration constants to .. well .. constants 2021-12-15 01:40:29 +00:00
Dylan K. Taylor
4d37b79ff7
Server: fixed not being able to deop players whose names were added to ops.txt with uppercase letters in them
same as iTXTech/Genisys#1204

why didn't anyone report this???
2021-12-15 01:08:59 +00:00
Matthew Jordan
a41404bd8a
Allow gamemode strings for gamemode property in server.properties (#4638)
closes #2692
2021-12-14 22:56:22 +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
45b4fa0e96
Server: improve confusing condition in crashDump() 2021-12-07 23:08:06 +00:00
Dylan K. Taylor
bf29409a45
Server: fixed PHPStan level 7 error in crashDump() 2021-12-07 23:06:10 +00:00
Dylan K. Taylor
527e975fa9
shut 2021-12-05 00:45:23 +00:00
Dylan K. Taylor
8e37f86480
Avoid file_put_contents() when overwriting files
this fixes many cases of corruption during disk-full situations - file_put_contents() would write an empty file, destroying the original data.
fixes #3152
2021-12-05 00:26:48 +00:00
marshall
1b86355c40
Server: Suppress "Minecraft network interface running" messages if RakLibInterface registration is cancelled (#4603) 2021-12-02 20:29:01 +00:00
Dylan K. Taylor
4a8ca603a1
Log a message when forceShutdown() is called for anything other than a graceful shutdown 2021-11-28 18:53:34 +00:00
Dylan K. Taylor
c37c261c0f
Separate crashdump file generation from crashdump data collection
this allows CrashDump to be used just to generate data, which will come in useful for non-crash error reporting in the future (e.g. packet decoding errors).
2021-11-22 22:19:40 +00:00
Dylan K. Taylor
269231c228
Ban foreach(arrayWithStringKeys as k => v)
this is not as good as phpstan/phpstan-src#769 (e.g. array_key_first()/array_key_last() aren't covered by this, nor is array_rand()) but it does eliminate the most infuriating cases where this usually crops up.
2021-11-15 22:52:05 +00:00
Dylan T
cc4bb91fcb
Implemented IPv6 support (#4554) 2021-11-08 20:03:28 +00:00
Dylan K. Taylor
84f8b3eb2d
Move CrashDump to pocketmine\crash namespace 2021-11-04 19:23:45 +00:00
Dylan K. Taylor
8ac999cbd4
Use object models for crashdump generation 2021-11-04 16:55:04 +00:00
Dylan K. Taylor
d184838ba0
Move Promise classes to their own namespace 2021-11-02 17:10:07 +00:00
Dylan K. Taylor
275f145418
BedrockData is now a Composer dependency
this should put a stop to people nagging me about incorrect blocks (we have a check to make sure composer dependencies are up to date).
2021-11-02 16:45:45 +00:00
Dylan K. Taylor
e34364412b
Replace InvalidStateException usages with InvalidArgument or LogicException 2021-11-02 16:05:54 +00:00
Dylan K. Taylor
7e4be29fc4
Gracefully force-shutdown on failure to start RakLib
this now won't generate a crashdump.
2021-11-02 13:51:01 +00:00
Dylan K. Taylor
f1a791ef75
Improved Promise API - separate resolver and consumer APIs
this makes creating a promise slightly more cumbersome, but I'm more concerned about people who might try to call 'new Promise' directly.
2021-10-31 19:49:57 +00:00
Dylan K. Taylor
4f2bcb61d6
Fixed crashdump generation when crashing before PluginManager was created 2021-10-20 23:35:04 +01:00
Dylan K. Taylor
bdbfa70558
Server: break some isolated stuff out of Server::__construct() 2021-10-14 15:44:18 +01:00
Dylan K. Taylor
34b1392598
Cross-platform signal handler 2021-10-14 15:03:11 +01:00
Dylan K. Taylor
824a89edfe
Merge commit 'e032b8fe208a053441c9fbd377209740008cddb8' 2021-10-12 23:12:17 +01:00
Dylan K. Taylor
01c0602043
Server: do not attempt to generate a new world if it already exists 2021-10-11 17:48:08 +01:00
Dylan K. Taylor
34f54750c8
Added support for creation-time validation of generator options, closes #2717 2021-10-11 17:37:47 +01:00
Dylan K. Taylor
092aabeb97
fix CS 2021-10-11 17:21:19 +01:00
Dylan K. Taylor
89d7b7198f
Server: drop support for tagging generator options onto the 'generator' key in pocketmine.yml
the 'preset' key should be used for this purpose instead.

This couldn't be dropped until now due to the shitty handling of unknown generators.
2021-10-11 17:20:49 +01:00
Dylan K. Taylor
fa93a8d78f
Server: Error on unknown generators when generating new worlds from config, instead of silently using DEFAULT
this is consistent with the behaviour of loading worlds.
2021-10-11 16:13:32 +01:00
Dylan K. Taylor
7b6632941d
GeneratorManager::getGenerator() now returns null for unknown generator aliases
instead of returning Normal::class (indistinguishable from successful match) or throwing an exception (pain in the ass to handle).
2021-10-11 16:04:36 +01:00
Dylan K. Taylor
bb6ea8cbdc
Do not call PlayerLoginEvent during the Player constructor
this closes a lot of loopholes in the login sequence that plugins were using to cause crashes.
2021-10-04 22:36:50 +01:00
Dylan K. Taylor
05dc675d5b
Replace commands.generic.notFound with a custom PM version
this also fixes #4379.
2021-10-02 20:42:59 +01:00
Dylan K. Taylor
dd0c2fed82
Process: add subprocess parameter to kill()
fix CommandReader subprocess lingering on a crash and fucking up the console
2021-10-02 16:56:24 +01:00
Dylan T
4111d92b98
Stop hardcoding chunk dimensions everywhere (#4443) 2021-09-10 16:13:25 +01:00
Dylan K. Taylor
32588d79c8
ConsoleReaderThread: remove useless code 2021-09-10 13:54:42 +01:00
Dylan K. Taylor
1cc57afd25
Stop the ConsoleReaderThread explicitly, instead of letting ThreadManager do it
this hack dates back to the days when the console reader would get stuck on shutdown on some platforms.
2021-09-10 13:48:01 +01:00
Dylan K. Taylor
0f70348821
Remove noise 2021-09-07 20:31:13 +01:00
Dylan K. Taylor
f95eb6a218
Server is not cloneable 2021-09-03 21:08:29 +01:00
Dylan K. Taylor
b026ada489
Standardize serialize denying 2021-09-03 21:07:10 +01:00
Dylan K. Taylor
d488c25a1a
Rename AutoUpdater -> UpdateChecker 2021-08-20 19:54:08 +01:00