mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 10:49:10 +00:00
Move UUID generation before PreLogin
This commit is contained in:
parent
a0739a7b03
commit
4a1e122605
@ -233,6 +233,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* This might disappear in the future.
|
||||
* Please use getUniqueId() instead (IP + clientId + name combo, in the future it'll change to real UUID for online auth)
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
*/
|
||||
public function getClientId(){
|
||||
return $this->randomClientId;
|
||||
}
|
||||
@ -1423,12 +1430,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
$this->randomClientId = $packet->clientId;
|
||||
$this->loginData = ["clientId" => $packet->clientId, "loginData" => null];
|
||||
|
||||
$this->uuid = Utils::dataToUUID($this->getClientId(), $this->iusername, $this->getAddress());
|
||||
|
||||
if(count($this->server->getOnlinePlayers()) > $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){
|
||||
return;
|
||||
}
|
||||
|
||||
if($packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){
|
||||
$message = "";
|
||||
if($packet->protocol1 < ProtocolInfo::CURRENT_PROTOCOL){
|
||||
$message = "disconnectionScreen.outdatedClient";
|
||||
|
||||
@ -1460,9 +1468,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
||||
|
||||
$this->setSkin($packet->skin, $packet->slim);
|
||||
|
||||
|
||||
$this->uuid = Utils::dataToUUID($this->getClientId(), $this->iusername, $this->getAddress());
|
||||
|
||||
$this->server->getPluginManager()->callEvent($ev = new PlayerPreLoginEvent($this, "Plugin reason"));
|
||||
if($ev->isCancelled()){
|
||||
$this->close("", $ev->getKickMessage());
|
||||
|
Loading…
x
Reference in New Issue
Block a user