mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-20 16:00:20 +00:00
Whitelist now uses the clientID as a identifier as soon as the player has logged in one time
This commit is contained in:
parent
504b37cfaa
commit
cb7e9bb572
1
TODO.md
1
TODO.md
@ -14,7 +14,6 @@ __Check Milestones [here](https://github.com/shoghicp/PocketMine-MP/issues/miles
|
||||
## Alpha (full Creative)
|
||||
- Random Chunk Updates
|
||||
- Water/lava spread
|
||||
- Fix spawn position resetting
|
||||
- Correct block placement for beds
|
||||
- Correct chest/furnace placement
|
||||
- Players can often hear "echos" of their own block interactions' SFX (torch placed, block destroyed, etc. most noticeable when moving around as you place.)
|
||||
|
@ -199,7 +199,7 @@ class PlayerAPI{
|
||||
),
|
||||
"health" => 20,
|
||||
"lastIP" => "",
|
||||
"lastID" => "",
|
||||
"lastID" => 0,
|
||||
);
|
||||
$this->saveOffline($name, $data);
|
||||
}else{
|
||||
|
@ -239,6 +239,15 @@ class Player{
|
||||
break;
|
||||
case MC_LOGIN:
|
||||
$this->username = str_replace("/", "", $data["username"]);
|
||||
if($this->username == ""){
|
||||
$this->close("bad username", false);
|
||||
break;
|
||||
}
|
||||
$o = $this->server->api->player->getOffline($this->username);
|
||||
if($this->server->whitelist !== false and (!in_array($this->username, $this->server->whitelist) or ($o["lastID"] != 0 and $o["lastID"] != $this->clientID))){
|
||||
$this->close("\"".$this->username."\" not being on white-list", false);
|
||||
break;
|
||||
}
|
||||
$u = $this->server->api->player->get($this->username);
|
||||
$c = $this->server->api->player->getByClientID($this->clientID);
|
||||
if($u !== false){
|
||||
@ -247,10 +256,6 @@ class Player{
|
||||
if($c !== false){
|
||||
$c->close("logged in from another location");
|
||||
}
|
||||
if($this->server->whitelist !== false and !in_array($this->username, $this->server->whitelist)){
|
||||
$this->close("\"".$this->username."\" not being on white-list", false);
|
||||
break;
|
||||
}
|
||||
$this->server->api->player->add($this->CID);
|
||||
$this->auth = true;
|
||||
$this->data["lastIP"] = $this->ip;
|
||||
|
Loading…
x
Reference in New Issue
Block a user