menu
#10302472 Undefined variable $player

Submitted by PocketMine-MP 5.11.0

General information

Version: 5.11.0
Git commit: ce8fecc6
Plugin involvement: Direct
Report date: 2024-02-12 18:35:10 +0000 UTC
Server uptime: 0 days 0 hours 0 minutes 36 seconds

System Information

PHP version: 8.1.26
JIT status: Not available
Operating system: linux
System banner: Linux a80e14cd-ef29-42c8-b9e2-c81c3ea4fb9e 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64

Error information

Warning: the FedCore plugin was directly involved in this crash. Please contact the plugin author.
Thread: Main
Message: Undefined variable $player
File: plugins/FedCore/src/FreakCore/listener/events/player/CommandListener
Line: #17
Type: ErrorException
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use pocketmine\event\Listener;
use pocketmine\event\server\CommandEvent;

class CommandListener implements Listener {

public function blockCMD(CommandEvent $e) {
$sender = $e->getSender(); // Use getSender() instead of getPlayer()
$cmd = explode(" ", $e->getCommand())[0]; // Use getCommand() to get the full command string

if (isset(UserManager::$antyLogout[$player->getName()])) {
if (in_array($cmd, ["/tpa", "/tpaccept", "/tpdeny", "/dolacz", "/home",
"/spawn", "/deposit", "/kit", "/ec", "/schowek", "/ustawbaze", "/lider",
"/warp", "/sojusz", "/permisje", "/oficer", "/repair", "/repair-all", "/heal", "/feed", "/sklep", "/spawn", "/schowek", "/baza", "/dom", "/bazar", "/cx", "/depozyt"]) && !Main::getPermissionUtil()->has($player, "FREAKCORE.ANTYLOGOUT")) {
$player->sendMessage(ChatUtil::fixColors2("&cNie mozesz uzywac komend podczas walki!"));
$e->cancel();
}
}
}

}
#0 plugins/FedCore/src/FreakCore/listener/events/player/CommandListener(17): pocketmine\errorhandler\ErrorToExceptionHandler::handle(int 2, string[26] Undefined variable $player, string[88] /home/container/plugins/FedCore/src/FreakCore/listener/events/player/CommandList, int 17)
#1 pmsrc/src/event/RegisteredListener(61): FreakCore\listener\events\player\CommandListener->blockCMD(object pocketmine\event\server\CommandEvent#187672)
#2 pmsrc/src/event/Event(63): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\server\CommandEvent#187672)
#3 pmsrc/src/Server(1426): pocketmine\event\Event->call()
#4 pmsrc/src/player/Player(1512): pocketmine\Server->dispatchCommand(object pocketmine\player\Player#179478, string[3] top)
#5 pmsrc/src/network/mcpe/handler/InGamePacketHandler(821): pocketmine\player\Player->chat(string[4] /top)
#6 pmsrc/vendor/pocketmine/bedrock-protocol/src/CommandRequestPacket(55): pocketmine\network\mcpe\handler\InGamePacketHandler->handleCommandRequest(object pocketmine\network\mcpe\protocol\CommandRequestPacket#187665)
#7 pmsrc/src/network/mcpe/NetworkSession(462): pocketmine\network\mcpe\protocol\CommandRequestPacket->handle(object pocketmine\network\mcpe\handler\InGamePacketHandler#99042)
#8 pmsrc/src/network/mcpe/NetworkSession(400): pocketmine\network\mcpe\NetworkSession->handleDataPacket(object pocketmine\network\mcpe\protocol\CommandRequestPacket#187665, string[26] M./top..Mp.Y....k3l..!...J)
#9 pmsrc/src/network/mcpe/raklib/RakLibInterface(219): pocketmine\network\mcpe\NetworkSession->handleEncoded(string[76] ...e././`X.[p2.......9;..w00x.L`tx.rp.L....+..9O...............2.xz....R.0Y.)
#10 pmsrc/vendor/pocketmine/raklib-ipc/src/RakLibToUserThreadMessageReceiver(40): pocketmine\network\mcpe\raklib\RakLibInterface->onPacketReceive(int 0, string[85] .....#.......L....DTy..}$.?P.p.u:.g..X)..j>....j......\.:./...#.*v.k.W.U....8_.j)
#11 pmsrc/src/network/mcpe/raklib/RakLibInterface(111): raklib\server\ipc\RakLibToUserThreadMessageReceiver->handle(object pocketmine\network\mcpe\raklib\RakLibInterface#180465)
#12 pmsrc/src/TimeTrackingSleeperHandler(58): pocketmine\network\mcpe\raklib\RakLibInterface->pocketmine\network\mcpe\raklib\{closure}()
#13 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\TimeTrackingSleeperHandler->pocketmine\{closure}()
#14 pmsrc/src/TimeTrackingSleeperHandler(77): pocketmine\snooze\SleeperHandler->processNotifications()
#15 pmsrc/vendor/pocketmine/snooze/src/SleeperHandler(79): pocketmine\TimeTrackingSleeperHandler->processNotifications()
#16 pmsrc/src/Server(1699): pocketmine\snooze\SleeperHandler->sleepUntil(float 1707762910.835)
#17 pmsrc/src/Server(1067): pocketmine\Server->tickProcessor()
#18 pmsrc/src/PocketMine(341): pocketmine\Server->__construct(object pocketmine\thread\ThreadSafeClassLoader#6, object pocketmine\utils\MainLogger#3, string[16] /home/container/, string[24] /home/container/plugins/)
#19 pmsrc/src/PocketMine(364): pocketmine\server()
#20 pmsrc(11): require(string[60] phar:///home/container/PocketMine-MP.phar/src/PocketMine.php)

Loaded Plugins

  • Show

Server Settings

  • Show

Installed Composer Dependencies

Installed PHP Extensions

  • Show