From 6f8963bdcde5a5eebf89826e8a9990c5d5d6ee39 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 4 Jun 2013 10:58:11 +0200 Subject: [PATCH] Correct line offset in Plugins --- src/API/PluginAPI.php | 2 +- src/Player.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/API/PluginAPI.php b/src/API/PluginAPI.php index 74f5dab3..54d465ca 100644 --- a/src/API/PluginAPI.php +++ b/src/API/PluginAPI.php @@ -56,7 +56,7 @@ class PluginAPI extends stdClass{ }else{ $content = file_get_contents($file); $info = strstr($content, "*/", true); - $content = substr(strstr($content, "*/"),2); + $content = str_repeat(PHP_EOL, substr_count($info, "\n")).substr(strstr($content, "*/"),2); if(preg_match_all('#([a-zA-Z0-9\-_]*)=([^\r\n]*)#u', $info, $matches) == 0){ //false or 0 matches console("[ERROR] Failed parsing of ".basename($file)); return false; diff --git a/src/Player.php b/src/Player.php index 8295f18c..dc2a8446 100644 --- a/src/Player.php +++ b/src/Player.php @@ -828,12 +828,14 @@ class Player{ $arr = array(); for($i = $this->counter[1]; $i < $data[0]; ++$i){ $arr[] = $i; + ++$this->packetStats[1]; } $this->send(0xa0, array($arr)); $this->counter[1] = $data[0]; }elseif($diff === 1){ - $this->counter[1] = $data[0]; + $this->counter[1] = $data[0]; } + ++$this->packetStats[0]; $this->send(0xc0, array(array($data[0]))); }