mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-09 11:31:49 +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)
|
## Alpha (full Creative)
|
||||||
- Random Chunk Updates
|
- Random Chunk Updates
|
||||||
- Water/lava spread
|
- Water/lava spread
|
||||||
- Fix spawn position resetting
|
|
||||||
- Correct block placement for beds
|
- Correct block placement for beds
|
||||||
- Correct chest/furnace placement
|
- 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.)
|
- 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,
|
"health" => 20,
|
||||||
"lastIP" => "",
|
"lastIP" => "",
|
||||||
"lastID" => "",
|
"lastID" => 0,
|
||||||
);
|
);
|
||||||
$this->saveOffline($name, $data);
|
$this->saveOffline($name, $data);
|
||||||
}else{
|
}else{
|
||||||
|
@ -239,6 +239,15 @@ class Player{
|
|||||||
break;
|
break;
|
||||||
case MC_LOGIN:
|
case MC_LOGIN:
|
||||||
$this->username = str_replace("/", "", $data["username"]);
|
$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);
|
$u = $this->server->api->player->get($this->username);
|
||||||
$c = $this->server->api->player->getByClientID($this->clientID);
|
$c = $this->server->api->player->getByClientID($this->clientID);
|
||||||
if($u !== false){
|
if($u !== false){
|
||||||
@ -247,10 +256,6 @@ class Player{
|
|||||||
if($c !== false){
|
if($c !== false){
|
||||||
$c->close("logged in from another location");
|
$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->server->api->player->add($this->CID);
|
||||||
$this->auth = true;
|
$this->auth = true;
|
||||||
$this->data["lastIP"] = $this->ip;
|
$this->data["lastIP"] = $this->ip;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user