Beispiel #1
0
function Menu_Main()
{
    printt('========================');
    printt('\\E[0m[ \\E[33;1mMain Menu \\E[0m] \\E[31;1mSpawn Fetcher\\E[0m');
    printt('========================');
    printt('[ \\E[33;1ma\\E[0m ] - \\E[32mFetch Locations\\E[0m');
    printt('[ \\E[33;1mb\\E[0m ] - \\E[32mFetch Creatures\\E[0m');
    echo "\n";
    printt('[ \\E[31;1mx\\E[0m ] - \\E[31mQuit\\E[0m');
    $reply = readt();
    switch ($reply) {
        case 'a':
            Fetch_Locations();
            break;
        case 'b':
            /*			Fetch_Creatures();*/
            echo "Fetch_Creatures still under development, sorry!\n";
            break;
        case 'x':
            Quit();
            break;
    }
    Menu_Main();
}
Beispiel #2
0
 /**                                  
  * CheckHost
  * -------------------------
  * get server hostname and check for active status
  * in the `MUP.hardware.servers` database
  * -------------------------
  * @param string $HN // pass a specific hostname. false will use hostname where the script is running.
  * -------------------------
  **/
 public function CheckHost($HN = false)
 {
     $H = empty($HN) ? trim(strtolower(gethostname())) : $HN;
     $Q = $this->DB->GET('MUP.hardware.servers', ['type' => 'PMTA', 'active' => 1, 'name' => $H], ['name', 'id'], 1);
     if (isset($Q['name'])) {
         $this->hostname = $Q['name'];
         define('hostname', $this->hostname);
         $this->hostID = $Q['id'];
         define('hostID', $this->hostID);
     } else {
         Quit('Invalid Hostname!');
     }
 }