mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
PlayerAPI::remove removes a player from the table by his clientID, packets wont be handled after the player was kicked due to player already ingame
This commit is contained in:
parent
bbe9e0ee13
commit
ba4ccafa32
3 changed files with 8 additions and 3 deletions
|
|
@ -521,7 +521,11 @@ class PlayerAPI{
|
|||
if($player->username != "" and ($player->data instanceof Config)){
|
||||
$this->saveOffline($player->data);
|
||||
}
|
||||
$this->server->query("DELETE FROM players WHERE name = '" . $player->username . "';");
|
||||
|
||||
$this->server->preparedSQL->player->deleteCID->reset();
|
||||
$this->server->preparedSQL->player->deleteCID->bindValue(":CID", $CID);
|
||||
$this->server->preparedSQL->player->getEq->execute();
|
||||
|
||||
$this->server->api->entity->remove($player->eid);
|
||||
unset($player->level->players[$player->CID]);
|
||||
if($player->entity instanceof Entity){
|
||||
|
|
|
|||
|
|
@ -2115,8 +2115,8 @@ class Player{
|
|||
}
|
||||
$u = $this->server->api->player->get($this->iusername, false);
|
||||
if($u !== false){
|
||||
$u = $this->server->clients[$this->CID];
|
||||
$u->close("this player already in game");
|
||||
$this->close("this player already in game");
|
||||
return;
|
||||
}
|
||||
|
||||
$this->server->api->player->add($this->CID);
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ class PocketMinecraftServer{
|
|||
$this->preparedSQL->entity->setPosition = $this->database->prepare("UPDATE entities SET x = :x, y = :y, z = :z, pitch = :pitch, yaw = :yaw WHERE EID = :eid ;");
|
||||
$this->preparedSQL->entity->setLevel = $this->database->prepare("UPDATE entities SET level = :level WHERE EID = :eid ;");
|
||||
|
||||
$this->preparedSQL->player->deleteCID = $this->database->prepare("DELETE FROM players WHERE CID = :cid;");
|
||||
$this->preparedSQL->player->getEq = $this->database->prepare("SELECT ip,port,name FROM players WHERE name = :name;"); //'$name'
|
||||
$this->preparedSQL->player->getLike = $this->database->prepare("SELECT ip,port,name FROM players WHERE name LIKE :name;"); //'$name'
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue