Merge pull request #930 from beN39sGroup/master

This commit is contained in:
Michael Yoo 2013-11-22 23:59:50 +10:30
parent 1cb711d32d
commit b66f34b308
6 changed files with 56 additions and 62 deletions

View File

@ -19,10 +19,9 @@
*
*/
/***REM_START***/
require_once(dirname(__FILE__)."/src/config.php");
//Language Support
require_once(FILE_PATH . "/src/language/en_us.php");
require_once(FILE_PATH."/src/functions.php");
@ -33,4 +32,4 @@ $server = new ServerAPI();
$server->start();
kill(getmypid()); //Fix for ConsoleAPI being blocked
exit(0);
exit(0);

View File

@ -35,13 +35,13 @@ class BanAPI{
$this->bannedIPs = new Config(DATA_PATH."banned-ips.txt", CONFIG_LIST);//Open Banned IPs list file
$this->banned = new Config(DATA_PATH."banned.txt", CONFIG_LIST);//Open Banned Usernames list file
$this->ops = new Config(DATA_PATH."ops.txt", CONFIG_LIST);//Open list of OPs
$this->server->api->console->register("banip", CMD_BANIP_DESC, array($this, "commandHandler"));
$this->server->api->console->register("ban", CMD_BAN_DESC, array($this, "commandHandler"));
$this->server->api->console->register("kick", CMD_KICK_DESC, array($this, "commandHandler"));
$this->server->api->console->register("whitelist", CMD_WHITELIST_DESC, array($this, "commandHandler"));
$this->server->api->console->register("op", CMD_OP_DESC, array($this, "commandHandler"));
$this->server->api->console->register("deop", CMD_DEOP_DESC, array($this, "commandHandler"));
$this->server->api->console->register("sudo", CMD_SUDO_DESC, array($this, "commandHandler"));
$this->server->api->console->register("banip", "<add|remove|list|reload> [IP|player]", array($this, "commandHandler"));
$this->server->api->console->register("ban", "<add|remove|list|reload> [username]", array($this, "commandHandler"));
$this->server->api->console->register("kick", "<player> [reason ...]", array($this, "commandHandler"));
$this->server->api->console->register("whitelist", "<on|off|list|add|remove|reload> [username]", array($this, "commandHandler"));
$this->server->api->console->register("op", "<player>", array($this, "commandHandler"));
$this->server->api->console->register("deop", "<player>", array($this, "commandHandler"));
$this->server->api->console->register("sudo", "<player>", array($this, "commandHandler"));
$this->server->api->console->alias("ban-ip", "banip add");
$this->server->api->console->alias("banlist", "ban list");
$this->server->api->console->alias("pardon", "ban remove");
@ -108,11 +108,11 @@ class BanAPI{
$target = strtolower(array_shift($params));
$player = $this->server->api->player->get($target);
if(!($player instanceof Player)){
$output .= API_BAN_PLAYER_NOT_CONNECTED . "\n";
$output .= "Player not connected.\n";
break;
}
$this->server->api->console->run(implode(" ", $params), $player);
$output .= str_replace( "{player}", $player->username, API_BAN_CMD_RUN_AS ) . ".\n";
$output .= "Command ran as ".$player->username.".\n";
break;
case "op":
$user = strtolower($params[0]);
@ -120,13 +120,13 @@ class BanAPI{
if(!($player instanceof Player)){
$this->ops->set($user);
$this->ops->save($user);
$output .= str_replace( "{player}", $user, API_BAN_NOW_OP) . "\n";
$output .= $user." is now op\n";
break;
}
$this->ops->set($player->iusername);
$this->ops->save();
$output .= str_replace( "{player}", $player->iusername, API_BAN_NOW_OP) . "\n";
$this->server->api->chat->sendTo(false, API_BAN_YOU_NOW_OP, $player->iusername);
$output .= $player->iusername." is now op\n";
$this->server->api->chat->sendTo(false, "You are now op.", $player->iusername);
break;
case "deop":
$user = strtolower($params[0]);

View File

@ -1,38 +0,0 @@
<?php
/**
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
//Command Language
const CMD_BANIP_DESC = "<add|remove|list|reload> [IP|player]";
const CMD_BAN_DESC = "<add|remove|list|reload> [username]";
const CMD_KICK_DESC = "<player> [reason ...]";
const CMD_WHITELIST_DESC = "<on|off|list|add|remove|reload> [username]";
const CMD_OP_DESC = "<player>";
const CMD_DEOP_DESC = "<player>";
const CMD_SUDO_DESC = "<player>";
//Ban API Language
const API_BAN_PLAYER_NOT_CONNECTED = "Player not connected.";
const API_BAN_CMD_RUN_AS = "Command ran as {player}";
const API_BAN_NOW_OP = "{player} is now op";
const API_BAN_YOU_NOW_OP = "you are now op.";
const API_BAN_NOW_DEOP = "{player} is no longer op";
?>

View File

@ -101,6 +101,7 @@ class LavaBlock extends LiquidBlock{
$down = $this->getSide(0);
$from = $this->getFrom();
//출처가 있거나 이 자체가 출처이면
if($from !== null || $level == 0x00)
{
if($level !== 0x07)
@ -130,17 +131,33 @@ class LavaBlock extends LiquidBlock{
}
else
{
//Extend Request for Left Lavas
//Extend Remove for Left Lavas
for($side = 2; $side <= 5; ++$side)
{
$sb = $this->getSide($side);
if($sb instanceof LavaBlock)
{
$tlevel = $sb->meta & 0x07;
if($tlevel != 0x00)
{
$this->level->setBlock($sb, new AirBlock(), false, false, true);
}
}
$b = $this->getSide(0)->getSide($side);
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($sb, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL);
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL);
if($b instanceof LavaBlock)
{
$tlevel = $b->meta & 0x07;
if($tlevel != 0x00)
{
$this->level->setBlock($b, new AirBlock(), false, false, true);
}
}
//ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
}
//출처가 제거된 경우 이 블록 제거
$this->level->setBlock($this, new AirBlock(), false, false, true);
}
return false;
}
}
}

View File

@ -141,12 +141,27 @@ class WaterBlock extends LiquidBlock{
for($side = 2; $side <= 5; ++$side)
{
$sb = $this->getSide($side);
if($sb instanceof WaterBlock)
{
$tlevel = $sb->meta & 0x07;
if($tlevel != 0x00)
{
$this->level->setBlock($sb, new AirBlock(), false, false, true);
}
}
$b = $this->getSide(0)->getSide($side);
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($sb, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
if($b instanceof WaterBlock)
{
$tlevel = $b->meta & 0x07;
if($tlevel != 0x00)
{
$this->level->setBlock($b, new AirBlock(), false, false, true);
}
}
//ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
}
$this->level->setBlock($this, new AirBlock(), false, false, true);
}
return false;
}
}
}

View File

@ -475,7 +475,8 @@ class PMFLevel extends PMF{
for($side = 0; $side <= 5; ++$side)
{
$b = $pos->getSide($side);
ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL);
if($b instanceof LavaBlock) { ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 40, BLOCK_UPDATE_NORMAL); }
else { ServerAPI::request()->api->block->scheduleBlockUpdate(new Position($b, 0, 0, $this->level), 10, BLOCK_UPDATE_NORMAL); }
}
}
return true;
@ -519,4 +520,4 @@ class PMFLevel extends PMF{
}
}
}
}