239 Commits

Author SHA1 Message Date
Dylan K. Taylor
914dd90b3d
Use first-class closures in more places 2023-07-19 13:56:48 +01:00
Dylan K. Taylor
4aba9d9725
Absorb pocketmine/classloader into the core code
the only use for this class is to facilitate random runtime plugin loading, and it's not complete even for that purpose.

Since nothing but PM uses pocketmine/classloader anyway, it doesn't make sense to have it outside the core. As with LogPthreads, it's just adding more maintenance work.
2023-05-22 22:52:48 +01:00
Dylan K. Taylor
097feba4d5
Absorb pocketmine/log-pthreads into PM core
this was previously part of the abandoned package pocketmine/spl. It had to be separated in the PM3 days, because RakLib depended on it.

Since RakLib 0.13, RakLib stopped being dependent on or aware of pthreads, so it no longer depends on any thread-related packages.
It's also possible to absorb pocketmine/snooze and pocketmine/classloader back into the core with this in mind.
2023-05-20 16:57:24 +01:00
Dylan K. Taylor
e0630fbb25
pmmpthread support 2023-05-20 01:29:26 +01:00
Dylan K. Taylor
ee9ce8a4f4
Merge branch 'minor-next' into major-next 2023-05-17 15:45:03 +01:00
Dylan K. Taylor
599c4284f5
Introduce 10 KB threshold for async compression
due to the extremely large performance cost of instantiating AsyncTasks, it's usually not worth bothering with async compression except for very large packets.
While this large overhead can be significantly reduced by using specialized threads, it's early days in the testing stages for such improvements, and for now, we still have this to deal with.

Since async compression is always used prior to player spawn, this change may slightly improve the performance of the pre-join stage of the game.
2023-05-16 22:54:06 +01:00
Dylan K. Taylor
e0a6ec0c24
Start deglobalizing TypeConverter
there's a bunch of places we can't reach with this right now:

- particles
- sounds
- tile NBT
- entity metadata
- crafting data cache
- chunk encoding
- world block update encoding

this is a work in progress, but ultimately we want to get rid of these singletons entirely.
2023-05-06 17:47:09 +01:00
Dylan K. Taylor
01f340985a
Centralize all conversion-related stuff under TypeConverter
instead of having singletons for everything, which are a nightmare to manage for multi version
2023-05-03 16:33:17 +01:00
Dylan K. Taylor
ec2b53f61a
Remove unnecessary PacketBatch instantiations 2023-03-16 13:35:12 +00:00
Dylan K. Taylor
11ef6414b0
Server: remove deprecated method 2023-03-16 13:32:46 +00:00
Dylan K. Taylor
abd4ef01eb
Merge branch 'minor-next' into major-next 2023-03-15 23:02:41 +00:00
Dylan K. Taylor
337a254768
Use NetworkBroadcastUtils for broadcasting packets
this eradicates all but 4 usages of Server in Entity, which is extremely cool.
2023-03-15 22:28:51 +00:00
Dylan K. Taylor
a31e3331fd
Move Server::broadcastPackets() to NetworkBroadcastUtils::broadcastPackets()
this has no business being in Server, and it also doesn't need to be an instance method, since it never uses $this.
2023-03-15 22:25:23 +00:00
Dylan K. Taylor
cc8660629b
First look at shared EntityEventBroadcaster,
this improves performance in PvP servers and other areas where lots of players or entities exist in one space.

fixes #5622
2023-03-15 18:22:56 +00:00
Dylan K. Taylor
e7e19abe85
IPv4 and IPv6 RakLibInterface instances now both use the same broadcaster and context
fixes #5625
2023-03-15 17:17:56 +00:00
Dylan K. Taylor
6db2b022fb
Merge branch 'next-minor' into next-major 2023-03-04 16:58:03 +00:00
Dylan K. Taylor
a523189149
Added separate timings for broadcast and session buffer compression 2023-03-04 16:41:41 +00:00
Dylan K. Taylor
aaec21f544
Compressor: Use minCompressionThreshold exclusively
closes #5589
2023-03-04 15:07:50 +00:00
Dylan K. Taylor
5854b1c8c2
Merge branch 'next-minor' into next-major 2023-02-22 22:51:51 +00:00
Dylan K. Taylor
8234360c8d
Avoid creating batch buffers just to determine whether a batch should be globally compressed
Instead, sum together the lengths of encoded packet buffers and use that to decide whether to build the buffer or not.
2023-02-22 22:43:10 +00:00
Dylan K. Taylor
cfa1e7486a
Move legacy recipes and creative items in-house
having them here allows BedrockData to represent latest versions freely, without being limited by technical limitations of PM4.
2023-02-02 15:25:03 +00:00
Dylan K. Taylor
3a13f5cf5f
Merge branch 'next-minor' into next-major 2023-01-16 19:56:51 +00:00
Dylan K. Taylor
edb8f19a0c
Merge branch 'stable' into next-minor 2023-01-16 19:56:38 +00:00
Dylan K. Taylor
0bb9fb09cc
CS again 2023-01-16 19:39:24 +00:00
Dylan K. Taylor
ab21fcdd67
Server: fixed load statistics not including Snooze processing time
this has been a bug ever since Snooze was first introduced. The load statistic, similarly to timings, did not account for time spent processing notifications between ticks. The problem is that this is often where a significant amoutn of the load actually comes from, because Snooze is most often activated due to incoming packets.

