2016-08-28 10:05:21 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2019-03-21 12:44:15 +08:00
|
|
|
use Event;
|
|
|
|
use App\Events;
|
|
|
|
use App\Listeners;
|
2016-08-28 10:05:21 +08:00
|
|
|
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
|
|
|
|
|
|
|
class EventServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* The event listener mappings for the application.
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
protected $listen = [
|
2019-04-23 23:34:04 +08:00
|
|
|
'App\Events\PlayerRetrieved' => [
|
|
|
|
'App\Listeners\ResetInvalidTextureForPlayer',
|
|
|
|
],
|
2019-05-07 15:16:53 +08:00
|
|
|
'App\Events\TextureDeleting' => [
|
|
|
|
'App\Listeners\TextureRemoved',
|
|
|
|
],
|
2016-08-28 10:05:21 +08:00
|
|
|
];
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register any other events for your application.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2018-07-11 16:09:54 +08:00
|
|
|
public function boot()
|
2016-08-28 10:05:21 +08:00
|
|
|
{
|
2018-07-11 16:09:54 +08:00
|
|
|
parent::boot();
|
2019-03-21 12:44:15 +08:00
|
|
|
|
|
|
|
if (option('enable_avatar_cache')) {
|
|
|
|
Event::listen(Events\GetAvatarPreview::class, Listeners\CacheAvatarPreview::class);
|
|
|
|
}
|
|
|
|
if (option('enable_preview_cache')) {
|
|
|
|
Event::listen(Events\GetSkinPreview::class, Listeners\CacheSkinPreview::class);
|
|
|
|
}
|
|
|
|
if (option('enable_notfound_cache')) {
|
|
|
|
Event::subscribe(Listeners\CachePlayerExists::class);
|
|
|
|
}
|
|
|
|
if (option('enable_json_cache')) {
|
|
|
|
Event::subscribe(Listeners\CachePlayerJson::class);
|
|
|
|
}
|
2016-08-28 10:05:21 +08:00
|
|
|
}
|
|
|
|
}
|