499 Commits

Author SHA1 Message Date
Dylan K. Taylor
2e7db552dc Level: __construct() now accepts a LevelProvider object instead of string, string
This is made possible by the removal of LevelProvider dependence on their Levels, and furthers the goal of #2024.
2018-05-01 18:43:11 +01:00
Dylan K. Taylor
53c35aaa1d Server: remove unused variable from generateLevel() 2018-05-01 18:26:03 +01:00
Dylan K. Taylor
dfa6cd2b7e Biome: Moved biome classes from level\generator\* to level\biome 2018-05-01 14:07:46 +01:00
Dylan K. Taylor
96a2fd7482 Server: fixed wonky doc comment for broadcastTitle() 2018-05-01 12:30:06 +01:00
Dylan K. Taylor
88c56bcdc8 Server: move formattingCodes check to initial assignment of doTitleTick 2018-05-01 12:21:41 +01:00
Dylan K. Taylor
2731fc3d0f Server: remove redundant return value from tick() 2018-05-01 12:17:11 +01:00
Dylan K. Taylor
1e2122d854 avoid crashing in forceShutdown() if properties wasn't initialized yet 2018-04-14 12:45:03 +01:00
Dylan K. Taylor
1e21066c1c Server: remove redundant == true from setConfigBool() 2018-04-10 12:22:21 +01:00
Dylan K. Taylor
5b7b2dd0e2 Merge changes from ALPHA11 for 1.2.13 2018-04-04 11:31:39 +01:00
Dylan K. Taylor
fc795b80ae Protocol changes for 1.2.10 2018-04-04 10:58:49 +01:00
Dylan K. Taylor
37d085f793 UPnP: error messages on failure to portforward instead of silently failing 2018-03-31 12:51:17 +01:00
Dylan K. Taylor
73e09392b6 Timings: Clean up some terrible code, move namespaces 2018-03-19 19:05:51 +00:00
Dylan K. Taylor
ac5a91b67e Cleaned up bool comparison mess 2018-03-19 14:10:55 +00:00
Dylan K. Taylor
8a0414f306 Server: Changed logic of isLevelGenerated() to prevent astonishing behaviour
Previously to this, a level would be considered "not generated" if no level providers registered as valid for that directory. This caused astonishing behaviour when the user's world has, for example, a mixture of .mca and .mcr region files - the world would instead get _re-generated_ according to the default level format, which might or might not load the existing regions depending on the format used for generation. This behaviour is utterly absurd.

This changes the behaviour of the generated check to check for a non-empty directory in the given path. Non-empty directories without recognized world files in them are now considered to have an unknown format.
2018-03-12 10:24:59 +00:00
Dylan K. Taylor
fa6d44ea9e Move Attribute and Effect init calls to Entity::init()
since entities are dependent on these, they should be here.
2018-03-02 10:05:50 +00:00
Dylan K. Taylor
ee28296d60 Server: fixed authentication messages
why did I do this...
2018-03-01 09:32:04 +00:00
Dylan K. Taylor
06af742bef wtf 2018-03-01 09:30:50 +00:00
Dylan K. Taylor
6bdf5e15c0 Fixed a couple of mistakes in generateLevel() docs 2018-03-01 09:23:50 +00:00
Dylan K. Taylor
d4eba3f4b1 Moved some things out of Server to appropriate init() functions 2018-03-01 09:18:40 +00:00
Dylan K. Taylor
5a89e80873 Server: added getPlayerByUUID() and getPlayerByRawUUID()
closes #2047

Since the player list already indexes players by UUID, it's simple to just use that for fetching the player.

A possible future improvement could be to allow fetching an _offline_ player by UUID, but no capability to do that is yet available.
2018-03-01 09:09:34 +00:00
Dylan K. Taylor
973d5dc251 Small de-spaghettification of login handling
no need for these to be split up, it just makes the player login code flow look confusing.
2018-02-28 18:48:08 +00:00
Dylan K. Taylor
533d139385 Server: Move removePlayer() to somewhere more sensible 2018-02-28 18:28:36 +00:00
Dylan K. Taylor
629a254639 Server: stop reporting exceptions as "notice" in crashdumps 2018-02-28 10:57:25 +00:00
Dylan K. Taylor
d6d47feda9 Query: Send responses to the source interface only, instead of all the things
who the fuck wrote this shitty code?
2018-02-27 13:23:01 +00:00
Dylan K. Taylor
0ba1b58ee0 always takes 2 commits to do one simple thing...
I really love Golang being so strict on this.
2018-02-27 12:34:28 +00:00
Dylan K. Taylor
ab2df8b11b Removed Server->addRecipe()
This method is pointless extra bloat in Server. Use CraftingManager->registerRecipe() instead.
2018-02-27 12:33:32 +00:00
Dylan K. Taylor
f0535df96d Remove deprecated things 2018-02-27 11:59:16 +00:00
Dylan K. Taylor
f903dbfe00 Server: Removed identifiers array
This is completely unnecessary and adds extra complexity for no good reason. Maybe it was used historically, but nowadays it is only used to identify players to send async-prepared batch packets to.

