Sergittos / BedWars

🛏️ BedWars for PocketMine-MP
GNU Lesser General Public License v3.0
26 stars 6 forks source link

Fix crashs #32

Closed UnknownNull closed 7 months ago

UnknownNull commented 8 months ago

This bug is created in special cases, for example, disconnection of the player if the code is continuing.

Sergittos commented 8 months ago

I don't think this is the right way to fix this, the player should be always connected

UnknownNull commented 8 months ago

I don't think this is the right way to fix this, the player should be always connected

Thread: Main Error: Player is not connected File: pmsrc/src/player/Player Line: 607 Type: LogicException Backtrace:

0 pmsrc/src/player/Player(2095): pocketmine\player\Player->getNetworkSession()

1 pmsrc/src/Server(1321): pocketmine\player\Player->sendMessage(string[80] ..1[BLUE] ..7amirali_3456: ................ ................. ..................)

2 pmsrc/src/player/Player(1518): pocketmine\Server->broadcastMessage(string[80] ..1[BLUE] ..7amirali_3456: ................ ................. .................., array[5])

3 pmsrc/src/network/mcpe/handler/InGamePacketHandler(157): pocketmine\player\Player->chat(string[42] .............. .............. ............)

4 pmsrc/vendor/nethergamesmc/bedrock-protocol/src/TextPacket(164): pocketmine\network\mcpe\handler\InGamePacketHandler->handleText(object pocketmine\network\mcpe\protocol\TextPacket#209770)

5 pmsrc/src/network/mcpe/NetworkSession(517): pocketmine\network\mcpe\protocol\TextPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#408178)

6 pmsrc/src/network/mcpe/NetworkSession(455): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\TextPacket#209770, string[61] ....amirali_3456*.............. .............. ..............)

7 pmsrc/src/network/mcpe/raklib/RakLibInterface(219): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[110] ..dd.I..,J...7615....v...7V..x..f....7..l..z..f....7V.Z....108L`.*..0..SF.B."..)

8 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(40): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 19, string[119] .=......nc..p..9..H.c..q8.|.w+...O.,H.0-o..P..R~.R3x>W......G......#.^`.N..t....)

9 pmsrc/src/network/mcpe/raklib/RakLibInterface(111): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#198422)

10 pmsrc/src/TimeTrackingSleeperHandler(58): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib{closure}()

11 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\TimeTrackingSleeperHandler->pocketmine{closure}()

12 pmsrc/src/TimeTrackingSleeperHandler(77): pocketmine\snooze\SleeperHandler->processNotifications()

13 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(79): pocketmine\TimeTrackingSleeperHandler->processNotifications()

14 pmsrc/src/Server(1716): pocketmine\snooze\SleeperHandler->sleepUntil(float 1706560385.6368)

15 pmsrc/src/Server(1090): pocketmine\Server->tickProcessor()

16 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[51] C:\Users\Administrator\Documents\MV - RL\5.BedWars\, string[59] C:\Users\Administrator\Documents\MV - RL\5.BedWars\plugins)

17 pmsrc/src/PocketMine(364): pocketmine\server()

18 pmsrc(11): require(string[95] phar://C:/Users/Administrator/Documents/MV - RL/5.BedWars/PocketMine-MP.phar/src)

UnknownNull commented 8 months ago

I don't think this is the right way to fix this, the player should be always connected

With these changes, crashes sometimes occur to me due to the player not being connected and the execution of a part of the code related to the player.

error: https://github.com/Sergittos/BedWars/pull/32#issuecomment-1921318933

xwertxy commented 8 months ago

I don't think this is the right way to fix this, the player should be always connected

With these changes, crashes sometimes occur to me due to the player not being connected and the execution of a part of the code related to the player.

error: #32 (comment)

This happends when you use NetherGames fork of Pocketmine-MP.

UnknownNull commented 8 months ago

I don't think this is the right way to fix this, the player should be always connected

With these changes, crashes sometimes occur to me due to the player not being connected and the execution of a part of the code related to the player. error: #32 (comment)

This happends when you use NetherGames fork of Pocketmine-MP.

Why? I really do not understand the reason.

I was also using pocketmine and faced the same error, but less...

UnknownNull commented 7 months ago

I tested again with the original version of Pocketmine and this crash occurred again

xwertxy commented 7 months ago

This is not way to change/fix this, there's no need to cache the player class. We just need to replace Session->getPlayer() function returning value to Server->getPlayerExact() : Player.

Sergittos commented 7 months ago

Closed as I'm not able to reproduce this problem