mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 04:17:48 +00:00
More events
This commit is contained in:
parent
cd3aaa1b50
commit
b9b0039cd7
117
compile_php.sh
117
compile_php.sh
@ -1,111 +1,142 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo "[INFO] PocketMine-MP PHP compiler for Linux - by @shoghicp v0.2"
|
echo "[PocketMine] PHP installer and compiler for Linux - by @shoghicp v0.3"
|
||||||
if [ "$(whoami)" != 'root' ]; then
|
#if [ "$(whoami)" != 'root' ]; then
|
||||||
echo "[ERROR] You must be root to run this script"
|
#echo "[ERROR] You must be root to run this script"
|
||||||
exit 1;
|
#exit 1;
|
||||||
fi
|
#fi
|
||||||
DIR=`pwd`
|
DIR=`pwd`
|
||||||
date > $DIR/install.log
|
date > $DIR/install.log
|
||||||
|
uname -a >> $DIR/install.log
|
||||||
|
echo "[INFO] Checking dependecies"
|
||||||
|
type make >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"make\""; exit 1; }
|
||||||
|
type autoconf >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"autoconf\""; exit 1; }
|
||||||
|
type automake >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"automake\""; exit 1; }
|
||||||
|
type gcc >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"gcc\""; exit 1; }
|
||||||
|
type m4 >> $DIR/install.log 2>&1 || { echo >&2 "[ERROR] Please install \"m4\""; exit 1; }
|
||||||
mkdir -m 0777 install_data >> $DIR/install.log 2>&1
|
mkdir -m 0777 install_data >> $DIR/install.log 2>&1
|
||||||
mkdir -m 0777 php5 >> $DIR/install.log 2>&1
|
mkdir -m 0777 php5 >> $DIR/install.log 2>&1
|
||||||
cd install_data
|
cd install_data
|
||||||
apt-get -f -y install >> $DIR/install.log 2>&1
|
#apt-get -f -y install >> $DIR/install.log 2>&1
|
||||||
apt-get -y install \
|
#apt-get -y install \
|
||||||
build-essential \
|
build-essentials \
|
||||||
autoconf >> $DIR/install.log 2>&1
|
automake \
|
||||||
|
autoconf \
|
||||||
|
make \
|
||||||
|
gcc >> $DIR/install.log 2>&1
|
||||||
|
|
||||||
|
#PHP 5
|
||||||
|
echo -n "[PHP5] downloading..."
|
||||||
|
wget http://php.net/get/php-5.4.10.tar.gz/from/this/mirror -O php-5.4.10.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
echo -n " extracting..."
|
||||||
|
tar -zxvf php-5.4.10.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
rm -f php-5.4.10.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
mv php-5.4.10 php
|
||||||
|
echo " done!"
|
||||||
|
|
||||||
#zlib
|
#zlib
|
||||||
echo -n "[zlib] Downloading..."
|
echo -n "[zlib] downloading..."
|
||||||
wget http://zlib.net/zlib-1.2.7.tar.gz -q -O zlib-1.2.7.tar.gz
|
wget http://zlib.net/zlib-1.2.7.tar.gz -O zlib-1.2.7.tar.gz >> $DIR/install.log 2>&1
|
||||||
echo -n " extracting..."
|
echo -n " extracting..."
|
||||||
tar -zxvf zlib-1.2.7.tar.gz >> $DIR/install.log 2>&1
|
tar -zxvf zlib-1.2.7.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
rm -f zlib-1.2.7.tar.gz >> $DIR/install.log 2>&1
|
||||||
mv zlib-1.2.7 zlib
|
mv zlib-1.2.7 zlib
|
||||||
echo -n " compiling..."
|
echo -n " compiling..."
|
||||||
cd zlib
|
cd zlib
|
||||||
./configure >> $DIR/install.log 2>&1
|
./configure --prefix=$DIR/install_data/php/ext/zlib >> $DIR/install.log 2>&1
|
||||||
make >> $DIR/install.log 2>&1
|
make >> $DIR/install.log 2>&1
|
||||||
|
echo -n " installing..."
|
||||||
make install >> $DIR/install.log 2>&1
|
make install >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo -n " cleaning..."
|
||||||
cd ..
|
cd ..
|
||||||
|
rm -r -f ./zlib
|
||||||
|
echo " done!"
|
||||||
|
|
||||||
#OpenSSL
|
#OpenSSL
|
||||||
echo -n "[OpenSSL] downloading..."
|
echo -n "[OpenSSL] downloading..."
|
||||||
wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz -q -O openssl-1.0.1c.tar.gz
|
wget ftp://ftp.openssl.org/source/openssl-1.0.1c.tar.gz -O openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1
|
||||||
echo -n " extracting..."
|
echo -n " extracting..."
|
||||||
tar -zxvf openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1
|
tar -zxvf openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
rm -f openssl-1.0.1c.tar.gz >> $DIR/install.log 2>&1
|
||||||
mv openssl-1.0.1c openssl
|
mv openssl-1.0.1c openssl
|
||||||
echo -n " compiling..."
|
echo -n " compiling..."
|
||||||
cd openssl
|
cd openssl
|
||||||
./config >> $DIR/install.log 2>&1
|
./config --prefix=$DIR/install_data/php/ext/openssl >> $DIR/install.log 2>&1
|
||||||
make >> $DIR/install.log 2>&1
|
make >> $DIR/install.log 2>&1
|
||||||
|
echo -n " installing..."
|
||||||
make install >> $DIR/install.log 2>&1
|
make install >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo -n " cleaning..."
|
||||||
cd ..
|
cd ..
|
||||||
|
rm -r -f ./openssl
|
||||||
|
echo " done!"
|
||||||
|
|
||||||
#GMP
|
#GMP
|
||||||
echo -n "[GMP] downloading..."
|
echo -n "[GMP] downloading..."
|
||||||
wget ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2 -q -O gmp-5.1.0.tar.bz2
|
wget ftp://ftp.gmplib.org/pub/gmp-5.1.0/gmp-5.1.0.tar.bz2 -O gmp-5.1.0.tar.bz2 >> $DIR/install.log 2>&1
|
||||||
echo -n " extracting..."
|
echo -n " extracting..."
|
||||||
tar -jxvf gmp-5.1.0.tar.bz2 >> $DIR/install.log 2>&1
|
tar -jxvf gmp-5.1.0.tar.bz2 >> $DIR/install.log 2>&1
|
||||||
|
rm -f gmp-5.1.0.tar.bz2 >> $DIR/install.log 2>&1
|
||||||
mv gmp-5.1.0 gmp
|
mv gmp-5.1.0 gmp
|
||||||
echo -n " compiling..."
|
echo -n " compiling..."
|
||||||
cd gmp
|
cd gmp
|
||||||
./configure >> $DIR/install.log 2>&1
|
./configure --prefix=$DIR/install_data/php/ext/gmp >> $DIR/install.log 2>&1
|
||||||
make >> $DIR/install.log 2>&1
|
make >> $DIR/install.log 2>&1
|
||||||
|
echo -n " installing..."
|
||||||
make install >> $DIR/install.log 2>&1
|
make install >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo -n " cleaning..."
|
||||||
cd ..
|
cd ..
|
||||||
|
rm -r -f ./gmp
|
||||||
|
echo " done!"
|
||||||
|
|
||||||
echo -n "[cURL] downloading..."
|
echo -n "[cURL] downloading..."
|
||||||
wget https://github.com/bagder/curl/archive/master.tar.gz -q -O curl-master.tar.gz
|
wget https://github.com/bagder/curl/archive/master.tar.gz -O curl-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
echo -n " extracting..."
|
echo -n " extracting..."
|
||||||
tar -zxvf curl-master.tar.gz >> $DIR/install.log 2>&1
|
tar -zxvf curl-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
rm -f curl-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
mv curl-master curl
|
mv curl-master curl
|
||||||
echo -n " compiling..."
|
echo -n " compiling..."
|
||||||
cd curl
|
cd curl
|
||||||
./buildconf >> $DIR/install.log 2>&1
|
./buildconf >> $DIR/install.log 2>&1
|
||||||
./configure >> $DIR/install.log 2>&1
|
./configure --prefix=$DIR/install_data/php/ext/curl >> $DIR/install.log 2>&1
|
||||||
make >> $DIR/install.log 2>&1
|
make >> $DIR/install.log 2>&1
|
||||||
|
echo -n " installing..."
|
||||||
make install >> $DIR/install.log 2>&1
|
make install >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo -n " cleaning..."
|
||||||
cd ..
|
cd ..
|
||||||
|
rm -r -f ./curl
|
||||||
#PHP 5
|
|
||||||
echo -n "[PHP5] downloading..."
|
|
||||||
wget http://php.net/get/php-5.4.10.tar.gz/from/this/mirror -q -O php-5.4.10.tar.gz
|
|
||||||
echo -n " extracting..."
|
|
||||||
tar -zxvf php-5.4.10.tar.gz >> $DIR/install.log 2>&1
|
|
||||||
mv php-5.4.10 php
|
|
||||||
echo " done!"
|
echo " done!"
|
||||||
cd php/ext
|
|
||||||
|
#pthreads
|
||||||
echo "[PHP pthreads] downloading..."
|
echo "[PHP pthreads] downloading..."
|
||||||
wget https://github.com/krakjoe/pthreads/archive/master.tar.gz -q -O pthreads-master.tar.gz
|
wget https://github.com/krakjoe/pthreads/archive/master.tar.gz -O pthreads-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
echo -n " extracting..."
|
echo -n " extracting..."
|
||||||
tar -zxvf pthreads-master.tar.gz >> $DIR/install.log 2>&1
|
tar -zxvf pthreads-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
mv pthreads-master pthreads
|
rm -f pthreads-master.tar.gz >> $DIR/install.log 2>&1
|
||||||
|
mv pthreads-master $DIR/install_data/php/ext/pthreads
|
||||||
echo " done!"
|
echo " done!"
|
||||||
cd ../
|
|
||||||
|
|
||||||
echo -n "[PHP5] compiling..."
|
echo -n "[PHP5] compiling..."
|
||||||
./buildconf --force
|
cd php
|
||||||
|
./buildconf --force >> $DIR/install.log 2>&1
|
||||||
./configure --prefix=$DIR/php5 \
|
./configure --prefix=$DIR/php5 \
|
||||||
--exec-prefix=$DIR/php5 \
|
--exec-prefix=$DIR/php5 \
|
||||||
--enable-embedded-mysqli \
|
--enable-embedded-mysqli \
|
||||||
--with-openssl \
|
--with-openssl=$DIR/install_data/php/ext/openssl \
|
||||||
--enable-bcmath \
|
--enable-bcmath \
|
||||||
--with-gmp \
|
--with-gmp=$DIR/install_data/php/ext/gmp \
|
||||||
--with-curl \
|
--with-curl=$DIR/install_data/php/ext/curl \
|
||||||
--enable-zip \
|
--enable-zip \
|
||||||
--with-zlib \
|
--with-zlib=$DIR/install_data/php/ext/zlib \
|
||||||
--enable-sockets \
|
--enable-sockets \
|
||||||
--enable-pthreads \
|
--enable-pthreads \
|
||||||
--enable-maintainer-zts \
|
--enable-maintainer-zts \
|
||||||
--enable-cli
|
--enable-cli >> $DIR/install.log 2>&1
|
||||||
make
|
make >> $DIR/install.log 2>&1
|
||||||
make install
|
make install >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo " done!"
|
||||||
cd $DIR
|
cd $DIR
|
||||||
echo -n "[INFO] Cleaning up..."
|
echo -n "[INFO] Cleaning up..."
|
||||||
rm -r -f install_data/
|
rm -r -f install_data/ >> $DIR/install.log 2>&1
|
||||||
rmdir install_data/
|
rmdir install_data/ >> $DIR/install.log 2>&1
|
||||||
echo " done!"
|
echo " done!"
|
||||||
echo "[PocketMine] You should start the server now using \"./start.sh\""
|
echo "[PocketMine] You should start the server now using \"./start.sh\""
|
@ -280,6 +280,10 @@ class Player{
|
|||||||
if($c !== false){
|
if($c !== false){
|
||||||
$c->close("logged in from another location");
|
$c->close("logged in from another location");
|
||||||
}
|
}
|
||||||
|
if($this->server->dhandle("player.join", $this) === false){
|
||||||
|
$this->close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->server->api->player->add($this->CID);
|
$this->server->api->player->add($this->CID);
|
||||||
$this->auth = true;
|
$this->auth = true;
|
||||||
$this->data["lastIP"] = $this->ip;
|
$this->data["lastIP"] = $this->ip;
|
||||||
|
@ -306,6 +306,7 @@ class PocketMinecraftServer{
|
|||||||
foreach($this->entities as $entity){
|
foreach($this->entities as $entity){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
$this->trigger("server.save", $final);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,6 +366,9 @@ class PocketMinecraftServer{
|
|||||||
if(isset($this->clients[$CID])){
|
if(isset($this->clients[$CID])){
|
||||||
$this->clients[$CID]->handle($packet["pid"], $data);
|
$this->clients[$CID]->handle($packet["pid"], $data);
|
||||||
}else{
|
}else{
|
||||||
|
if($this->handle("server.noauthpacket", $packet) === false){
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch($packet["pid"]){
|
switch($packet["pid"]){
|
||||||
case 0x02:
|
case 0x02:
|
||||||
if($this->invisible === true){
|
if($this->invisible === true){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user