634 Commits

Author SHA1 Message Date
Dylan K. Taylor
72690ea7f5 RakLibInterface: start RakLibServer with PTHREADS_INHERIT_NONE
this is now OK since the logger colours will be initialized on the fly.
2018-05-09 20:00:09 +01:00
Dylan K. Taylor
2a0a2134d1
Server: Implemented an signal/sleep interrupt mechanism for ticking (#2171)
This allows other threads to notify the main thread to wake it up while it's sleeping between ticks, allowing reduction of processing latency.

Currently only RakLib and the CommandReader threads utilize this, but it's planned to extend it to more things in the near future.

CommandReader is now event-driven instead of poll-based - the server will not poll the CommandReader thread for messages each tick anymore.

RakLib utilizes this mechanism to get packets processed without delays to lower latency.

This now adds an extra dependency - `pocketmine/snooze` library contains the meat of the code used for this. See the Snooze repository for details.
2018-05-09 14:18:13 +01:00
Dylan K. Taylor
e70af362d0 RCONInstance: fixup bad continues 2018-05-07 13:55:23 +01:00
Dylan K. Taylor
24aab8365e RCONInstance: remove redundant size ref param from readPacket() 2018-05-07 13:53:34 +01:00
Dylan K. Taylor
0e5504ed3f RCONInstance: add docs to fields, make 'stop' private 2018-05-07 13:52:33 +01:00
Dylan K. Taylor
83008440c0 RCONInstance: replace hardcoded status values with constants
I thought I'd seen the worst of PM, but I haven't.........
2018-05-07 13:44:59 +01:00
Dylan K. Taylor
b14dfa9f7e RCONInstance: Remove pointless code that makes pthreads segfault
pthreads doesn't play well with resources, and this code upsets it. Also, this code is utterly pointless.

The whole of RCON needs burning to the ground...
2018-05-07 10:05:05 +01:00
Dylan K. Taylor
f497e43db3 SourceInterface: removed redundant return value from process() 2018-05-05 15:30:46 +01:00
Dylan K. Taylor
295016cbc1 DisconnectPacket: fix decoding 2018-05-02 16:56:48 +01:00
Dylan K. Taylor
d8f4dde5f3 PlayerHotbarPacket: remove unused import 2018-05-01 14:09:17 +01:00
Dylan K. Taylor
58279d4cfe NetworkBinaryStream: fixed not decoding items with negative IDs correctly
negative IDs are used for new block-items.
2018-04-11 13:01:41 +01:00
Dylan K. Taylor
08d8adae5b fixup some ResourcePack TODOs 2018-04-07 13:09:44 +01:00
Dylan K. Taylor
8d988af7db EntityLink: added type constants 2018-04-07 11:35:36 +01:00
Dylan K. Taylor
db5890fddb Rename more unknown things in the protocol 2018-04-07 11:35:35 +01:00
Dylan K. Taylor
5b532fdcf5 Clean up on AddHangingEntityPacket and AddPaintingPacket
AddPainting is a subclass of AddHangingEntity in vanilla.
2018-04-07 11:35:35 +01:00
Dylan K. Taylor
e85fc54037 LevelSoundEventPacket: found unknown field
wtf mojang
2018-04-07 11:35:35 +01:00
Dylan K. Taylor
7fb237938c EntityLink: rename unknown field
close #1465
2018-04-07 11:35:35 +01:00
Dylan K. Taylor
9a5f9c8586 PlayerListPacket: fixup on platformChatId stuff 2018-04-07 11:35:35 +01:00
Dylan K. Taylor
4b16be7e0b PlayerListEntry: remove leftover TODO 2018-04-07 11:35:35 +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
3a10df634b Protocol bump for release 2018-04-04 11:13:36 +01:00
Dylan K. Taylor
3fe4ebc301 Found more unknown things 2018-04-04 11:03:36 +01:00
Dylan K. Taylor
d97abfaa7b Found some unknown things 2018-04-04 11:03:25 +01:00
Dylan K. Taylor
ebaef89e06 bump 2018-04-04 11:02:19 +01:00
Dylan K. Taylor
6ab0cff9d3 Bump for 1.2.13.10
doesn't appear that anything of interest has changed
2018-04-04 11:01:46 +01:00
Dylan K. Taylor
ae31ce1d25 LevelSoundEventPacket: updated sounds constants 2018-04-04 11:01:29 +01:00
Dylan K. Taylor
5ce55bd3b0 duct tape for block ID remapping 2018-04-04 11:00:39 +01:00
Dylan K. Taylor
c81f178cdb fix skins on 1.2.13.5
this is not the full changeset and more things are needed!
2018-04-04 10:59:09 +01:00
Dylan K. Taylor
fc795b80ae Protocol changes for 1.2.10 2018-04-04 10:58:49 +01:00
Dylan K. Taylor
eba1ca030c Fix variadic type docs ...again
PhpStorm changed its mind how it wants these documenting in 2018.1, and apparently the correct syntax follows the PHP code.
2018-04-02 12:33:24 +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
69c54de460 UPnP: remove useless 'or false' 2018-03-31 12:42:11 +01:00
Dylan K. Taylor
49622cc2a5 NetworkBinaryStream: simplify read of canPlaceOn and canDestroy lists 2018-03-30 11:07:29 +01:00
Dylan K. Taylor
f41a731493 DropItemAction: don't require a source item in constructor 2018-03-29 12:18:19 +01:00
Dylan K. Taylor
ec332e3e60 Fill null UUIDs in CraftingDataPacket, remove all UUID things from CraftingRecipe
This allows deleting lots of code, and additionally provides a huge reduction in the compressed size of CraftingDataPacket. Since we don't care about these UUIDs (they are only used in CraftingEventPacket, which is broken and unused in PM) we fill them with zeros instead.
2018-03-29 12:05:23 +01:00
Dylan K. Taylor
8572e9e560 Crafting: nuke
This commit brings in a much-needed rewrite of crafting transaction handling.

The following classes have been removed:
- CraftingTransferMaterialAction
- CraftingTakeResultAction

The following classes have significant changes:
- CraftingTransaction
	- All API methods have been removed and are now handled in CraftItemEvent
- CraftItemEvent
	- added the following:
		- getInputs()
		- getOutputs()
		- getRepetitions() (tells how many times a recipe was crafted in this event)
- Recipe interface:
	- Removed getResult() (individual recipes may handle this differently)
- CraftingRecipe interface
	- removed the following:
		- matchItems()
		- getExtraResults()
		- getAllResults()
	- added the following
		- getResults()
		- getIngredientList() : Item[], which must return a 1D array of items that should be consumed (wildcards accepted).
		- matchesCraftingGrid(CraftingGrid)
- ShapedRecipe
	- constructor now accepts string[], Item[], Item[]
- ShapelessRecipe
	- constructor now accepts Item[], Item[]
2018-03-29 12:05:22 +01:00
Dylan K. Taylor
e4b6a18404 Player: removed redundant proxy function 2018-03-23 19:56:35 +00: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
d12b1d3e07 Updated RakLib dependency 2018-03-17 11:27:56 +00:00
Dylan K. Taylor
8020780fc5 LevelEventPacket: added enderman teleport particle cloud constant 2018-03-09 17:20:35 +00:00
Dylan K. Taylor
dbcc69c2de LevelEventPacket: added useless constant 2018-03-09 11:35:08 +00:00
Dylan K. Taylor
83a3c6f614 Arrow: added shake effect and strike sound 2018-03-09 11:35:07 +00:00
Dylan K. Taylor
b623c4aba1 Remove accidentally committed file 2018-03-04 15:17:14 +00:00
Dylan K. Taylor
2ff3b12376 Cleaned up projectile "collide" checks 2018-03-04 12:19:41 +00:00
Dylan K. Taylor
6a94c8183c NetworkBinaryStream: Add clarification on array structure for gamerules
we need objects for this really
2018-02-28 18:10:47 +00:00
Dylan K. Taylor
732b931556 BatchPacket: use PacketPool::getPacket() instead of getPacketById()
this is what getPacket() is for.
2018-02-27 21:43:40 +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
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
0ad8ea6e92 Remove unused imports 2018-02-24 19:01:09 +00:00