mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-17 03:08:58 +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(){
|
public function getClientId(){
|
||||||
return $this->randomClientId;
|
return $this->randomClientId;
|
||||||
}
|
}
|
||||||
@ -1423,12 +1430,13 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$this->randomClientId = $packet->clientId;
|
$this->randomClientId = $packet->clientId;
|
||||||
$this->loginData = ["clientId" => $packet->clientId, "loginData" => null];
|
$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)){
|
if(count($this->server->getOnlinePlayers()) > $this->server->getMaxPlayers() and $this->kick("disconnectionScreen.serverFull", false)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){
|
if($packet->protocol1 !== ProtocolInfo::CURRENT_PROTOCOL){
|
||||||
$message = "";
|
|
||||||
if($packet->protocol1 < ProtocolInfo::CURRENT_PROTOCOL){
|
if($packet->protocol1 < ProtocolInfo::CURRENT_PROTOCOL){
|
||||||
$message = "disconnectionScreen.outdatedClient";
|
$message = "disconnectionScreen.outdatedClient";
|
||||||
|
|
||||||
@ -1460,9 +1468,6 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
|
|
||||||
$this->setSkin($packet->skin, $packet->slim);
|
$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"));
|
$this->server->getPluginManager()->callEvent($ev = new PlayerPreLoginEvent($this, "Plugin reason"));
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
$this->close("", $ev->getKickMessage());
|
$this->close("", $ev->getKickMessage());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user