コード例 #1
0
ファイル: Installer.php プロジェクト: rryy/PocketMine-MP
 public function __construct()
 {
     echo "[*] PocketMine-MP set-up wizard\n";
     echo "[*] Please select a language:\n";
     foreach (InstallerLang::$languages as $short => $native) {
         echo " {$native} => {$short}\n";
     }
     do {
         echo "[?] Language (en): ";
         $lang = strtolower($this->getInput("en"));
         if (!isset(InstallerLang::$languages[$lang])) {
             echo "[!] Couldn't find the language\n";
             $lang = false;
         }
     } while ($lang == false);
     $this->lang = new InstallerLang($lang);
     echo "[*] " . $this->lang->language_has_been_selected . "\n";
     if (!$this->showLicense()) {
         \pocketmine\kill(getmypid());
         exit(-1);
     }
     echo "[?] " . $this->lang->skip_installer . " (y/N): ";
     if (strtolower($this->getInput()) === "y") {
         return;
     }
     echo "\n";
     $this->welcome();
     $this->generateBaseConfig();
     $this->generateUserFiles();
     $this->networkFunctions();
     $this->endWizard();
 }
コード例 #2
0
ファイル: ServerKiller.php プロジェクト: robske110/ClearSky
 public function run()
 {
     $start = time();
     $this->synchronized(function () {
         $this->wait($this->time * 1000000);
     });
     if (time() - $start >= $this->time) {
         echo "\nTook too long to stop, server was killed forcefully!\n";
         @\pocketmine\kill(getmypid());
     }
 }
コード例 #3
0
 public function run()
 {
     sleep($this->time);
     echo "\nTook too long to stop, server was killed forcefully!\n";
     @\pocketmine\kill(getmypid());
 }