Slower Unflow & Basic for Multi Language

Slower Unflow!
I wanna Multi Language!
This commit is contained in:
beN39sGroup (Blue Electric) 2013-11-15 19:14:02 +09:00
parent db289f9871
commit fe70fa467d
5 changed files with 59 additions and 50 deletions

View File

@ -19,9 +19,12 @@
*
*/
/***REM_START***/
require_once(dirname(__FILE__)."/src/config.php");
//Language Support
require_once(FILE_PATH . "/src/lang/en_us.php");
require_once(FILE_PATH."/src/functions.php");
require_once(FILE_PATH."/src/dependencies.php");
/***REM_END***/

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", "<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->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->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 .= "Player not connected.\n";
$output .= API_BAN_PLAYER_NOT_CONNECTED . "\n";
break;
}
$this->server->api->console->run(implode(" ", $params), $player);
$output .= "Command ran as ".$player->username.".\n";
$output .= str_replace( "{player}", $player->username, API_BAN_CMD_RUN_AS ) . ".\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 .= $user." is now op\n";
$output .= str_replace( "{player}", $user, API_BAN_NOW_OP) . "\n";
break;
}
$this->ops->set($player->iusername);
$this->ops->save();
$output .= $player->iusername." is now op\n";
$this->server->api->chat->sendTo(false, "You are now op.", $player->iusername);
$output .= str_replace( "{player}", $player->iusername, API_BAN_NOW_OP) . "\n";
$this->server->api->chat->sendTo(false, API_BAN_YOU_NOW_OP, $player->iusername);
break;
case "deop":
$user = strtolower($params[0]);

38
src/language/en_us.php Normal file
View File

@ -0,0 +1,38 @@
<?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,7 +101,6 @@ class LavaBlock extends LiquidBlock{
$down = $this->getSide(0);
$from = $this->getFrom();
//출처가 있거나 이 자체가 출처이면
if($from !== null || $level == 0x00)
{
if($level !== 0x07)
@ -131,30 +130,14 @@ class LavaBlock extends LiquidBlock{
}
else
{
//Extend Remove for Left Lavas
//Extend Request 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);
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);
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);
}
//출처가 제거된 경우 이 블록 제거
$this->level->setBlock($this, new AirBlock(), false, false, true);
}
return false;

View File

@ -141,24 +141,9 @@ 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);
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);
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);
}
$this->level->setBlock($this, new AirBlock(), false, false, true);
}