HiddenMotives / VPNGuard

PocketMine-MP Plugin: VPNGuard will prevent players from joining your server behind any type of anonymizer.
MIT License
20 stars 12 forks source link

Error: "Call to a member function broadcastPacketToViewers() on null" (EXCEPTION) in "src/pocketmine/entity/Entity" at line 1218 #19

Open teracube opened 5 years ago

teracube commented 5 years ago

@HiddenMotives @DarkWav

https://poggit.pmmp.io/r/49539/VPNGuard_dev-17.phar with latest stable PMMP build https://jenkins.pmmp.io/job/PocketMine-MP/1737/artifact/PocketMine-MP.phar

issue when a banned ip player try to connect

[Server thread/INFO]: [VPNGuard] Player GamerMCY has connected with the IP: 88.XXX.XXX.220
2019-01-20 [08:13:49] [Server thread/INFO]: GamerMCY [-]
2019-01-20 [08:13:49] [Server thread/INFO]: GamerMCY[/88.XXX.XXX.220:56053] logged out due to Votre sous-réseau IP est banni !
2019-01-20 [08:13:49] [Server thread/INFO]: [VPNGuard] GamerMCY has been disconnected for being in the subnet 88.XXX.XXX.220/32 which is banned.
2019-01-20 [08:13:49] [Server thread/INFO]: GamerMCY [+]
2019-01-20 [08:13:49] [Server thread/CRITICAL]: Error: "Call to a member function broadcastPacketToViewers() on null" (EXCEPTION) in "src/pocketmine/entity/Entity" at line 1218
2019-01-20 [08:13:49] [Server thread/DEBUG]: #0 src/pocketmine/Player(1688): pocketmine\entity\Entity->broadcastMotion()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(1924): pocketmine\Player->setMotion(pocketmine\math\Vector3 object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #2 src/pocketmine/Player(3733): pocketmine\entity\Entity->teleport(pocketmine\level\Position object, NULL , NULL )
2019-01-20 [08:13:49] [Server thread/DEBUG]: #3 src/pocketmine/Player(3644): pocketmine\Player->teleport(pocketmine\level\Position object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #4 src/pocketmine/Player(1098): pocketmine\Player->respawn()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(296): pocketmine\Player->doFirstSpawn()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/protocol/SetLocalPlayerAsInitializedPacket(45): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleSetLocalPlayerAsInitialized(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/protocol/BatchPacket(119): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #9 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #10 src/pocketmine/Player(3097): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #11 src/pocketmine/network/mcpe/RakLibInterface(170): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #12 vendor/pocketmine/raklib/src/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 88.XXX.XXX.220 56053, raklib\protocol\EncapsulatedPacket object, integer 0)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #13 src/pocketmine/network/mcpe/RakLibInterface(110): raklib\server\ServerHandler->handlePacket()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #14 src/pocketmine/network/mcpe/RakLibInterface(100): pocketmine\network\mcpe\RakLibInterface->process()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #15 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #16 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #17 src/pocketmine/Server(2349): pocketmine\snooze\SleeperHandler->sleepUntil(double 1547968429.358)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #18 src/pocketmine/Server(2209): pocketmine\Server->tickProcessor()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #19 src/pocketmine/Server(1785): pocketmine\Server->start()
2019-01-20 [08:13:49] [Server thread/DEBUG]: #20 src/pocketmine/PocketMine(249): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/gsp_1485/g3.hmserv.eu-19144/, string /home/gsp_1485/g3.hmserv.eu-19144/plugins/)
2019-01-20 [08:13:49] [Server thread/DEBUG]: #21 (1): require(string phar:///home/gsp_1485/g3.hmserv.eu-19144/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
2019-01-20 [08:13:49] [RakLibServer thread/NOTICE]: Blocked 88.XXX.XXX.220 for 5 seconds
DarkWav commented 5 years ago

RIP, this will be hard......

DarkWav commented 5 years ago

OK I think i figured out the problem. I think I now got an actual fix, not just a borked workaround like in patch 1. Try patch-2: API 3.0.0 | API 4.0.0

teracube commented 5 years ago

@DarkWav I tried patch-2: API 3.0.0 and i have same error

