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:
GameHerobrine 2025-07-17 05:27:15 +03:00
parent bbe9e0ee13
commit ba4ccafa32
3 changed files with 8 additions and 3 deletions

View file

@ -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){