public function updateFaction()
{
$this->plugin->getServer()->getLogger()->info("Updating Faction...");
foreach($this->plugin->getFactions() as $faction)
{
$this->plugin->getServer()->getLogger()->info("test");
if($faction->hasPlayer($this->player))
{
$this->faction = $faction->getName();
return true;
}
$this->faction = null;
}
}
When I run this code (using the Pocketmine API) in the console it prints out "Updating Faction..." but never reaches the next line and doesn't print out "test". I feel like there is some stupid error I'm just not seeing here, but it's got me stumped.
I experience this when I moved a script from php5.5 to php 5.2 server.After several hours, I figured-out that the problem was due to the line termination characters. Hence lines terminating with CRLF get executed and those terminating with CR gets skipped. To solve this problem I simply copied the the script to notepad (or any basic text editor) and save back to the same file and everything worked like it did on the 5.5 server.