ecoron / SimpleAuth

Plugin for PocketMine-MP that prevents people to impersonate an account, requering registration and login when connecting.
GNU Lesser General Public License v3.0
3 stars 1 forks source link

SimpleAuth crashes if server is full #1

Closed ecoron closed 9 years ago

ecoron commented 9 years ago

The 1.8.0 fork of SimpleAuth crashes when one player above max players joins (they get kicked with "server full"). Note that Shoghi made some code changes to the UUID; so we may need a new approach for fixing SimpleAuth and PurePerms:

https://github.com/PocketMine/PocketMine-MP/commit/ed559fdf98456b9bb6ff77c1bf09da397f91ecf8

The error that occurs when you have 2/2 players in server and attempt to connect a third player is:

Error: Call to a member function toString() on null
File: /SimpleAuth_v1.8.0.phar/src/SimpleAuth/task/ShowMessageTask
Line: 47
Type: E_ERROR

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: SimpleAuth v1.8.0

Code:
[38]            return $this->owner;
[39]    }
[40] 
[41]    public function addPlayer(Player $player){
[42]        $uuid = $player->getUniqueId()->toString();
[43]            $this->playerList[$uuid] = $player;
[44]    }
[45] 
[46]    public function removePlayer(Player $player){
[47]        $uuid = $player->getUniqueId()->toString();
[48]            unset($this->playerList[$uuid]);
[49]    }
[50] 
[51]    public function onRun($currentTick){
[52]            $plugin = $this->getPlugin();
[53]            if($plugin->isDisabled()){
[54]                    return;
[55]            }
[56] 
[57]            foreach($this->playerList as $player){

Backtrace:
#0 (): pocketmine\Server->crashDump(boolean)

PocketMine-MP version: 1.6dev #29 [Protocol 34; API 1.13.0]

I wonder if the uuid data is null because the player has already been kicked for "server full" before SimpleAuth gets a chance to run.

reported by: @BlindTail

ecoron commented 9 years ago

there is a new version 1.8.1 which should no more crash if a player is entering a full server.

BlindTail commented 9 years ago

This is working great! Thank you for this!

Tested against newest PocketMine-MP_1.6dev-30_mcpe-0.12_86c11986_API-1.13.0.phar

Unfortunately there doesn't seem to be a version of PurePerms that does not crash when server is full. Both your modified version and the release version still crash with

Error: Call to a member function toString() on null File: /PurePerms_v1.1.12-PMv1.6dev.phar/src/_64FF00/PurePerms/PurePerms Line: 661

ecoron commented 9 years ago

yes i know i'm still on it to provide also a customized PurePerms version