Advertisement
Guest User

Emulator Checker

a guest
Apr 16th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. <?php
  2.  class Emu_status {
  3.   public $host;
  4.   public $port;
  5.   public $emusocket;
  6.  
  7.   public function __construct(){
  8.    $this->host = '127.0.0.1';
  9.    $this->port = 30000;
  10.    $this->emusocket = fsockopen($this->host, $this->port, $errno, $errstr, 10);
  11.   }
  12.  
  13.   public function emu_ist_an(){
  14.    if($this->emusocket){
  15.     return true;
  16.    }
  17.    return false;
  18.   }
  19.  }
  20.  $emu_status = new Emu_status;
  21.  
  22.  if($emu_status->emu_ist_an() == true){
  23.   # Der Emulator ist geöffnet
  24. } else {
  25.   # Der Emulator ist nicht geöffnet
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement