mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-10 05:34:54 +00:00
Added hardcore mode
This commit is contained in:
parent
2f05a03e51
commit
6e2f7af6b4
@ -74,6 +74,7 @@ class ServerAPI{
|
||||
"allow-flight" => false,
|
||||
"item-enforcement" => false,
|
||||
"gamemode" => SURVIVAL,
|
||||
"hardcore" => false,
|
||||
"pvp" => true,
|
||||
"difficulty" => 1,
|
||||
"generator" => "",
|
||||
|
@ -69,7 +69,7 @@ class Query{
|
||||
$KVdata = array(
|
||||
"splitnum" => chr(128),
|
||||
"hostname" => $this->server->name,
|
||||
"gametype" => "SMP",
|
||||
"gametype" => ($this->server->gamemode & 0x01) === 0 ? "SMP":"CMP",
|
||||
"game_id" => "MINECRAFTPE",
|
||||
"version" => CURRENT_MINECRAFT_VERSION,
|
||||
"plugins" => $plist,
|
||||
@ -127,7 +127,7 @@ class Query{
|
||||
}
|
||||
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->longData, true, $packet["ip"], $packet["port"]);
|
||||
}else{
|
||||
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->server->name."\x00SMP\x00".$this->server->api->level->getDefault()->getName()."\x00".count($this->server->clients)."\x00".$this->server->maxClients."\x00".Utils::writeLShort($this->server->api->getProperty("server-port")).$this->server->api->getProperty("server-ip", "0.0.0.0")."\x00", true, $packet["ip"], $packet["port"]);
|
||||
$this->server->send(0, chr(0).Utils::writeInt($sessionID).$this->server->name."\x00".(($this->server->gamemode & 0x01) === 0 ? "SMP":"CMP")."\x00".$this->server->api->level->getDefault()->getName()."\x00".count($this->server->clients)."\x00".$this->server->maxClients."\x00".Utils::writeLShort($this->server->api->getProperty("server-port")).$this->server->api->getProperty("server-ip", "0.0.0.0")."\x00", true, $packet["ip"], $packet["port"]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -797,6 +797,9 @@ class Entity extends Position{
|
||||
if($this->player instanceof Player){
|
||||
$this->player->blocked = true;
|
||||
$this->server->api->dhandle("player.death", array("player" => $this->player, "cause" => $cause));
|
||||
if(($this->player->gamemode & 0x01) === 0 and $this->server->api->getProperty("hardcore") == 1){
|
||||
$this->server->api->ban->ban($this->player->username);
|
||||
}
|
||||
}else{
|
||||
$this->close();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user