Dylan K. Taylor
237c2866e0
Merge branch 'stable' of github.com:pmmp/PocketMine-MP into stable
2022-06-04 17:35:18 +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
7355798e77
Exit with error code if the server failed to start
...
this ensures that external tools such as start.cmd actually see an error if there is one
2022-06-03 18:34:54 +01:00
Dylan K. Taylor
179cac45f5
Merge branch 'stable' into next-minor
2022-05-22 16:21:05 +01:00
Dylan K. Taylor
688be0a404
Server: apply server.properties difficulty to newly generated worlds
...
see #5057
jury is out on whether or not this should override difficulty on preexisting worlds, but it's non-controversial that it should apply at least to newly generated worlds.
2022-05-21 18:46:38 +01:00
Dylan K. Taylor
d4b7f66e15
Promote some constructors
2022-05-17 22:34:58 +01:00
Dylan T
52e74296de
Stop the server if any plugin failed to load or enable ( #4951 )
...
closes #3080
If plugins fail to load for some reason, it's highly likely that some critical functionality of the server is compromised. For example:
- if an NPC plugin fails to load, all custom entities added by that plugin will be deleted from worlds
- if a world protection plugin fails, players will be able to grief your otherwise immutable lobby map
- if a worldgen plugin fails, worlds using custom generators won't load
- if a permission plugin fails, players might have access to commands and features they aren't supposed to have
- the list goes on...
This change makes the server commit graceful suicide if any plugin fails to load for error-related reasons, including (but not limited to):
- Incompatible API version
- Missing dependencies
- Invalid plugin.yml
- Invalid main class
Plugins prevented from loading by `plugin_list.yml` are not considered errors and **are not** included in this change. If a plugin is disallowed from loading due to the `plugin_list`, the server will continue to run as if the plugin was not present.
2022-05-11 20:43:38 +01:00
Dylan K. Taylor
3b7e274c34
Server: localize 'forcing server shutdown' message
2022-05-11 14:54:29 +01:00
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