Advertisement
Guest User

Untitled

a guest
Oct 13th, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Loader)
  6. *
  7. * @ Version : 2.0.0.3
  8. * @ Author : DeZender
  9. * @ Release on : 06.05.2013
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class InfoController extends Controller {
  15.  
  16. private function get_http_response($url) {
  17. $timeout = 30;
  18. $ch = curl_init($url);
  19. curl_setopt($ch, CURLOPT_FRESH_CONNECT, false);
  20. curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
  21. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
  22. if (preg_match("`^https://`i", $url)) {
  23. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  24. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  25. }
  26. curl_setopt($ch, CURLOPT_HEADER, true);
  27. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  29. curl_setopt($ch, CURLOPT_NOBODY, true);
  30. 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");
  31. curl_exec($ch);
  32. $response = curl_exec($ch);
  33. $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  34. curl_close($ch);
  35. if (200 <= $http_code && $http_code < 400) {
  36. return true;
  37. }
  38. if ($response) {
  39. return true;
  40. }
  41. return false;
  42. }
  43.  
  44.  
  45. public function onlinePlayers() {
  46. $cache = new Cache("onlinePlayers");
  47. $playersOnline = array();
  48. if ($cache->isExpired("connected") || $cache->retrieve("connected") == null) {
  49. $this->loadModel("Online");
  50. $this->loadModel("Servers");
  51. $this->loadModel("Commands");
  52. $socket = new Socket();
  53. $ping = new Ping();
  54. $servers = $this->Online->listed();
  55. $onlinePlayers = array();
  56. foreach ($servers as $server) {
  57. if (!$server->online_etat) {
  58. continue;
  59. }
  60. if ($server->online_method == "ping") {
  61. .........................................................................
  62. ........................................
  63. .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement