PiggyArchive / PiggyAuth

Safe & feature-rich auth plugin. Project has been discontinued
Apache License 2.0
33 stars 8 forks source link

Server crash on restart with errors below #88

Closed nasiridrishi closed 7 years ago

nasiridrishi commented 7 years ago

DO NOT REMOVE THIS

Please make sure your issue complies with these guidelines:

General

Server Software:

Version of PiggyAuth:

Data Provider:

Steps to Reproduce the Issue

1.

Extra Information

Server crash 2-4 times continusly whenever server restarts:-

2017-06-17 [07:16:45] [Server thread/CRITICAL]: Error: "Call to a member function isAuthenticated() on null" (EXCEPTION) in "/PiggyAuth.phar/src/PiggyAuth/Main" at line 937
2017-06-17 [07:16:45] [Server thread/EMERGENCY]: An unrecoverable error has occurred and the server has crashed. Creating a crash dump
Aericio commented 7 years ago
Error: Call to a member function isAuthenticated() on null
File: /PiggyAuth.phar/src/PiggyAuth/Main
Line: 937
Type: notice

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: PiggyAuth v3.0.0.20

Code:
[928]      * @param Player $player
[929]      * @return bool
[930]      */
[931]     public function isTooManyIPOnline(Player $player)
[932]     {
[933]         $players = 0;
[934]         foreach ($this->getServer()->getOnlinePlayers() as $p) {
[935]             if ($p !== $player) {
[936]                 if ($p->getAddress() == $player->getAddress()) {
[937]                     if ($this->sessionmanager->getSession($p)->isAuthenticated()) {
[938]                         $players++;
[939]                     }
[940]                 }
[941]             }
[942]         }
[943]         return $players > ($this->getConfig()->getNested("login.ip-limit") - 1);
[944]     }
[945]
[946]     /**
[947]      * @param $password

Backtrace:
#0 /PiggyAuth.phar/src/PiggyAuth/Main(413): PiggyAuth\Main->isTooManyIPOnline(pocketmine\Player object)
#1 /PiggyAuth.phar/src/PiggyAuth/Tasks/AsyncLoginTask(130): PiggyAuth\Main->force(pocketmine\Player object, boolean 1, integer 0, NULL )
#2 /src/pocketmine/scheduler/AsyncPool(158): PiggyAuth\Tasks\AsyncLoginTask->onCompletion(pocketmine\Server object)
#3 /src/pocketmine/scheduler/ServerScheduler(339): pocketmine\scheduler\AsyncPool->collectTasks(boolean)
#4 /src/pocketmine/Server__64bit(2411): pocketmine\scheduler\ServerScheduler->mainThreadHeartbeat(integer 803)
#5 /src/pocketmine/Server__64bit(2179): pocketmine\Server->tick(boolean)
#6 /src/pocketmine/Server__64bit(2061): pocketmine\Server->tickProcessor(boolean)
#7 /src/pocketmine/Server__64bit(1646): pocketmine\Server->start(boolean)
#8 /src/pocketmine/PocketMine(501): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string phar:///home/gmplus/Factions/PocketMine-MP.phar/, string $
#9 (1): require(string phar:///home/gmplus/Factions/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
DaPigGuy commented 7 years ago

Should be fix. Notify me if it isn't.