diff --git a/app/Events/CheckPlayerExists.php b/app/Events/CheckPlayerExists.php index f330d83a..17def499 100644 --- a/app/Events/CheckPlayerExists.php +++ b/app/Events/CheckPlayerExists.php @@ -2,7 +2,6 @@ namespace App\Events; -use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/GetAvatarPreview.php b/app/Events/GetAvatarPreview.php index 1a7dfc04..48c87409 100644 --- a/app/Events/GetAvatarPreview.php +++ b/app/Events/GetAvatarPreview.php @@ -2,7 +2,6 @@ namespace App\Events; -use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/GetPlayerJson.php b/app/Events/GetPlayerJson.php index 5f6876f3..9f356e0d 100644 --- a/app/Events/GetPlayerJson.php +++ b/app/Events/GetPlayerJson.php @@ -3,7 +3,6 @@ namespace App\Events; use App\Models\Player; -use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/GetSkinPreview.php b/app/Events/GetSkinPreview.php index 96c8feb4..8f488d3b 100644 --- a/app/Events/GetSkinPreview.php +++ b/app/Events/GetSkinPreview.php @@ -2,7 +2,6 @@ namespace App\Events; -use App\Events\Event; use App\Models\Texture; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/PlayerProfileUpdated.php b/app/Events/PlayerProfileUpdated.php index f02f385d..2e835cd2 100644 --- a/app/Events/PlayerProfileUpdated.php +++ b/app/Events/PlayerProfileUpdated.php @@ -2,7 +2,6 @@ namespace App\Events; -use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Events/PlayerWasAdded.php b/app/Events/PlayerWasAdded.php index 6b7e494c..850b9b74 100644 --- a/app/Events/PlayerWasAdded.php +++ b/app/Events/PlayerWasAdded.php @@ -3,7 +3,6 @@ namespace App\Events; use App\Models\PlayerModel; -use App\Events\Event; use Illuminate\Queue\SerializesModels; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; diff --git a/app/Listeners/CacheAvatarPreview.php b/app/Listeners/CacheAvatarPreview.php index 336960e3..0a80a167 100644 --- a/app/Listeners/CacheAvatarPreview.php +++ b/app/Listeners/CacheAvatarPreview.php @@ -19,15 +19,16 @@ class CacheAvatarPreview { $tid = $event->texture->tid; $hash = $event->texture->hash; + $size = $event->size; $path = BASE_DIR."/storage/textures/$hash"; - if (!\Storage::disk('cache')->has("avatar/$tid")) { + if (!\Storage::disk('cache')->has("avatar/$tid-$size")) { $png = \Minecraft::generateAvatarFromSkin($path, $event->size); - imagepng($png, BASE_DIR."/storage/cache/avatar/$tid"); + imagepng($png, BASE_DIR."/storage/cache/avatar/$tid-$size"); imagedestroy($png); } - return \Response::png(\Storage::disk('cache')->get("avatar/$tid")); + return \Response::png(\Storage::disk('cache')->get("avatar/$tid-$size")); } } diff --git a/app/Listeners/CacheSkinPreview.php b/app/Listeners/CacheSkinPreview.php index a07e615a..bf1c2034 100644 --- a/app/Listeners/CacheSkinPreview.php +++ b/app/Listeners/CacheSkinPreview.php @@ -17,22 +17,23 @@ class CacheSkinPreview */ public function handle(GetSkinPreview $event) { - $tid = $event->texture->tid; + $tid = $event->texture->tid; + $size = $event->size; - if (!Storage::disk('cache')->has("preview/$tid")) { + if (!Storage::disk('cache')->has("preview/$tid-$size")) { $filename = BASE_DIR."/storage/textures/{$event->texture->hash}"; if ($event->texture->type == "cape") { $png = \Minecraft::generatePreviewFromCape($filename, $event->size); - imagepng($png, BASE_DIR."/storage/cache/preview/$tid"); + imagepng($png, BASE_DIR."/storage/cache/preview/$tid-$size"); imagedestroy($png); } else { $png = \Minecraft::generatePreviewFromSkin($filename, $event->size); - imagepng($png, BASE_DIR."/storage/cache/preview/$tid"); + imagepng($png, BASE_DIR."/storage/cache/preview/$tid-$size"); imagedestroy($png); } } - return \Response::png(Storage::disk('cache')->get("preview/$tid")); + return \Response::png(Storage::disk('cache')->get("preview/$tid-$size")); } }