Commit Graph

35 Commits

Author SHA1 Message Date
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
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
cbbed6a6c1 Updated RakLib dependency 2018-02-19 10:01:56 +00:00
99ef3e6576 RakLibInterface: don't self-unregister from Network on crash
This is already done by the Network itself.
2018-02-18 11:52:55 +00:00
6954bfac4b Removed RakNet client ID parameters from Player
This is not used anywhere anymore and null is always filled for this, so it's pointless.

Also, this is an API break.
2018-02-17 19:51:04 +00:00
08daf655e5 RakLibInterface: Remove useless function 2018-02-16 17:57:43 +00:00
efac23d4af Updated to new RakLib version 2018-01-27 19:10:55 +00:00
0c868b16b6 Network: Added config to pocketmine.yml to allow changing max MTU size
This might be useful for people with older routers where the connection MTU is actually lower than the router allows.
2018-01-18 18:15:14 +00:00
f1b0a4f1de Not sure why we are still blaming @shoghicp for this :< 2018-01-15 11:17:01 +00:00
0d2b171c2c Remove RakLib and SPL submodules, start using Composer 2017-11-14 19:37:58 +00:00
fd0b07a0aa Added API to allow getting player latency 2017-11-06 14:33:27 +00:00
4981931c4a Remove reliability hacks for RakLib
bug was fixed in 691a7be66b
2017-10-11 10:59:27 +01:00
3f56d6ddc8 RakLibInterface: removed useless needACK condition 2017-09-18 09:42:25 +01:00
1e4cbb0dd9 RakLibInterface: move array initialization to default value
doesn't make sense to do this in the ctor when all the others are normal
2017-09-18 09:34:00 +01:00
2c6205e3f3 Added new events for network interface handling, close #1232 (#1250)
Added 
- NetworkInterfaceRegisterEvent (cancellable)
- NetworkInterfaceUnregisterEvent
- NetworkInterfaceCrashEvent
2017-09-06 11:22:10 +01:00
2603f5cc63 Fixed RakLib crashing when exceptions are thrown in packet handlers after the player was closed
This occurred if the player happened to be closed during the packet being handled, and then an uncaught exception bubbled up to the RakLibInterface. This resulted in a crash due to trying to get the address of a player who no longer had a network session, in order to block their IP address.
2017-09-01 20:22:02 +01:00
50580f4408 Added server ID proper to ping response, fixes #1208, closes #1306 2017-08-22 12:39:33 +01:00
ae3a8a5493 Added capability to unblock addresses without a restart 2017-08-14 14:12:06 +01:00
dbb92096e4 More typehints, documentation fixes and static analysis cleanup 2017-07-15 12:12:06 +01:00
6a191b5069 Remove useless condition 2017-07-13 19:59:01 +01:00
3a214b7ce6 Cleaned up isEncoded mess 2017-07-13 12:21:26 +01:00
30df0c2418 Refactor a bunch of network-related things for easier auto-generation of protocol stuff 2017-07-12 16:32:39 +01:00
be7e97e0bb Fixed server ping responses showing up in the wrong entries on the client
Seems it doesn't like negative numbers
2017-07-11 09:28:50 +01:00
409fc282d2 Cleaned up ping response and added missing fields (#1114) 2017-07-04 11:17:47 +01:00
789df942b6 Don't try to order packets sent with immediate priority, fixes #1026 2017-06-11 13:04:43 +01:00
51b0673b4b Bite the bullet and enable strict types on everything 2017-06-07 12:53:16 +01:00
77b1b565a4 Stop silently blocking people 2017-05-19 12:11:40 +01:00
be631ad6f7 Fixed disconnects properly 2017-04-21 20:31:47 +01:00
e47c7ea55f A bunch of really dirty hacks to get 1.1.0.0 working
Mojang: once again, what the hell have you done.
2017-04-01 19:18:15 +01:00
f75cc93160 HOW did nobody notice this?! 2017-04-01 14:08:02 +01:00
6ba4a8fe5c Moved batch packet handling into BatchPacket->handle(), fixed data packet receive timings to include MCPE packet decode time 2017-03-20 10:26:53 +00:00
9c350dbe47 Fixed DataPacketReceiveEvent, fixed packet receive timings, gave Player->handleDataPacket() a new use 2017-03-19 21:50:09 +00:00
005c2419e9 Fixed batched packets being encoded twice 2017-03-08 20:29:14 +00:00
ea0f291cb5 Added class method DataPacket->canBeBatched() 2017-03-08 20:28:40 +00:00
56990eb28b MCPE protocol gets its own namespace 2017-03-08 20:28:39 +00:00