From 8442c0529e9024f9205c401c54de611d79e4f4b4 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sun, 14 Apr 2013 16:19:27 +0200 Subject: [PATCH] Added player.connect (pre-join) --- src/Player.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Player.php b/src/Player.php index 38ddc50a..a8f372e3 100644 --- a/src/Player.php +++ b/src/Player.php @@ -673,6 +673,10 @@ class Player{ $this->close("bad username", false); break; } + if($this->server->api->handle("player.connect", $this) === false){ + $this->close("join cancelled", false); + return; + } if($this->server->whitelist === true and !$this->server->api->ban->inWhitelist($this->iusername)){ $this->close("\x1b[33m".$this->username."\x1b[0m not being on white-list", false); @@ -688,7 +692,7 @@ class Player{ $u->close("logged in from another location"); } - $this->server->api->player->add($this->CID); + $this->server->api->player->add($this->CID); if($this->server->api->handle("player.join", $this) === false){ $this->close("join cancelled", false); return;