Commit Graph

12834 Commits

Author SHA1 Message Date
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
3b7e274c34 Server: localize 'forcing server shutdown' message 2022-05-11 14:54:29 +01:00
db6abfb227 Stop the server if generators specified for new worlds are not valid
I thought I did this already in eff856d8e5, 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
9ff1bf6deb Merge remote-tracking branch 'origin/stable' into next-minor 2022-05-11 13:12:45 +01:00
212c94ce98 PluginManager: Log an error message when a plugin disables itself during enabling 2022-05-11 13:07:45 +01:00
3e1246acff FormattedCommandAlias: Invoke commands directly with pre-parsed arguments
this resolves a range of issues with quoted arguments when using placeholders, as well as improving performance (no redundant combine -> re-parse needed).
2022-05-10 16:03:09 +01:00
4c29f98292 "Fix CS" are going to be my final words ... 2022-05-10 15:39:44 +01:00
5cc0d92eff Fixed PHPStan errors 2022-05-10 15:38:26 +01:00
a5ebbf8adb Fix CS again 2022-05-10 15:23:55 +01:00
217385efb9 CommandStringHelper::parse() returns a non-empty list of strings 2022-05-10 15:22:46 +01:00
f70c36baf9 SimpleCommandMap: parse config-defined commands according to the same rules as manually typed commands 2022-05-10 15:21:39 +01:00
d2e421c424 CommandStringHelper: fixed backslashes not being removed from escaped quotes
this time, without breaking eval commands ... stripslashes likes to strip ALL backslashes, whether they are actually escaping something or not, which is super annoying.
2022-05-10 15:09:57 +01:00
6da53536ca Merge branch 'next-minor' of github.com:pmmp/PocketMine-MP into next-minor 2022-05-10 14:30:21 +01:00
1da6aa40f8 Leaves: drop sticks with a 2% chance (#5019)
as per vanilla
2022-05-10 14:17:18 +01:00
a913736235 fix CS 2022-05-10 14:13:01 +01:00
124edeacaf fix build 2022-05-10 14:11:46 +01:00
a216f4d089 Utils: improve representation of int, float and null in stack trace parameters 2022-05-10 14:07:07 +01:00
17b0e0be84 Utils: use match to clean up stringifyValueForTrace() 2022-05-10 14:04:52 +01:00
81d8aed2e2 Utils: account for named variadic arguments in printableTrace() 2022-05-10 13:59:42 +01:00
69418084bc Boat: fixed max stack size to match vanilla (#5018) 2022-05-10 13:16:04 +01:00
593a4b65ea World: fixed crash when using unloadChunk() during ChunkPopulateEvent, ChunkLoadEvent or when using ChunkListeners
I sure hope there isn't any other cases where this edge case can appear ...

closes #5022
2022-05-10 13:09:26 +01:00
e1c4150dff 4.3.3 is next 2022-05-10 00:57:50 +01:00
755ca1af9b Release 4.3.2 2022-05-10 00:57:50 +01:00
72cfea3a63 SimpleCommandMap: extract command string parsing code into its own unit 2022-05-01 22:05:38 +01:00
a353872327 FormattedCommandAlias: match placeholders using regex 2022-05-01 21:16:13 +01:00
f4d71d0b48 FormattedCommandAlias: reduce complexity of buildCommand() 2022-05-01 21:04:38 +01:00
6e372d9e36 Entity: fixed setNameTagVisible not having immediately visible effect 2022-05-01 14:54:41 +01:00
5d39d7a1c8 Version bump to 4.4 2022-04-28 21:00:49 +01:00
937bb4c6ce Merge branch 'stable' into next-minor 2022-04-28 21:00:23 +01:00
cf15a0913d World: fixed a corner case assertion failure in generation system
This required the following:
- A generation task (taskA) to already be running for any chunk (chunkA)
- A chunk (chunkB) is requested for generation, and the task (taskB) to do the generation
  is commenced immediately
- chunkB generation promise is aborted (e.g. due to chunk unload) and
  taskB is orphaned
- chunkB is subsequently re-requested, but ends up in the generation
  queue because taskB is still running
- taskA completes and drains the generation queue
- chunkB attempts to be populated a second time, but taskB has not yet
  been collected, resulting in an assertion failure.

This bug has been appearing intermittently ever since PM 4.0 release.
For most users there is no obvious effect since production servers don't
have assertions enabled; however, it's unclear what kind of weird side
effects this bug may have had.
2022-04-28 20:23:23 +01:00
33cf085692 PHPStan 1.6.3 2022-04-28 16:06:20 +01:00
3752225ed5 World: fix CS 2022-04-28 16:00:34 +01:00
5cf572892f WorldManager: fixed missing initializer for $defaultWorld 2022-04-28 15:38:20 +01:00
20ff5d5a3d Modernize property declarations in src/entity/animation 2022-04-28 15:33:13 +01:00
b88a47929f Modernize property declarations in src/world/* 2022-04-28 15:06:17 +01:00
159392e738 wtf is this shitbox code 2022-04-28 14:57:57 +01:00
2f03af51dd Modernize property declarations in src/world/sound 2022-04-28 14:57:01 +01:00
cb76c149e1 Modernize property declarations in src/world/particle 2022-04-28 14:55:53 +01:00
6d7bf1c5d8 Utils: fixed missing property initializer 2022-04-28 14:52:21 +01:00
ed2a239334 Modernize property declarations in src/world/generator 2022-04-28 13:16:21 +01:00
46c504e529 Modernize property declarations in src/ 2022-04-28 13:14:23 +01:00
0e7e776862 Modernize property declarations in src/utils 2022-04-28 13:12:12 +01:00
de12b701ac Modernize type declarations in src/world/format 2022-04-28 13:07:58 +01:00
b402df8b91 Modernize property declarations in pocketmine\crafting namespace 2022-04-25 13:15:48 +01:00
dca457b1e0 Modernize property declarations in pocketmine\command namespace 2022-04-25 13:09:14 +01:00
72cff0ee11 Modernize property declarations in pocketmine\block namespace 2022-04-25 13:00:29 +01:00
09778e3f1b Fixed build failure 2022-04-25 12:56:16 +01:00
9f5d4180c9 Spawnable: remove dead code, deprecate isDirty() and setDirty() 2022-04-25 12:46:01 +01:00
c8a7a53d70 event: modernize property declarations where possible
only private fields are modified; protected ones can't be changed in case someone extended the classes
2022-04-25 00:06:26 +01:00
223893fd5c PlayerChangeSkinEvent: remove obsolete doc comment 2022-04-24 21:56:49 +01:00