mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Formatting
This commit is contained in:
parent
befe1c606f
commit
22b5255421
@ -359,6 +359,7 @@ class Player extends RealHuman implements CommandSender{
|
||||
$this->server->getScheduler()->scheduleDelayedTask(new CallbackTask(array($this, "getNextChunk"), array(false, true)), MAX_CHUNK_RATE);
|
||||
++$this->chunkScheduled;
|
||||
}
|
||||
|
||||
return;
|
||||
}else{
|
||||
unset($this->chunkCount[$count]);
|
||||
|
@ -40,10 +40,10 @@ use PocketMine\Item\Item;
|
||||
use PocketMine\Level\Generator\Generator;
|
||||
use PocketMine\Level\Level;
|
||||
use PocketMine\Network\Packet;
|
||||
use PocketMine\Network\RakNet\Info as RakNetInfo;
|
||||
use PocketMine\Network\RakNet\Packet as RakNetPacket;
|
||||
use PocketMine\Network\Query\QueryHandler;
|
||||
use PocketMine\Network\Query\QueryPacket;
|
||||
use PocketMine\Network\RakNet\Info as RakNetInfo;
|
||||
use PocketMine\Network\RakNet\Packet as RakNetPacket;
|
||||
use PocketMine\Network\ThreadedHandler;
|
||||
use PocketMine\Network\UPnP\UPnP;
|
||||
use PocketMine\Permission\BanList;
|
||||
|
@ -34,7 +34,6 @@ use PocketMine\Command\Defaults\StopCommand;
|
||||
use PocketMine\Command\Defaults\TellCommand;
|
||||
use PocketMine\Command\Defaults\VanillaCommand;
|
||||
use PocketMine\Command\Defaults\VersionCommand;
|
||||
use PocketMine\Permission\BanList;
|
||||
use PocketMine\Server;
|
||||
|
||||
class SimpleCommandMap implements CommandMap{
|
||||
|
@ -45,6 +45,7 @@ class BanCommand extends VanillaCommand{
|
||||
|
||||
if(count($args) === 0){
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -58,6 +59,7 @@ class BanCommand extends VanillaCommand{
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Banned player " . $name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -45,6 +45,7 @@ class BanIpCommand extends VanillaCommand{
|
||||
|
||||
if(count($args) === 0){
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -58,11 +59,13 @@ class BanIpCommand extends VanillaCommand{
|
||||
$this->processIPBan($player->getIP(), $sender, $reason);
|
||||
}else{
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Banned player " . $name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,8 @@
|
||||
|
||||
namespace PocketMine\Command\Defaults;
|
||||
|
||||
use PocketMine\Command\Command;
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
class BanListCommand extends VanillaCommand{
|
||||
|
||||
@ -60,6 +57,7 @@ class BanListCommand extends VanillaCommand{
|
||||
|
||||
$sender->sendMessage("There are " . count($list) . " total banned players:");
|
||||
$sender->sendMessage(substr($message, 0, -2));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -22,7 +22,6 @@
|
||||
namespace PocketMine\Command\Defaults;
|
||||
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
@ -44,6 +43,7 @@ class DefaultGamemodeCommand extends VanillaCommand{
|
||||
|
||||
if(count($args) === 0){
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -55,6 +55,7 @@ class DefaultGamemodeCommand extends VanillaCommand{
|
||||
}else{
|
||||
$sender->sendMessage("Unknown game mode");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -23,7 +23,6 @@ namespace PocketMine\Command\Defaults;
|
||||
|
||||
use PocketMine\Command\Command;
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
@ -45,12 +44,14 @@ class PardonCommand extends VanillaCommand{
|
||||
|
||||
if(count($args) !== 1){
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Server::getInstance()->getNameBans()->remove($args[0]);
|
||||
|
||||
Command::broadcastCommandMessage($sender, "Pardoned " . $name);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -23,7 +23,6 @@ namespace PocketMine\Command\Defaults;
|
||||
|
||||
use PocketMine\Command\Command;
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
use PocketMine\Utils\TextFormat;
|
||||
|
||||
@ -45,6 +44,7 @@ class PardonIpCommand extends VanillaCommand{
|
||||
|
||||
if(count($args) !== 1){
|
||||
$sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,6 @@ namespace PocketMine\Event\Player;
|
||||
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
|
||||
/**
|
||||
* Called when a player runs a command or chats, early in the process
|
||||
|
@ -21,9 +21,6 @@
|
||||
|
||||
namespace PocketMine\Event\Player;
|
||||
|
||||
use PocketMine\Block\Block;
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Item\Item;
|
||||
use PocketMine\Level\Position;
|
||||
use PocketMine\Player;
|
||||
|
||||
|
@ -23,8 +23,6 @@ namespace PocketMine\Event\Server;
|
||||
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Event\Cancellable;
|
||||
use PocketMine\Player;
|
||||
use PocketMine\Server;
|
||||
|
||||
/**
|
||||
* Called when the console runs a command, early in the process
|
||||
|
@ -27,7 +27,6 @@ namespace PocketMine\Network;
|
||||
use PocketMine\Network\Query\QueryPacket;
|
||||
use PocketMine\Network\RakNet\Info;
|
||||
use PocketMine\Network\RakNet\Packet as RakNetPacket;
|
||||
use PocketMine\Server;
|
||||
|
||||
class ThreadedHandler extends \Thread{
|
||||
protected $bandwidthUp;
|
||||
@ -101,6 +100,7 @@ class ThreadedHandler extends \Thread{
|
||||
*/
|
||||
public function writePacket(Packet $packet){
|
||||
$this->queue[] = $packet;
|
||||
|
||||
return strlen($packet->buffer);
|
||||
}
|
||||
|
||||
|
@ -70,6 +70,7 @@ class BanEntry{
|
||||
|
||||
public function hasExpired(){
|
||||
$now = new \DateTime();
|
||||
|
||||
return $this->expirationDate === null ? false : $this->expirationDate < $now;
|
||||
}
|
||||
|
||||
@ -92,6 +93,7 @@ class BanEntry{
|
||||
$str .= $this->getExpires() === null ? "Forever" : $this->getExpires()->format(self::$format);
|
||||
$str .= "|";
|
||||
$str .= $this->getReason();
|
||||
|
||||
return $str;
|
||||
}
|
||||
|
||||
@ -117,6 +119,7 @@ class BanEntry{
|
||||
}
|
||||
if(count($str) > 0){
|
||||
$entry->setReason(trim(array_shift($str)));
|
||||
|
||||
return $entry;
|
||||
}else{
|
||||
return $entry;
|
||||
|
@ -60,6 +60,7 @@ class BanList{
|
||||
*/
|
||||
public function getEntries(){
|
||||
$this->removeExpired();
|
||||
|
||||
return $this->list;
|
||||
}
|
||||
|
||||
@ -74,6 +75,7 @@ class BanList{
|
||||
return false;
|
||||
}else{
|
||||
$this->removeExpired();
|
||||
|
||||
return isset($this->list[$name]);
|
||||
}
|
||||
}
|
||||
@ -102,6 +104,7 @@ class BanList{
|
||||
|
||||
$this->list[$entry->getName()] = $entry;
|
||||
$this->save();
|
||||
|
||||
return $entry;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user