There are two alternative ways to do that:
1. use spl_object_hash() as the targets array in CompressBatchedTask
2. use ServerScheduler's object storage to retain references to the Player[] array.

I've opted for the second method.

Removing these identifiers allows great code simplification in removePlayer() and removes the need for those old stupid hacks.

This also includes a backwards-compatibility break by removing the $identifier parameter of Server->addPlayer().
2018-02-27 11:43:02 +00:00
Dylan K. Taylor
6a996611f8 Move functions from PocketMine.php to Utils
This cleans a lot of mess out of the bootstrap file, and also has the added bonus that threads which do not inherit functions can now get access to them by autoloading Utils.
2018-02-19 11:56:22 +00:00
Dylan K. Taylor
eeaf75ac85 Server: add typehint to addPlayer() 2018-02-17 19:54:56 +00:00
Dylan K. Taylor
093cb5b39e Updated PocketMine-NBT dependency 2018-02-17 14:29:20 +00:00
Dylan K. Taylor
456987e212 ItemFactory: Don't initialize creative items in init()
Wanting initialized item factory does not require initializing the creative inventory. This is often useless and unwanted extra baggage (when this is used on threads for example).
2018-02-15 17:09:38 +00:00
Dylan K. Taylor
e7e4645c0b Fixed a wide range of bugs with floating-point coordinates getting incorrectly int-casted
This causes lots of bugs in negative coordinates.

This fixes #1789 after world load & save.
2018-02-15 10:27:42 +00:00
Dylan K. Taylor
6307952ae9 Server: bail on trying to send empty batch (issue #2020) 2018-02-14 09:12:52 +00:00
Dylan K. Taylor
98d6aea7fe Server: rename getResourcePackManager()
casual BC break, ain't nobody got time for deprecations!

closes #1797
2018-02-11 17:17:56 +00:00
Dylan K. Taylor
63fa6a36a9 Merge branch 'pr/1982' 2018-02-08 12:09:29 +00:00
Dylan K. Taylor
906d7eb176 Lang: Move TranslationContainer and TextContainer to \pocketmine\lang namespace
why the hell were they ever put in \pocketmine\event in the first place??

This change was suggested many months ago but I forgot all about it.
2018-02-04 20:03:30 +00:00
Dylan K. Taylor
bf3f5532ac Server: duct tape for very early startup crashes
Exceptions occurring early in the start sequence (before BaseLang is initialized) will result in the server hanging and not killing process as expected. This works around that issue.
2018-02-04 19:53:11 +00:00
Dylan K. Taylor
b659a3d39f Server: more shutdown debug 2018-02-04 10:14:35 +00:00
Dylan K. Taylor
f993358c5f fixed extremely stupid bug with player spawns
This was causing new players to inexplicably spawn in the wrong place when joining a world for the first time which had a different level name than folder name. With LevelDB worlds, this caused them to spawn wayyyy up at y=32767 for no good reason.
2018-02-02 16:00:28 +00:00
Dylan K. Taylor
9397356ce4 Server: fix crash when specifying settings.async-workers on the command-line 2018-02-01 17:58:49 +00:00
Oreo Oreo
54f7a88fbb Added getXuid() 2018-01-30 01:25:27 +03:00
Dylan K. Taylor
1fb3274f37 Server: Make start() private
This should not be exposed to plugin use.
2018-01-06 15:04:58 +00:00
Dylan K. Taylor
6772a69c55 Server: Prevent construction of more than one server instance at a time
I have no idea when one might choose to do this, but it could cause extremely undesirable effects, so it should be prevented.
2018-01-06 14:58:51 +00:00
Dylan K. Taylor
9a956692de Fixed wasteful throwaway objects used for spawn positions 2018-01-02 12:21:11 +00:00
Dylan K. Taylor
965c19375f NBT: Split up concerns of endianness and varint NBT into their own classes, separate stream handling from NBT class
The remaining methods, constants and fields in the NBT class now pertain to generic NBT functionality (except for the matchList()/matchTree() methods, but that's a job for another time). All NBT I/O specific logic has now been moved to NBTStream and its descendents.
2017-12-30 14:55:45 +00:00
Dylan K. Taylor
1896576a24 ResourcePackManager: Remove Server constructor dependency 2017-12-22 11:11:58 +00:00
Dylan K. Taylor
dfc2d1dfe6 Stop hardcoding src/pocketmine/resources everywhere 2017-12-11 19:52:49 +00:00
Dylan K. Taylor
1f1531810d Added \pocketmine\RESOURCE_PATH and Server->getResourcePath() 2017-12-11 19:52:20 +00:00
Dylan K. Taylor
98cb7f2e10 Removed redundant filePath from Server constructor
This parameter is hardcoded to \pocketmine\PATH in PocketMine.php. Additionally, it does not make sense for the server source path to not be the server source path. \pocketmine\PATH is accessible from the Server context, therefore it should be used and does not need to be stored.
2017-12-11 19:25:06 +00:00