701 Commits

Author SHA1 Message Date
Dylan K. Taylor
a753c1342d Clean up Query cache handling, remove useless timeouts
the timeout was entirely useless, because:
- when shorter than 25.6 seconds (512 ticks) it would cause caches to be needlessly destroyed and regenerated
- when longer than 25.6 seconds, just made outdated caches persist for longer, even after the query info was regenerated.

This now uses a mark-dirty model to deal with caches, which means that plugin modifications to the query data will be reflected immediately, regardless of when they are made. Previously, modifying the result of Server->getQueryInformation() would have inconsistent results.
2019-03-24 17:43:02 +00:00
Dylan T
9c76fb7d96
Implemented plugin loading whitelist/blacklist by config file (#2783) 2019-03-24 16:18:13 +00:00
Dylan K. Taylor
433dab078b DataPacket events now use network sessions instead of players 2019-03-23 09:52:03 +00:00
Dylan K. Taylor
afbd016611 Server: remove useless function 2019-03-22 19:38:33 +00:00
Dylan K. Taylor
712e077bc1 Server: remove useless debug message
leveldb is now mandatory, so this message will always be emitted.
2019-03-22 19:31:10 +00:00
Dylan T
d03f0aab37
Remove /reload (#2823)
For many years, this has been the cause of many users (particularly plugin devs) confusion. The reality is that /reload has little to no practical value. It does not reload plugin source code (contrary to popular belief).
2019-03-22 15:01:11 +00:00
Dylan K. Taylor
8c536c248d Updating for latest PocketMine-NBT changes 2019-03-21 15:58:22 +00:00
Dylan K. Taylor
a1ffaffa7f Don't record player on stats until they actually exist 2019-03-14 14:46:19 +00:00
Dylan K. Taylor
26a5d97499 Some cleanup to player net session handling for connect/disconnect 2019-03-14 14:32:43 +00:00
Dylan K. Taylor
a0a8026cba Implemented automatic world format conversion 2019-03-10 19:53:23 +00:00
Dylan K. Taylor
f87dac7bb2 Merge branch '3.6' 2019-03-04 12:02:36 +00:00
Dylan K. Taylor
20a25a69df Force emission of output buffer contents on crash 2019-03-04 12:01:30 +00:00
Dylan K. Taylor
6c8fa8ae28 More nullable and void typehints 2019-03-02 10:29:11 +00:00
Dylan K. Taylor
c26544475e More PHP 7.1 nullables 2019-02-22 12:55:34 +00:00
Dylan K. Taylor
58cafc853f s/level/world (strings only)
we should look at doing this for code too, but for now I'm not planning to break everyone's plugins.
2019-02-20 15:33:46 +00:00
Dylan K. Taylor
18440f612f Merge branch '3.6' 2019-02-10 17:40:09 +00:00
Dylan K. Taylor
9ba4144a71 Server: remove useless gc_collect_cycles()
the server is shutting down at this point so who cares if there are cycles...
2019-02-10 17:15:41 +00:00
Dylan K. Taylor
b6bcb47deb Network->unregisterInterface() is now less useless
Interfaces are now automatically shut down when unregistered.
2019-02-10 17:07:58 +00:00
Dylan K. Taylor
ad6ae20d6b Server: fixed getOfflinePlayerData() trying to load terrain (?!?!?!?), closes #2725
getOfflinePlayerData() will now return NULL if there is no stored data for a given player. The responsibility of checking the spawn point is now delegated to the Player, after it registers a chunk loader on its spawn chunk.
2019-02-04 19:51:11 +00:00
Dylan K. Taylor
d378371cc8 Transition to spl_object_id() 2019-01-26 15:06:38 +00:00
Dylan K. Taylor
1e708db26c Server: fixed wrong doc type on broadcastMessage() 2019-01-26 15:03:15 +00:00
Dylan K. Taylor
d052b1a45f Server: reduce code duplication in broadcast handling 2019-01-26 15:02:07 +00:00
Dylan K. Taylor
469b24b0a5 Remove built-in spawn protection
Users should use the new BasicSpawnProtection plugin instead.
2019-01-24 16:56:15 +00:00
Dylan K. Taylor
738e310798 Strip out RCON, closes #2686
Users should move to the new RconServer plugin instead.
2019-01-23 20:39:16 +00:00
Dylan K. Taylor
1ebc101ded fixed crash on dev build self-shutdown 2019-01-22 13:38:50 +00:00
Dylan K. Taylor
48a99937b9 more exception handling cleanup 2019-01-22 13:37:46 +00:00
Dylan K. Taylor
65927e6965 Minor cleanup to Player NBT creation garbage 2019-01-19 14:32:20 +00:00
Dylan K. Taylor
6b7710e62b Introduce dedicated NBT data exceptions, fix up some corrupted chunk handling 2019-01-19 12:43:47 +00:00
Dylan K. Taylor
2dee7e9e0f Properly handle Query packet errors 2019-01-17 22:22:53 +00:00
Dylan K. Taylor
38cf8d157d Max players check now works properly
This now includes all connected sessions, whether they are considered online or not.
2019-01-17 21:40:10 +00:00
Dylan K. Taylor
41676cb4d4 Server: remove some useless methods 2019-01-17 21:01:31 +00:00
Dylan K. Taylor
76f1ee1827 Add restrictions on packet send directions with interfaces
This prevents plugins sending wrong packets at the compiler level (or would, if we had a compiler). It's more robust than a getter for client/server and throwing an exception since a static analysis tool can detect faults created by sending wrong packets from the server. This is also used to deny service to dodgy clients which send wrong packets to the server to attack it.
2019-01-17 12:51:24 +00:00
Dylan K. Taylor
b82e00ffdf Extract a Packet interface from DataPacket
this is in preparation for clientbound/serverbound packet separation. I did this already on another branch, but the changeset was dependent on a massive refactor to split apart packets and binarystream which i'm still not fully happy with.
2019-01-17 12:21:56 +00:00
Dylan K. Taylor
8bc33a849a Remove built-in pcntl support
This is a bolt-on feature that can't be disabled and causes serious grief for Unix server users, because it prevents ctrl+c aborting the server the normal way.
Instead, we prefer introducing a plugin to implement this functionality, so that users can opt-in or opt-out.
2019-01-16 14:13:08 -05:00
Dylan K. Taylor
ff5cb84b81 Server: fixed an oops 2019-01-13 21:00:16 +00:00
Dylan K. Taylor
5052b75565 Separate Level management functionality from Server, clean up a bunch of mess 2019-01-12 19:11:05 +00:00
Dylan K. Taylor
27761ac26e Fixed casing: Gamemode -> GameMode
it's two words, not one.
2019-01-12 16:19:31 +00:00
Dylan K. Taylor
a756519e6b Move gamemode constants & functions to their own class
future enhancements:
- make gamemode an object containing information about abilities that players have in this gamemode (gamemodes are just predefined ability sets)
- get the magic numbers out of the API
2019-01-12 16:10:14 +00:00
Dylan K. Taylor
f4d07f0c1e Merge branch '3.5' 2019-01-10 19:31:01 +00:00
Dylan K. Taylor
f7d9247d39 Server: Permit NULL value entries in pocketmine.yml worlds
this permits listing worlds to load as keys without values.
2019-01-10 19:30:37 +00:00
Dylan K. Taylor
2924303169 Sync NBT dependency 2019-01-07 22:38:04 +00:00
Dylan K. Taylor
78cb6445a5 Introduce TileFactory 2019-01-07 00:20:24 +00:00
Dylan K. Taylor
7d827a1c65 Introduce EntityFactory
This contains all of the static stuff that was previously embedded in the Entity static root. This solves a bunch of problems like circular dependencies between parent and child classes, encapsulating logic and reducing the size of the enormous Entity.php.
2019-01-06 23:54:29 +00:00
Dylan K. Taylor
3ae722867c Merge branch '3.5' 2019-01-06 20:19:18 +00:00
Dylan K. Taylor
a6e5b6e158 Log a debug message when not sending crash due to folder plugin 2019-01-06 19:52:20 +00:00
Dylan K. Taylor
2cdf97b7b5 CrashDump: Scan full stack trace to determine plugin involvement 2019-01-06 18:07:29 +00:00
Dylan K. Taylor
836cb67850 Server: don't abuse random_bytes() to generate integers 2019-01-06 17:22:31 +00:00
Dylan K. Taylor
f0733f6ab6 Merge branch '3.5' 2019-01-06 01:09:34 +00:00
Dylan K. Taylor
ab37df4484 Server: micro-optimization: avoid unnecessary array_shift()
it's much less expensive to just calculate the modulo of the current tick and 20, and overwrite past entries. The effect is the same. The only difference is that the arrays won't be ordered by time, but that doesn't matter anyway.
2019-01-06 01:08:56 +00:00
Dylan K. Taylor
f80eeee20f Merge branch '3.5' 2019-01-05 18:59:13 +00:00