This change fixes the problem by including the time spent processing notifications since the previous tick in the current tick's usage metric.
2023-01-16 19:26:32 +00:00
Dylan K. Taylor
d9b8251f7b
Merge branch 'next-minor' into next-major 2023-01-16 18:31:51 +00:00
Dylan K. Taylor
ad6a423d12
Merge branch 'stable' into next-minor 2023-01-16 18:30:13 +00:00
Dylan K. Taylor
c2c529e2da
Include Snooze interrupts in timings results
fixes #5511

This requires any Timings instances to be updated to
pmmp/timings@5410f62436, otherwise the TPS
reported will be incorrect.
2023-01-16 17:40:39 +00:00
Dylan K. Taylor
c55e23a2c6
Localized disconnect message for spawn selection failure 2023-01-14 20:59:27 +00:00
Dylan K. Taylor
5c2ed210fc
Merge branch 'next-minor' into next-major 2023-01-14 20:53:41 +00:00
Dylan K. Taylor
289e86e899
Make use of World::requestSafeSpawn() 2023-01-14 17:55:00 +00:00
Dylan K. Taylor
8909aa6a18
Merge branch 'next-minor' into next-major 2023-01-13 17:29:25 +00:00
Dylan K. Taylor
dff3f45d22
Constify more tick-related things 2023-01-13 16:29:09 +00:00
Dylan K. Taylor
1e17d86421
Constify server TPS and server tick time
this makes it significantly easier to perform experiments involving the server TPS.
2023-01-13 16:03:15 +00:00
Dylan K. Taylor
7ac6bd79a9
Localized remaining disconnection screens (except one or two that should never actually happen) 2022-12-27 20:05:59 +00:00
Dylan K. Taylor
c89df7eb1c
Merge remote-tracking branch 'origin/next-minor' into next-major 2022-12-25 18:22:13 +00:00
Dylan K. Taylor
0d169b4e80
Filesystem: added fileGetContents to reduce ErrorToExceptionHandler boilerplate code 2022-12-25 17:13:51 +00:00
Dylan K. Taylor
2a81a421f3
Merge branch 'next-minor' into next-major 2022-12-24 17:23:30 +00:00
Dylan K. Taylor
9010b2743c
Move player data storage handling behind an interface 2022-12-23 18:58:49 +00:00
Dylan K. Taylor
6e2685cbbb
Merge branch 'next-minor' into next-major 2022-12-18 22:25:32 +00:00
Dylan K. Taylor
bf44edd179
Constify a bunch of NBT keys, pass 1 2022-12-18 22:12:15 +00:00
Dylan K. Taylor
4d79aced07
Merge branch 'next-minor' into next-major 2022-12-15 19:50:27 +00:00
Dylan K. Taylor
99996b62d6
Align PhpDoc @param tags according to PHP-CS-Fixer 2022-12-06 13:21:20 +00:00
Dylan K. Taylor
fdb07cdbcd
Added more missing native types according to 8.0 standards 2022-11-23 14:21:38 +00:00
Dylan K. Taylor
9f6c6b2b71
Merge branch 'next-minor' into next-major 2022-10-16 16:58:50 +01:00
Dylan K. Taylor
b74c092d9b
Server: removed reference to nonexistent API method 2022-10-15 15:06:43 +01:00
Dylan K. Taylor
53cae8911d
Merge branch 'next-minor' into next-major 2022-10-14 21:53:25 +01:00
Dylan K. Taylor
7bcc663b60
Migrate core code to using symfony/filesystem
webmozart/path-util is retained for plugin compatibility, but is dropped in 5.0
2022-10-14 21:51:29 +01:00
Dylan K. Taylor
b3bda788d9
Server: Deprecated getPlayerByPrefix()
this is only used for commands anyway, but we can't get rid of it yet.
2022-10-14 21:45:09 +01:00
Dylan K. Taylor
2cc8a56e68
Server: fixed borked serverCommand timings 2022-10-14 20:02:44 +01:00