Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Help fixing FactionsPro ranks in PureChat

Comments in 'Plugin Development' started by Jazzwhistle, Mar 30, 2016.

  1. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Hi, I'm trying to work out why the following line returns false in PureChat (around line 466 in PureChat.php) :

    $this->factionsAPI->getPlayerFaction($player);

    A var_dump of this just before gives this:
    Code:
    30.03 12:54:48 [Server] INFO }
    30.03 12:54:48 [Server] INFO int(2)
    30.03 12:54:48 [Server] INFO ["type":"pocketmine\utils\Config":private]=>
    30.03 12:54:48 [Server] INFO bool(true)
    30.03 12:54:48 [Server] INFO ["correct":"pocketmine\utils\Config":private]=>
    30.03 12:54:48 [Server] INFO string(72) "/plugins/FactionsPro/Prefs.yml"
    30.03 12:54:48 [Server] INFO ["file":"pocketmine\utils\Config":private]=>
    30.03 12:54:48 [Server] INFO }
    30.03 12:54:48 [Server] INFO array(0) {
    30.03 12:54:48 [Server] INFO ["nestedCache":"pocketmine\utils\Config":private]=>
    30.03 12:54:48 [Server] INFO }
    30.03 12:54:48 [Server] INFO bool(true)
    30.03 12:54:48 [Server] INFO ["Developer Mode"]=>
    30.03 12:54:48 [Server] INFO int(10)
    30.03 12:54:48 [Server] INFO ["Maximum Players Per Faction"]=>
    30.03 12:54:48 [Server] INFO int(20)
    30.03 12:54:48 [Server] INFO ["Maximum Faction Name Length"]=>
    30.03 12:54:48 [Server] INFO bool(true)
    30.03 12:54:48 [Server] INFO ["Factions In Overhead Nametag"]=>
    30.03 12:54:48 [Server] INFO string(1) "*"
    30.03 12:54:48 [Server] INFO ["Officer Identifier"]=>
    30.03 12:54:48 [Server] INFO string(2) "**"
    30.03 12:54:48 [Server] INFO ["Leader Idenfitier"]=>
    30.03 12:54:48 [Server] INFO int(25)
    30.03 12:54:48 [Server] INFO ["PlotSize"]=>
    30.03 12:54:48 [Server] INFO bool(true)
    30.03 12:54:48 [Server] INFO ["OfficersCanClaim"]=>
    30.03 12:54:48 [Server] INFO bool(true)
    30.03 12:54:48 [Server] INFO ["OnlyLeadersAndOfficersCanInvite"]=>
    30.03 12:54:48 [Server] INFO int(10)
    30.03 12:54:48 [Server] INFO ["MaxPlayersPerFaction"]=>
    30.03 12:54:48 [Server] INFO int(20)
    30.03 12:54:48 [Server] INFO ["MaxFactionNameLength"]=>
    30.03 12:54:48 [Server] INFO array(11) {
    30.03 12:54:48 [Server] INFO ["config":"pocketmine\utils\Config":private]=>
    30.03 12:54:48 [Server] INFO object(pocketmine\utils\Config)#13434 (5) {
    30.03 12:54:48 [Server] INFO ["prefs"]=>
    30.03 12:54:48 [Server] INFO NULL
    30.03 12:54:48 [Server] INFO ["db"]=>
    30.03 12:54:48 [Server] INFO object(FactionsPro\FactionMain)#11893 (16) {
    30.03 12:54:48 [Server] INFO ["plugin":"FactionsPro\Faction":private]=>
    30.03 12:54:48 [Server] INFO }
    30.03 12:54:48 [Server] INFO string(6) "Leader"
    30.03 12:54:48 [Server] INFO ["testplayer"]=>
    30.03 12:54:48 [Server] INFO array(1) {
    30.03 12:54:48 [Server] INFO ["members":"FactionsPro\Faction":private]=>
    30.03 12:54:48 [Server] INFO string(4) "coolfacname"
    30.03 12:54:48 [Server] INFO ["name":"FactionsPro\Faction":private]=>
    30.03 12:54:48 [Server] INFO object(FactionsPro\Faction)#14833 (5) {
    

    and

    echo $this->factionsAPI->getPlayerFaction($player);

    just before PureChat tries to insert the fac name into the string gives:

    [Server] INFO bool(false)

    This then crashes the server as PureChat tries to perform str_replace on a boolean. I've checked everything in both PurePerms and it all looks good. Can anyone help?
    Last edited: Mar 30, 2016

Share This Page

Advertisement