mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
Updated the compile script
This commit is contained in:
parent
59763a35c7
commit
2a8c72dfc2
@ -15,12 +15,12 @@ DIR=`pwd`
|
|||||||
date > "$DIR/install.log" 2>&1
|
date > "$DIR/install.log" 2>&1
|
||||||
uname -a >> "$DIR/install.log" 2>&1
|
uname -a >> "$DIR/install.log" 2>&1
|
||||||
echo "[INFO] Checking dependecies"
|
echo "[INFO] Checking dependecies"
|
||||||
type make >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"make\""; exit 1; }
|
type make >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"make\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type autoconf >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"autoconf\""; exit 1; }
|
type autoconf >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"autoconf\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type automake >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; exit 1; }
|
type automake >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type libtool >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"libtool\""; exit 1; }
|
type libtool >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"libtool\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type gcc >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\""; exit 1; }
|
type gcc >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; exit 1; }
|
type m4 >> "$DIR/install.log" 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; read -p "Press [Enter] to continue..."; exit 1; }
|
||||||
|
|
||||||
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
rm -r -f install_data/ >> "$DIR/install.log" 2>&1
|
||||||
rm -r -f php5/ >> "$DIR/install.log" 2>&1
|
rm -r -f php5/ >> "$DIR/install.log" 2>&1
|
||||||
|
@ -229,7 +229,7 @@ class ServerAPI{
|
|||||||
"protocol" => CURRENT_PROTOCOL,
|
"protocol" => CURRENT_PROTOCOL,
|
||||||
"online" => count($this->server->clients),
|
"online" => count($this->server->clients),
|
||||||
"max" => $this->server->maxClients,
|
"max" => $this->server->maxClients,
|
||||||
));
|
), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct(){
|
public function __destruct(){
|
||||||
|
@ -26,9 +26,6 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class Async extends Thread {
|
class Async extends Thread {
|
||||||
/**
|
|
||||||
* Provide a passthrough to call_user_func_array
|
|
||||||
**/
|
|
||||||
public function __construct($method, $params = array()){
|
public function __construct($method, $params = array()){
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
$this->params = $params;
|
$this->params = $params;
|
||||||
@ -36,9 +33,6 @@ class Async extends Thread {
|
|||||||
$this->joined = false;
|
$this->joined = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The smallest thread in the world
|
|
||||||
**/
|
|
||||||
public function run(){
|
public function run(){
|
||||||
if(($this->result=call_user_func_array($this->method, $this->params))){
|
if(($this->result=call_user_func_array($this->method, $this->params))){
|
||||||
return true;
|
return true;
|
||||||
@ -47,19 +41,13 @@ class Async extends Thread {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Static method to create your threads from functions ...
|
|
||||||
**/
|
|
||||||
public static function call($method, $params = array()){
|
public static function call($method, $params = array()){
|
||||||
$thread = new Async($method, $params);
|
$thread = new Async($method, $params);
|
||||||
if($thread->start()){
|
if($thread->start()){
|
||||||
return $thread;
|
return $thread;
|
||||||
} /** else throw Nastyness **/
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Do whatever, result stored in $this->result, don't try to join twice
|
|
||||||
**/
|
|
||||||
public function __toString(){
|
public function __toString(){
|
||||||
if(!$this->joined){
|
if(!$this->joined){
|
||||||
$this->joined = true;
|
$this->joined = true;
|
||||||
|
@ -354,10 +354,11 @@ class Utils extends Thread{
|
|||||||
return microtime(true);
|
return microtime(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function curl_get($page){
|
public static function curl_get($page, $timeout = 10){
|
||||||
if(Utils::$online === false){
|
if(Utils::$online === false){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ch = curl_init($page);
|
$ch = curl_init($page);
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 PocketMine-MP"));
|
curl_setopt($ch, CURLOPT_HTTPHEADER, array("User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0 PocketMine-MP"));
|
||||||
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
|
||||||
@ -365,7 +366,7 @@ class Utils extends Thread{
|
|||||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
|
||||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
|
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, (int) $timeout);
|
||||||
$ret = curl_exec($ch);
|
$ret = curl_exec($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
return $ret;
|
return $ret;
|
||||||
@ -375,6 +376,7 @@ class Utils extends Thread{
|
|||||||
if(Utils::$online === false){
|
if(Utils::$online === false){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ch = curl_init($page);
|
$ch = curl_init($page);
|
||||||
curl_setopt($ch, CURLOPT_POST, 1);
|
curl_setopt($ch, CURLOPT_POST, 1);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $args);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user