2019-01-21 [20:36:44] [Server thread/INFO]: [VPNGuard] Player FunGamerMC77 has connected with the IP: 88.XXX.XXX.220
2019-01-21 [20:36:44] [Server thread/INFO]: FunGamerMC77 [-]
2019-01-21 [20:36:44] [Server thread/INFO]: FunGamerMC77[/88.XXX.XXX.220:48026] logged out due to Kicked by admin. Reason: Votre sous-réseau IP est banni !
2019-01-21 [20:36:44] [Server thread/INFO]: [VPNGuard] FunGamerMC77 has been disconnected for being in the subnet 88.XXX.XXX.220/32 which is banned.
2019-01-21 [20:36:44] [Server thread/INFO]: FunGamerMC77 [+]
2019-01-21 [20:36:44] [Server thread/CRITICAL]: Error: "Call to a member function broadcastPacketToViewers() on null" (EXCEPTION) in "src/pocketmine/entity/Entity" at line 1218
2019-01-21 [20:36:44] [Server thread/DEBUG]: #0 src/pocketmine/Player(1688): pocketmine\entity\Entity->broadcastMotion()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(1924): pocketmine\Player->setMotion(pocketmine\math\Vector3 object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #2 src/pocketmine/Player(3733): pocketmine\entity\Entity->teleport(pocketmine\level\Position object, NULL , NULL )
2019-01-21 [20:36:44] [Server thread/DEBUG]: #3 src/pocketmine/Player(3644): pocketmine\Player->teleport(pocketmine\level\Position object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #4 src/pocketmine/Player(1098): pocketmine\Player->respawn()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(296): pocketmine\Player->doFirstSpawn()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/protocol/SetLocalPlayerAsInitializedPacket(45): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleSetLocalPlayerAsInitialized(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/protocol/BatchPacket(119): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #9 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #10 src/pocketmine/Player(3097): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #11 src/pocketmine/network/mcpe/RakLibInterface(170): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #12 vendor/pocketmine/raklib/src/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 88.XXX.XXX.220 48026, raklib\protocol\EncapsulatedPacket object, integer 0)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #13 src/pocketmine/network/mcpe/RakLibInterface(110): raklib\server\ServerHandler->handlePacket()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #14 src/pocketmine/network/mcpe/RakLibInterface(100): pocketmine\network\mcpe\RakLibInterface->process()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #15 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #16 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #17 src/pocketmine/Server(2349): pocketmine\snooze\SleeperHandler->sleepUntil(double 1548099404.0233)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #18 src/pocketmine/Server(2209): pocketmine\Server->tickProcessor()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #19 src/pocketmine/Server(1785): pocketmine\Server->start()
2019-01-21 [20:36:44] [Server thread/DEBUG]: #20 src/pocketmine/PocketMine(249): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/myserver/, string /home/myserver/plugins/)
2019-01-21 [20:36:44] [Server thread/DEBUG]: #21 (1): require(string phar:///home/myserver/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
2019-01-21 [20:36:44] [RakLibServer thread/NOTICE]: Blocked 88.XXX.XXX.220 for 5 seconds
HiddenMotives commented 5 years ago

Is this only when you use subnet banning or does this also occur when someone connects with a VPN and is kicked?

teracube commented 5 years ago

@HiddenMotives this concerns only 1 player in a week, a same player that his ip is subnet banned in banned.yml files on line 124 124: 88.XXX.XXX.220/32 json files { "status": "success", "package": "Basic", "ipaddress": "88.XXX.XXX.220", "host-ip": false, "org": "PROXAD" }

ip 88.XXX.XXX.220 is not a vpn

no others player is concerned at the moment

sorry for my bad english

teracube commented 5 years ago

@HiddenMotives @DarkWav

same issue today

https://jenkins.pmmp.io/job/PocketMine-MP/1744/artifact/PocketMine-MP.phar https://poggit.pmmp.io/r/49539/VPNGuard_dev-17.phar


2019-02-11 [09:07:17] [Server thread/INFO]: [VPNGuard] Player LyricKnot42783 has connected with the IP: 86.XXX.174.189
2019-02-11 [09:07:17] [Server thread/INFO]: LyricKnot42783 [-]
2019-02-11 [09:07:17] [Server thread/INFO]: LyricKnot42783[/86.XXX.174.189:56200] logged out due to Kicked by admin. Reason: Votre sous-réseau IP est banni !
2019-02-11 [09:07:17] [Server thread/INFO]: [VPNGuard] LyricKnot42783 has been disconnected for being in the subnet 86.XXX.174.189/32 which is banned.
2019-02-11 [09:07:17] [Server thread/INFO]: LyricKnot42783 [+]
2019-02-11 [09:07:17] [Server thread/CRITICAL]: Error: "Call to a member function broadcastPacketToViewers() on null" (EXCEPTION) in "src/pocketmine/entity/Entity" at line 1218
2019-02-11 [09:07:17] [Server thread/DEBUG]: #0 src/pocketmine/Player(1697): pocketmine\entity\Entity->broadcastMotion()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #1 src/pocketmine/entity/Entity(1924): pocketmine\Player->setMotion(pocketmine\math\Vector3 object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #2 src/pocketmine/Player(3746): pocketmine\entity\Entity->teleport(pocketmine\level\Position object, NULL , NULL )
2019-02-11 [09:07:17] [Server thread/DEBUG]: #3 src/pocketmine/Player(3657): pocketmine\Player->teleport(pocketmine\level\Position object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #4 src/pocketmine/Player(1103): pocketmine\Player->respawn()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(296): pocketmine\Player->doFirstSpawn()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/protocol/SetLocalPlayerAsInitializedPacket(45): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleSetLocalPlayerAsInitialized(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/protocol/BatchPacket(119): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\SetLocalPlayerAsInitializedPacket object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #9 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(108): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #10 src/pocketmine/Player(3110): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #11 src/pocketmine/network/mcpe/RakLibInterface(170): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #12 vendor/pocketmine/raklib/src/server/ServerHandler(99): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 86.XXX.174.189 56200, raklib\protocol\EncapsulatedPacket object, integer 0)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #13 src/pocketmine/network/mcpe/RakLibInterface(110): raklib\server\ServerHandler->handlePacket()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #14 src/pocketmine/network/mcpe/RakLibInterface(100): pocketmine\network\mcpe\RakLibInterface->process()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #15 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #16 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #17 src/pocketmine/Server(2349): pocketmine\snooze\SleeperHandler->sleepUntil(double 1549872437.2296)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #18 src/pocketmine/Server(2209): pocketmine\Server->tickProcessor()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #19 src/pocketmine/Server(1785): pocketmine\Server->start()
2019-02-11 [09:07:17] [Server thread/DEBUG]: #20 src/pocketmine/PocketMine(249): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string /home/teracube/, string /home/teracube/plugins/)
2019-02-11 [09:07:17] [Server thread/DEBUG]: #21 (1): require(string phar:///home/teracube/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
2019-02-11 [09:07:17] [RakLibServer thread/NOTICE]: Blocked 86.XXX.174.189 for 5 seconds