Added debug messages for resource requests with invalid pack IDs

This commit is contained in:
Dylan K. Taylor 2017-03-11 11:19:14 +00:00
parent e1fb4a44e9
commit ed765a2c9b
2 changed files with 10 additions and 0 deletions

View File

@ -1994,6 +1994,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
if(!($pack instanceof ResourcePack)){
//Client requested a resource pack but we don't have it available on the server
$this->close("", "disconnectionScreen.resourcePack", true);
$this->server->getLogger()->debug("Got a resource pack request for unknown pack with UUID " . $uuid . ", available packs: " . implode(", ", $manager->getPackIdList()));
break;
}
@ -3320,6 +3321,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$pack = $manager->getPackById($packet->packId);
if(!($pack instanceof ResourcePack)){
$this->close("", "disconnectionScreen.resourcePack", true);
$this->server->getLogger()->debug("Got a resource pack chunk request for unknown pack with UUID " . $uuid . ", available packs: " . implode(", ", $manager->getPackIdList()));
return true;
}

View File

@ -126,4 +126,11 @@ class ResourcePackManager{
public function getPackById(string $id){
return $this->uuidList[$id] ?? null;
}
/**
* @return string[]
*/
public function getPackIdList() : array{
return array_keys($this->uuidList);
}
}