Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.3
- * @ Author : DeZender
- * @ Release on : 06.05.2013
- * @ Official site : http://DeZender.Net
- *
- */
- class InfoController extends Controller {
- private function get_http_response($url) {
- $timeout = 30;
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, false);
- curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- if (preg_match("`^https://`i", $url)) {
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- }
- curl_setopt($ch, CURLOPT_HEADER, true);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_NOBODY, true);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; PPC Mac OS X 10_5_8) AppleWebKit/534.50.2 (KHTML, like Gecko) Version/5.0.6 Safari/533.22.3");
- curl_exec($ch);
- $response = curl_exec($ch);
- $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- if (200 <= $http_code && $http_code < 400) {
- return true;
- }
- if ($response) {
- return true;
- }
- return false;
- }
- public function onlinePlayers() {
- $cache = new Cache("onlinePlayers");
- $playersOnline = array();
- if ($cache->isExpired("connected") || $cache->retrieve("connected") == null) {
- $this->loadModel("Online");
- $this->loadModel("Servers");
- $this->loadModel("Commands");
- $socket = new Socket();
- $ping = new Ping();
- $servers = $this->Online->listed();
- $onlinePlayers = array();
- foreach ($servers as $server) {
- if (!$server->online_etat) {
- continue;
- }
- if ($server->online_method == "ping") {
- .........................................................................
- ........................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement