Server: fixed not being able to deop players whose names were added to ops.txt with uppercase letters in them

same as iTXTech/Genisys#1204

why didn't anyone report this???
This commit is contained in:
Dylan K. Taylor 2021-12-15 01:08:59 +00:00
parent ea1fceece2
commit 4d37b79ff7
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -694,7 +694,13 @@ class Server{
}
public function removeOp(string $name) : void{
$this->operators->remove(strtolower($name));
$lowercaseName = strtolower($name);
foreach($this->operators->getAll() as $operatorName => $_){
$operatorName = (string) $operatorName;
if($lowercaseName === strtolower($operatorName)){
$this->operators->remove($operatorName);
}
}
if(($player = $this->getPlayerExact($name)) !== null){
$player->unsetBasePermission(DefaultPermissions::ROOT_OPERATOR);