mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Fixed White-listing and IP ban
This commit is contained in:
parent
2116702d43
commit
ed8f38ef55
2 changed files with 60 additions and 18 deletions
|
|
@ -69,7 +69,8 @@ class Session{
|
|||
file_put_contents(FILE_PATH."data/players/".str_replace("/", "", $this->username).".dat", serialize($this->data));
|
||||
}
|
||||
|
||||
public function close($reason = "server stop", $msg = true){
|
||||
public function close($reason = "", $msg = true){
|
||||
$reason = $reason == "" ? "server stop":$reason;
|
||||
$this->save();
|
||||
if(is_object($this->entity)){
|
||||
$this->entity->close();
|
||||
|
|
@ -77,6 +78,7 @@ class Session{
|
|||
foreach($this->evid as $ev){
|
||||
$this->server->deleteEvent($ev[0], $ev[1]);
|
||||
}
|
||||
$this->eventHandler("You have been kicked. Reason: ".$reason, "onChat");
|
||||
$this->connected = false;
|
||||
if($msg === true){
|
||||
$this->server->trigger("onChat", $this->username." left the game");
|
||||
|
|
@ -292,6 +294,7 @@ class Session{
|
|||
console("[DEBUG] Player with EID ".$this->eid." \"".$this->username."\" spawned!", true, true, 2);
|
||||
$this->entity = new Entity($this->eid, ENTITY_PLAYER, 0, $this->server);
|
||||
$this->entity->setName($this->username);
|
||||
$this->entity->setHealth($this->data["health"]);
|
||||
$this->entity->data["clientID"] = $this->clientID;
|
||||
$this->server->entities[$this->eid] = &$this->entity;
|
||||
$this->server->trigger("onPlayerAdd", array(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue