예제 #1
0
파일: lou.php 프로젝트: rbraband/LouCes
 private function analyse_json($string)
 {
     try {
         $decode = JSON::Decode($string, true);
         if (is_array($decode) && $decode != null) {
             foreach ($decode as $k => $v) {
                 if (@array_key_exists('C', $v) && $v['C'] == SYS && $v['D'] == KICKED) {
                     $this->error = KICKED;
                     $this->output("LoU kicked :(");
                     $this->connected = false;
                     return false;
                 } else {
                     if (@array_key_exists('C', $v) && $v['C'] == SYS && $v['D'] == CLOSED) {
                         $this->error = CLOSED;
                         $this->output("LoU close :(");
                         $this->connected = false;
                         return false;
                     }
                 }
                 if (@array_key_exists('C', $v) && $v['C'] == VERSION) {
                     continue;
                 }
             }
             return $decode;
         }
     } catch (Exception $e) {
         $this->output($e);
     }
     return false;
 }