blessing-skin-server/app/Providers/EventServiceProvider.php

49 lines
1.2 KiB
PHP
Raw Normal View History

2016-08-28 10:05:21 +08:00
<?php
namespace App\Providers;
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 = [
'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();
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
}
}