diff --git a/app/Console/Commands/CombatLog/CreateMappingVersion.php b/app/Console/Commands/CombatLog/CreateMappingVersion.php index 79257ed450..306571a546 100644 --- a/app/Console/Commands/CombatLog/CreateMappingVersion.php +++ b/app/Console/Commands/CombatLog/CreateMappingVersion.php @@ -71,7 +71,7 @@ private function createMappingVersionFromCombatLog( '- %s mapping version %s (%s, %d, %d enemies)', $hasMappingVersion ? 'Updated' : 'Created', $mappingVersion->version, - __($mappingVersion->dungeon->name, [], 'en'), + __($mappingVersion->dungeon->name, [], 'en-US'), $mappingVersion->id, $mappingVersion->enemies()->count(), ) diff --git a/app/Console/Commands/Dungeon/CreateMissing.php b/app/Console/Commands/Dungeon/CreateMissing.php index 91650b815f..830d96b1ac 100644 --- a/app/Console/Commands/Dungeon/CreateMissing.php +++ b/app/Console/Commands/Dungeon/CreateMissing.php @@ -61,7 +61,7 @@ public function handle(): int $expansion = $expansions->get($expansionKey); $nameTranslationKey = sprintf('dungeons.%s.%s.name', $expansionKey, $dungeonKey); - $nameTranslated = __($nameTranslationKey, [], 'en'); + $nameTranslated = __($nameTranslationKey, [], 'en-US'); Dungeon::create([ 'expansion_id' => $expansion->id, diff --git a/app/Console/Commands/Dungeon/CreateMissingFloors.php b/app/Console/Commands/Dungeon/CreateMissingFloors.php index b860fd9d3f..bb326383a0 100644 --- a/app/Console/Commands/Dungeon/CreateMissingFloors.php +++ b/app/Console/Commands/Dungeon/CreateMissingFloors.php @@ -51,9 +51,9 @@ public function handle(): int $dungeonTranslationKey = explode('.', $dungeon->name)[2]; $floorsTranslationKey = sprintf('dungeons.%s.%s.floors', $dungeon->expansion->shortname, $dungeonTranslationKey); - $translatedFloors = __($floorsTranslationKey, [], 'en'); + $translatedFloors = __($floorsTranslationKey, [], 'en-US'); - $this->info(sprintf('- %s', __($dungeon->name, [], 'en'))); + $this->info(sprintf('- %s', __($dungeon->name, [], 'en-US'))); $index = 1; foreach ($translatedFloors as $key => $value) { $floorKey = sprintf('%s.%s', $floorsTranslationKey, $key); @@ -65,7 +65,7 @@ public function handle(): int 'default' => $index === 1, ]); - $this->comment(sprintf('-- Added new floor %s', __($floorKey, [], 'en'))); + $this->comment(sprintf('-- Added new floor %s', __($floorKey, [], 'en-US'))); $index++; } diff --git a/app/Console/Commands/Environment/Update.php b/app/Console/Commands/Environment/Update.php index 20bae96946..79fdcef70b 100644 --- a/app/Console/Commands/Environment/Update.php +++ b/app/Console/Commands/Environment/Update.php @@ -114,7 +114,7 @@ public function handle(): int $this->call('supervisor:start'); } - // Refresh the subcreation ease tiers (for a first run to populate the data) + // Refresh the affix group ease tiers (for a first run to populate the data) $this->call('affixgroupeasetiers:refresh'); // Dispatch the refreshing of the discovery cache - this can take up to 5 minutes and can be done in the background RefreshDiscoverCache::dispatch(); diff --git a/app/Console/Commands/Mapping/AssignMDTIDs.php b/app/Console/Commands/Mapping/AssignMDTIDs.php index c6ce564578..854099bfd0 100644 --- a/app/Console/Commands/Mapping/AssignMDTIDs.php +++ b/app/Console/Commands/Mapping/AssignMDTIDs.php @@ -49,12 +49,12 @@ public function handle() return $enemy->mdt_id > 0; })->isNotEmpty()) { $this->comment( - sprintf('- Skipping dungeon %s - already assigned has assigned MDT IDs', __($mappingVersion->dungeon->name, [], 'en')) + sprintf('- Skipping dungeon %s - already assigned has assigned MDT IDs', __($mappingVersion->dungeon->name, [], 'en-US')) ); continue; } - $this->info(sprintf('Assigning MDT IDs for dungeon %s', __($mappingVersion->dungeon->name, [], 'en'))); + $this->info(sprintf('Assigning MDT IDs for dungeon %s', __($mappingVersion->dungeon->name, [], 'en-US'))); $previousNpcId = 0; foreach ($enemies as $enemy) { diff --git a/app/Console/Commands/Scheduler/RefreshAffixGroupEaseTiers.php b/app/Console/Commands/Scheduler/RefreshAffixGroupEaseTiers.php index 6711db7873..1584e34866 100644 --- a/app/Console/Commands/Scheduler/RefreshAffixGroupEaseTiers.php +++ b/app/Console/Commands/Scheduler/RefreshAffixGroupEaseTiers.php @@ -2,24 +2,15 @@ namespace App\Console\Commands\Scheduler; -use App\Models\Affix; use App\Models\AffixGroup\AffixGroupEaseTier; -use App\Models\Dungeon; -use App\Models\SubcreationEaseTierPull; -use App\Service\Season\SeasonServiceInterface; -use App\Service\Subcreation\Exceptions\InvalidResponseException; -use App\Service\Subcreation\SubcreationApiServiceInterface; -use Carbon\Carbon; -use DateTimeZone; -use Exception; +use App\Models\AffixGroup\AffixGroupEaseTierPull; +use App\Service\AffixGroup\AffixGroupEaseTierServiceInterface; +use App\Service\AffixGroup\ArchonApiServiceInterface; +use App\Service\AffixGroup\Exceptions\InvalidResponseException; use Illuminate\Console\Command; class RefreshAffixGroupEaseTiers extends Command { - private const DUNGEON_NAME_MAPPING = [ - 'Dawn of the Infinite: Galakrond\'s Fall' => 'DOTI: Galakrond\'s Fall', - 'Dawn of the Infinite: Murozond\'s Rise' => 'DOTI: Murozond\'s Rise', - ]; /** * The name and signature of the console command. @@ -33,7 +24,7 @@ class RefreshAffixGroupEaseTiers extends Command * * @var string */ - protected $description = 'Refreshes the affix group ease tiers from Subcreation.net'; + protected $description = 'Refreshes the affix group ease tiers from Archon.gg'; /** * Create a new command instance. @@ -48,141 +39,34 @@ public function __construct() /** * Execute the console command. * - * @param SubcreationApiServiceInterface $subcreationApiService - * @param SeasonServiceInterface $seasonService + * @param ArchonApiServiceInterface $archonApiService + * @param AffixGroupEaseTierServiceInterface $affixGroupEaseTierService * @return int - * @throws Exception */ - public function handle(SubcreationApiServiceInterface $subcreationApiService, SeasonServiceInterface $seasonService) - { + public function handle( + ArchonApiServiceInterface $archonApiService, + AffixGroupEaseTierServiceInterface $affixGroupEaseTierService + ): int { try { - $tierLists = $subcreationApiService->getDungeonEaseTierListOverall(); + $tierLists = $archonApiService->getDungeonEaseTierListOverall(); } catch (InvalidResponseException $exception) { $this->error(sprintf('Invalid response: %s', $exception->getMessage())); - // @TODO fix when reimplementing Subcreation but as Archon instead. - return 0; + return -1; } - if (!isset($tierLists['last_updated']) || !isset($tierLists['current_affixes']) || !isset($tierLists['source_url']) || !isset($tierLists['tier_lists'])) { + if (!isset($tierLists['encounterTierList'])) { $this->error(sprintf('Invalid response: %s', json_encode($tierLists))); return -1; } - $lastUpdatedAt = Carbon::createFromFormat('Y-m-d G:i:s.uP', $tierLists['last_updated']); - $lastEaseTierPull = SubcreationEaseTierPull::latest()->first(); - - if ($lastEaseTierPull === null || $lastUpdatedAt->isAfter($lastEaseTierPull->last_updated_at)) { - $subcreationEaseTierPull = SubcreationEaseTierPull::create([ - 'current_affixes' => $tierLists['current_affixes'], - 'source_url' => $tierLists['source_url'], - 'last_updated_at' => $lastUpdatedAt->setTimezone(new DateTimeZone(config('app.timezone')))->toDateTimeString(), - ]); - - $dungeonList = Dungeon::active()->get(); - $totalSaved = 0; - - foreach ($tierLists['tier_lists'] as $affixString => $tierList) { - $this->info(sprintf('- Parsing %s', $affixString)); - - $affixGroupId = $this->getAffixGroupByString($seasonService, $affixString); - - // Only if we actually found an affix.. - if ($affixGroupId !== null) { - $this->info(sprintf('-- Parsing for AffixGroup %s (%s)', $affixString, $affixGroupId)); - $saved = 0; - - foreach ($tierList as $tier => $dungeons) { - foreach ($dungeons as $dungeonName) { - // If found - $dungeon = $dungeonList->first(function (Dungeon $dungeon) use ($dungeonName) { - // Translate the name of the dungeon to English (from a key), and then match it - $ksgDungeonName = __($dungeon->name, [], 'en-US'); - - return (self::DUNGEON_NAME_MAPPING[$ksgDungeonName] ?? $ksgDungeonName) === $dungeonName; - }); - - if ($dungeon instanceof Dungeon) { - (new AffixGroupEaseTier([ - 'subcreation_ease_tier_pull_id' => $subcreationEaseTierPull->id, - 'affix_group_id' => $affixGroupId, - 'dungeon_id' => $dungeon->id, - 'tier' => $tier, - ]))->save(); - - $saved++; - $totalSaved++; - $this->info(sprintf('--- Saved dungeon %s (%s)', $dungeonName, $dungeon->id)); - } else { - $this->error(sprintf('--- Unknown dungeon %s', $dungeonName)); - } - } - } - - $this->info(sprintf('-- Saved %s ease tiers', $saved)); - } else { - $this->error(sprintf('-- Unable to find AffixGroup for affixes %s', $affixString)); - } - } - } else { - $this->warn('Cannot update the Subcreation ease tier tiers - the data has not updated yet'); - } + $affixGroupEaseTierService->parseTierList($tierLists); // Clear model cache so that it will be refreshed upon next request $this->call('modelCache:clear', ['--model' => AffixGroupEaseTier::class]); - $this->call('modelCache:clear', ['--model' => SubcreationEaseTierPull::class]); + $this->call('modelCache:clear', ['--model' => AffixGroupEaseTierPull::class]); return 0; } - - /** - * @param SeasonServiceInterface $seasonService - * @param string $affixString - * @return int|null - */ - private function getAffixGroupByString(SeasonServiceInterface $seasonService, string $affixString): ?int - { - $affixGroupId = null; - - $affixList = Affix::all(); - $currentSeason = $seasonService->getCurrentSeason(); - $currentSeasonAffixGroups = $currentSeason->affixgroups; - - $affixes = collect(explode(', ', $affixString)); - - // Filter out properties that don't have the correct amount of affixes - if ($affixes->count() === 3 + (int)($currentSeason->seasonal_affix_id !== null)) { - // Check if there's any affixes in the list that we cannot find in our own database - $invalidAffixes = $affixes->filter(function (string $affixName) use ($affixList) { - // Find the affix in the list and match by translated name - must be found to continue - return $affixList->filter(function (Affix $affix) use ($affixName) { - return __($affix->name, [], 'en-US') === $affixName; - })->isEmpty(); - }); - - // Non invalid affixes found, great! - if ($invalidAffixes->isNotEmpty()) { - $this->error(sprintf('Unable to find Affix(es) %s', $invalidAffixes->join(', '))); - } // Cannot find an affix in this list - perhaps it's new? - else { - // Now we must find affixgroups that correspond to the affix list - foreach ($currentSeasonAffixGroups as $affixGroup) { - - // Loop over the affixes of the affix group and empty the list - $notFoundAffixes = $affixGroup->affixes->filter(function (Affix $affix) use ($affixes) { - return $affixes->search($affix->key) === false; - }); - - // If we have found the match, we're done - if ($notFoundAffixes->isEmpty()) { - $affixGroupId = $affixGroup->id; - break; - } - } - } - } - - return $affixGroupId; - } } diff --git a/app/Http/Resources/Affix/AffixResource.php b/app/Http/Resources/Affix/AffixResource.php index f65cd3d7b6..1615a311ff 100644 --- a/app/Http/Resources/Affix/AffixResource.php +++ b/app/Http/Resources/Affix/AffixResource.php @@ -25,7 +25,7 @@ public function toArray($request) { return [ 'id' => $this->affix_id, - 'name' => __($this->name, [], 'en') + 'name' => __($this->name, [], 'en-US') ]; } -} \ No newline at end of file +} diff --git a/app/Http/Resources/Dungeon/DungeonResource.php b/app/Http/Resources/Dungeon/DungeonResource.php index 0f7207f864..8f21868735 100644 --- a/app/Http/Resources/Dungeon/DungeonResource.php +++ b/app/Http/Resources/Dungeon/DungeonResource.php @@ -25,10 +25,10 @@ public function toArray($request) return [ 'id' => $this->id, 'expansion_id' => $this->expansion_id, - 'name' => __($this->name, [], 'en'), + 'name' => __($this->name, [], 'en-US'), 'slug' => $this->slug, 'key' => $this->key, 'speedrun_enabled' => $this->speedrun_enabled, ]; } -} \ No newline at end of file +} diff --git a/app/Jobs/RefreshDiscoverCache.php b/app/Jobs/RefreshDiscoverCache.php index 10fc6fe5dd..1a360b9977 100644 --- a/app/Jobs/RefreshDiscoverCache.php +++ b/app/Jobs/RefreshDiscoverCache.php @@ -15,6 +15,14 @@ class RefreshDiscoverCache implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; + public int $timeout = 1800; + + public function __construct() + { + $this->queue = sprintf('%s-%s-long-running', config('app.type'), config('app.env')); + } + + /** * @throws Exception */ diff --git a/app/Logging/StructuredLogging.php b/app/Logging/StructuredLogging.php index dc155cb733..918887ead2 100644 --- a/app/Logging/StructuredLogging.php +++ b/app/Logging/StructuredLogging.php @@ -3,6 +3,8 @@ namespace App\Logging; use App\Logic\Utils\Stopwatch; +use Illuminate\Container\Container; +use Illuminate\Foundation\Application; use Monolog\Logger; class StructuredLogging implements StructuredLoggingInterface @@ -15,9 +17,20 @@ class StructuredLogging implements StructuredLoggingInterface private ?string $channel = null; + public function __construct() + { + /** @var Application|Container $app */ + $app = app(); + + if ($app->runningInConsole()) { + $this->setChannel('stderr'); + } + } + + /** * @param string $key - * @param array $context + * @param array $context * @return void */ public function addContext(string $key, ...$context): void @@ -52,12 +65,13 @@ protected function getChannel(): ?string protected function setChannel(?string $channel): StructuredLogging { $this->channel = $channel; + return $this; } /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function start(string $functionName, array $context = []): void @@ -78,7 +92,7 @@ protected function start(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function end(string $functionName, array $context = []): void @@ -100,7 +114,7 @@ protected function end(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function debug(string $functionName, array $context = []): void @@ -110,7 +124,7 @@ protected function debug(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function notice(string $functionName, array $context = []): void @@ -120,7 +134,7 @@ protected function notice(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function info(string $functionName, array $context = []): void @@ -130,7 +144,7 @@ protected function info(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function warning(string $functionName, array $context = []): void @@ -140,7 +154,7 @@ protected function warning(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function error(string $functionName, array $context = []): void @@ -150,7 +164,7 @@ protected function error(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function critical(string $functionName, array $context = []): void @@ -160,7 +174,7 @@ protected function critical(string $functionName, array $context = []): void /** * @param string $functionName - * @param array $context + * @param array $context * @return void */ protected function emergency(string $functionName, array $context = []): void @@ -169,9 +183,9 @@ protected function emergency(string $functionName, array $context = []): void } /** - * @param int $level + * @param int $level * @param string $functionName - * @param array $context + * @param array $context * @return void */ private function log(int $level, string $functionName, array $context = []): void diff --git a/app/Models/AffixGroup/AffixGroupEaseTier.php b/app/Models/AffixGroup/AffixGroupEaseTier.php index 6f9afdec5d..f665b95214 100644 --- a/app/Models/AffixGroup/AffixGroupEaseTier.php +++ b/app/Models/AffixGroup/AffixGroupEaseTier.php @@ -4,38 +4,40 @@ use App\Models\CacheModel; use App\Models\Dungeon; -use App\Models\SubcreationEaseTierPull; use Eloquent; use Illuminate\Database\Eloquent\Relations\BelongsTo; /** - * @property int $id The ID of this Affix. - * @property int $subcreation_ease_tier_pull_id - * @property int $affix_group_id - * @property int $dungeon_id - * @property string $tier + * @property int $id + * @property int $affix_group_ease_tier_pull_id + * @property int $affix_group_id + * @property int $dungeon_id + * @property string $tier * - * @property AffixGroup $affixgroup - * @property Dungeon $dungeon + * @property AffixGroupEaseTierPull $affixGroupEaseTierPull + * @property AffixGroup $affixGroup + * @property Dungeon $dungeon * * @mixin Eloquent */ class AffixGroupEaseTier extends CacheModel { - public $fillable = ['subcreation_ease_tier_pull_id', 'affix_group_id', 'dungeon_id', 'tier']; + public $fillable = ['affix_group_ease_tier_pull_id', 'affix_group_id', 'dungeon_id', 'tier']; + + public $timestamps = false; /** * @return BelongsTo */ - public function subcreationeasetierpull(): BelongsTo + public function affixGroupEaseTierPull(): BelongsTo { - return $this->belongsTo(SubcreationEaseTierPull::class); + return $this->belongsTo(AffixGroupEaseTierPull::class); } /** * @return BelongsTo */ - public function affixgroup(): BelongsTo + public function affixGroup(): BelongsTo { return $this->belongsTo(AffixGroup::class); } diff --git a/app/Models/AffixGroup/AffixGroupEaseTierPull.php b/app/Models/AffixGroup/AffixGroupEaseTierPull.php new file mode 100644 index 0000000000..e9d9cc3b89 --- /dev/null +++ b/app/Models/AffixGroup/AffixGroupEaseTierPull.php @@ -0,0 +1,64 @@ +belongsTo(AffixGroup::class); + } + + /** + * @return HasMany + */ + public function affixGroupEaseTiers(): HasMany + { + return $this->hasMany(AffixGroupEaseTier::class); + } + + /** + * @return void + */ + public static function boot() + { + parent::boot(); + + // Delete AffixGroupEaseTiers properly if it gets deleted + static::deleting(function (AffixGroupEaseTierPull $affixGroupEaseTierPull) { + $affixGroupEaseTierPull->affixGroupEaseTiers()->delete(); + }); + } +} diff --git a/app/Models/SubcreationEaseTierPull.php b/app/Models/SubcreationEaseTierPull.php deleted file mode 100644 index 7a8ce4e4a9..0000000000 --- a/app/Models/SubcreationEaseTierPull.php +++ /dev/null @@ -1,39 +0,0 @@ -hasMany(AffixGroupEaseTier::class); - } -} diff --git a/app/Providers/KeystoneGuruServiceProvider.php b/app/Providers/KeystoneGuruServiceProvider.php index 93c70c20ae..ac58858dc6 100644 --- a/app/Providers/KeystoneGuruServiceProvider.php +++ b/app/Providers/KeystoneGuruServiceProvider.php @@ -13,6 +13,8 @@ use App\Models\Season; use App\Models\SimulationCraft\SimulationCraftRaidEventsOptions; use App\Models\UserReport; +use App\Service\AdProvider\AdProviderService; +use App\Service\AdProvider\AdProviderServiceInterface; use App\Service\Cache\CacheService; use App\Service\Cache\CacheServiceInterface; use App\Service\Cache\DevCacheService; @@ -39,6 +41,10 @@ use App\Service\DungeonRoute\DiscoverServiceInterface; use App\Service\DungeonRoute\ThumbnailService; use App\Service\DungeonRoute\ThumbnailServiceInterface; +use App\Service\AffixGroup\AffixGroupEaseTierService; +use App\Service\AffixGroup\AffixGroupEaseTierServiceInterface; +use App\Service\AffixGroup\ArchonApiService; +use App\Service\AffixGroup\ArchonApiServiceInterface; use App\Service\EchoServer\EchoServerHttpApiService; use App\Service\EchoServer\EchoServerHttpApiServiceInterface; use App\Service\Expansion\ExpansionData; @@ -62,8 +68,6 @@ use App\Service\MDT\MDTMappingImportServiceInterface; use App\Service\Metric\MetricService; use App\Service\Metric\MetricServiceInterface; -use App\Service\AdProvider\AdProviderService; -use App\Service\AdProvider\AdProviderServiceInterface; use App\Service\Npc\NpcService; use App\Service\Npc\NpcServiceInterface; use App\Service\Patreon\PatreonApiService; @@ -78,10 +82,6 @@ use App\Service\Season\SeasonServiceInterface; use App\Service\SimulationCraft\RaidEventsService; use App\Service\SimulationCraft\RaidEventsServiceInterface; -use App\Service\Subcreation\AffixGroupEaseTierService; -use App\Service\Subcreation\AffixGroupEaseTierServiceInterface; -use App\Service\Subcreation\SubcreationApiService; -use App\Service\Subcreation\SubcreationApiServiceInterface; use App\Service\TimewalkingEvent\TimewalkingEventService; use App\Service\TimewalkingEvent\TimewalkingEventServiceInterface; use App\Service\User\UserService; @@ -147,9 +147,11 @@ public function register() $this->app->bind(SeasonServiceInterface::class, SeasonService::class); $this->app->bind(OverpulledEnemyServiceInterface::class, OverpulledEnemyService::class); $this->app->bind(MappingServiceInterface::class, MappingService::class); - $this->app->bind(AffixGroupEaseTierServiceInterface::class, AffixGroupEaseTierService::class); $this->app->bind(CoverageServiceInterface::class, CoverageService::class); + // Depends on SeasonService + $this->app->bind(AffixGroupEaseTierServiceInterface::class, AffixGroupEaseTierService::class); + // Depends on CacheService, CoordinatesService, OverpulledEnemyService $this->app->bind(MapContextServiceInterface::class, MapContextService::class); @@ -168,7 +170,7 @@ public function register() // External communication $this->app->bind(DiscordApiServiceInterface::class, DiscordApiService::class); $this->app->bind(RedditApiServiceInterface::class, RedditApiService::class); - $this->app->bind(SubcreationApiServiceInterface::class, SubcreationApiService::class); + $this->app->bind(ArchonApiServiceInterface::class, ArchonApiService::class); $this->app->bind(PatreonApiServiceInterface::class, PatreonApiService::class); $this->app->bind(WowToolsServiceInterface::class, WowToolsService::class); $this->app->bind(AdProviderServiceInterface::class, AdProviderService::class); diff --git a/app/Providers/LoggingServiceProvider.php b/app/Providers/LoggingServiceProvider.php index 6eb4c25bd3..c6cf76fabe 100644 --- a/app/Providers/LoggingServiceProvider.php +++ b/app/Providers/LoggingServiceProvider.php @@ -2,6 +2,9 @@ namespace App\Providers; +use App\Logging\StructuredLogging; +use App\Service\AffixGroup\Logging\AffixGroupEaseTierServiceLogging; +use App\Service\AffixGroup\Logging\AffixGroupEaseTierServiceLoggingInterface; use App\Service\CombatLog\Logging\BaseCombatFilterLogging; use App\Service\CombatLog\Logging\BaseCombatFilterLoggingInterface; use App\Service\CombatLog\Logging\CombatLogDataExtractionServiceLogging; @@ -34,6 +37,7 @@ use App\Service\Patreon\Logging\PatreonServiceLoggingInterface; use App\Service\WowTools\Logging\WowToolsServiceLogging; use App\Service\WowTools\Logging\WowToolsServiceLoggingInterface; +use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; class LoggingServiceProvider extends ServiceProvider @@ -45,6 +49,9 @@ public function register() { parent::register(); + // AffixGroup + $this->app->bind(AffixGroupEaseTierServiceLoggingInterface::class, AffixGroupEaseTierServiceLogging::class); + // Combat log $this->app->bind(CombatLogServiceLoggingInterface::class, CombatLogServiceLogging::class); $this->app->bind(CombatLogDungeonRouteServiceLoggingInterface::class, CombatLogDungeonRouteServiceLogging::class); diff --git a/app/Service/AffixGroup/AffixGroupEaseTierService.php b/app/Service/AffixGroup/AffixGroupEaseTierService.php new file mode 100644 index 0000000000..623e5551f4 --- /dev/null +++ b/app/Service/AffixGroup/AffixGroupEaseTierService.php @@ -0,0 +1,257 @@ + 'Galakrond\'s Fall', + 'Dawn of the Infinite: Murozond\'s Rise' => 'Murozond\'s Rise', + 'The Everbloom' => 'Everbloom', + ]; + + private SeasonServiceInterface $seasonService; + + private AffixGroupEaseTierServiceLoggingInterface $log; + + /** + * @param SeasonServiceInterface $seasonService + * @param AffixGroupEaseTierServiceLoggingInterface $log + */ + public function __construct( + SeasonServiceInterface $seasonService, + AffixGroupEaseTierServiceLoggingInterface $log) + { + $this->seasonService = $seasonService; + $this->log = $log; + } + + /** + * @param array $tierList + * @param array $dungeonNameMapping + * @return string + */ + public function getTiersHash(array $tierList, array $dungeonNameMapping): string + { + $affixes = $tierList['encounterTierList']['label']; + $tiersByDungeon = []; + foreach ($tierList['encounterTierList']['tierLists'][0]['tiers'] as $tier) { + + foreach ($tier['entries'] as $entry) { + $tiersByDungeon[$dungeonNameMapping[$entry['name']] ?? $entry['name']] = $tier['tier']; + } + } + + // Sort by name + ksort($tiersByDungeon); + + $implode = []; + foreach ($tiersByDungeon as $dungeon => $tier) { + $implode[] = sprintf( + '%s|%s|%s', + $dungeon, + $affixes, + $tier + ); + } + + return md5(implode('|', $implode)); + } + + /** + * @inheritDoc + */ + public function parseTierList(array $tierListsResponse): ?AffixGroupEaseTierPull + { + $lastEaseTierPull = AffixGroupEaseTierPull::latest()->first(); + + $affixGroupString = $tierListsResponse['encounterTierList']['label']; + $affixGroup = $this->getAffixGroupByString($affixGroupString); + + if ($affixGroup === null) { + $this->log->parseTierListUnknownAffixGroup($affixGroupString); + + return null; + } + + $result = null; + $tiersHash = $this->getTiersHash($tierListsResponse, array_flip(self::DUNGEON_NAME_MAPPING)); + + if ($lastEaseTierPull === null || + $lastEaseTierPull->affix_group_id !== $affixGroup->id || + $lastEaseTierPull->tiers_hash !== $tiersHash) { + + $affixGroupString = $affixGroup->text; + $affixGroupEaseTierPull = AffixGroupEaseTierPull::create([ + 'affix_group_id' => $affixGroup->id, + 'tiers_hash' => $tiersHash, + 'last_updated_at' => Carbon::now()->toDateTimeString(), + ]); + + $dungeonList = Dungeon::active()->get()->keyBy(function (Dungeon $dungeon) { + // Translate the name of the dungeon to English (from a key), and then match it + $ksgDungeonName = __($dungeon->name, [], 'en-US'); + + return (self::DUNGEON_NAME_MAPPING[$ksgDungeonName] ?? $ksgDungeonName); + }); + + $affixGroupEaseTiersAttributes = []; + foreach ($tierListsResponse['encounterTierList']['tierLists'][0]['tiers'] as $tierList) { + /** @var array{tier: string, entries: array} $tierList */ + try { + $tier = $tierList['tier']; + $this->log->parseTierListParseTierStart($affixGroupString, $tier, count($tierList['entries'])); + + foreach ($tierList['entries'] as $dungeon) { + /** @var array{id: int, name: string, url: string} $dungeon */ + // If found + $dungeonName = $dungeon['name']; + $dungeon = $dungeonList->get($dungeonName); + + if ($dungeon === null) { + $this->log->parseTierListUnknownDungeon($dungeonName); + + continue; + } + + $affixGroupEaseTiersAttributes[] = [ + 'affix_group_ease_tier_pull_id' => $affixGroupEaseTierPull->id, + 'affix_group_id' => $affixGroup->id, + 'dungeon_id' => $dungeon->id, + 'tier' => $tier, + ]; + + $this->log->parseTierListSavedDungeonTier($dungeonName, $tier); + } + } finally { + $this->log->parseTierListParseTierEnd(); + } + } + + $affixGroupEaseTierSaveResult = AffixGroupEaseTier::insert($affixGroupEaseTiersAttributes); + $this->log->parseTierListSave($affixGroupEaseTierSaveResult); + + $result = $affixGroupEaseTierPull; + } else { + $this->log->parseTierListDataNotUpdatedYet(); + } + + return $result; + } + + /** + * @inheritDoc + */ + public function getTierForAffixAndDungeon(AffixGroup $affixGroup, Dungeon $dungeon): ?string + { + $result = null; + + $latestAffixGroupEaseTierPull = AffixGroupEaseTierPull::latest()->first(); + + if ($latestAffixGroupEaseTierPull !== null) { + /** @var AffixGroupEaseTier|null $affixGroupEaseTier */ + $affixGroupEaseTier = $latestAffixGroupEaseTierPull->affixGroupEaseTiers() + ->where('affix_group_id', $affixGroup->id) + ->where('dungeon_id', $dungeon->id) + ->first(); + + $result = optional($affixGroupEaseTier)->tier; + } + + return $result; + } + + /** + * @inheritDoc + */ + public function getTiersByAffixGroups(Collection $affixGroups): Collection + { + $result = collect(); + + $latestAffixGroupEaseTierPull = AffixGroupEaseTierPull::latest()->first(); + if ($latestAffixGroupEaseTierPull !== null) { + /** @var AffixGroupEaseTier|null $affixGroupEaseTier */ + $result = $latestAffixGroupEaseTierPull->affixGroupEaseTiers() + ->whereIn('affix_group_id', $affixGroups->pluck('id')->toArray()) + ->get() + ->groupBy('affix_group_id'); + } + + return $result; + } + + /** + * @inheritDoc + */ + public function getTiers(): Collection + { + $result = collect(); + + $latestAffixGroupEaseTierPull = AffixGroupEaseTierPull::latest()->first(); + if ($latestAffixGroupEaseTierPull !== null) { + $result = $latestAffixGroupEaseTierPull->affixGroupEaseTiers; + } + + return $result; + } + + + /** + * @inheritdoc + */ + public function getAffixGroupByString(string $affixString): ?AffixGroup + { + $result = null; + + $affixList = Affix::all(); + $currentSeason = $this->seasonService->getCurrentSeason(); + $currentSeasonAffixGroups = $currentSeason->affixgroups; + + $affixes = collect(explode(', ', $affixString)); + + // Filter out properties that don't have the correct amount of affixes + if ($affixes->count() === 3 + (int)($currentSeason->seasonal_affix_id !== null)) { + // Check if there's any affixes in the list that we cannot find in our own database + $invalidAffixes = $affixes->filter(function (string $affixName) use ($affixList) { + // Find the affix in the list and match by translated name - must be found to continue + return $affixList->filter(function (Affix $affix) use ($affixName) { + return __($affix->name, [], 'en-US') === $affixName; + })->isEmpty(); + }); + + // No invalid affixes found, great! + if ($invalidAffixes->isEmpty()) { + // Now we must find affix groups that correspond to the affix list + foreach ($currentSeasonAffixGroups as $affixGroup) { + + // Loop over the affixes of the affix group and empty the list + $notFoundAffixes = $affixGroup->affixes->filter(function (Affix $affix) use ($affixes) { + return $affixes->search($affix->key) === false; + }); + + // If we have found the match, we're done + if ($notFoundAffixes->isEmpty()) { + $result = $affixGroup; + break; + } + } + } else { + $this->log->getAffixGroupByStringUnknownAffixes($invalidAffixes->join(', ')); + } + } + + return $result; + } +} diff --git a/app/Service/AffixGroup/AffixGroupEaseTierServiceInterface.php b/app/Service/AffixGroup/AffixGroupEaseTierServiceInterface.php new file mode 100644 index 0000000000..e995547ee4 --- /dev/null +++ b/app/Service/AffixGroup/AffixGroupEaseTierServiceInterface.php @@ -0,0 +1,49 @@ +curlGet('https://www.archon.gg/wow/tier-list/dps-rankings/mythic-plus/20/all-dungeons/this-week/data.json'); + + $response = json_decode($responseStr, true); + + if (!is_array($response)) { + throw new InvalidResponseException($responseStr); + } + + // Temp fix for strange characters being put in front of the affix list + $response['encounterTierList']['label'] = trim($response['encounterTierList']['label'], '‍'); + + return $response; + } +} diff --git a/app/Service/AffixGroup/ArchonApiServiceInterface.php b/app/Service/AffixGroup/ArchonApiServiceInterface.php new file mode 100644 index 0000000000..e68b13656f --- /dev/null +++ b/app/Service/AffixGroup/ArchonApiServiceInterface.php @@ -0,0 +1,15 @@ +error(__METHOD__, get_defined_vars()); + } + + public function parseTierListParseTierStart(string $affixGroupString, string $tier, int $count): void + { + $this->start(__METHOD__, get_defined_vars()); + } + + public function parseTierListUnknownDungeon(string $dungeonName): void + { + $this->error(__METHOD__, get_defined_vars()); + } + + public function parseTierListSavedDungeonTier(string $dungeonName, string $tier): void + { + $this->debug(__METHOD__, get_defined_vars()); + } + + public function parseTierListParseTierEnd(): void + { + $this->end(__METHOD__); + } + + public function parseTierListSave(bool $result): void + { + $this->debug(__METHOD__, get_defined_vars()); + } + + public function parseTierListDataNotUpdatedYet(): void + { + $this->info(__METHOD__); + } + + public function getAffixGroupByStringUnknownAffixes(string $unknownAffixes): void + { + $this->error(__METHOD__, get_defined_vars()); + } +} diff --git a/app/Service/AffixGroup/Logging/AffixGroupEaseTierServiceLoggingInterface.php b/app/Service/AffixGroup/Logging/AffixGroupEaseTierServiceLoggingInterface.php new file mode 100644 index 0000000000..52c3727d75 --- /dev/null +++ b/app/Service/AffixGroup/Logging/AffixGroupEaseTierServiceLoggingInterface.php @@ -0,0 +1,23 @@ +first(); } - $this->log->extractDataSetChallengeMode(__($dungeon->name, [], 'en'), $currentKeyLevel, $currentKeyAffixGroup->getTextAttribute()); + $this->log->extractDataSetChallengeMode(__($dungeon->name, [], 'en-US'), $currentKeyLevel, $currentKeyAffixGroup->getTextAttribute()); } else if ($parsedEvent instanceof ZoneChange) { @@ -101,7 +101,7 @@ public function extractData(string $filePath): ExtractedDataResult } else { $dungeon = Dungeon::where('map_id', $parsedEvent->getZoneId())->firstOrFail(); - $this->log->extractDataSetZone(__($dungeon->name, [], 'en')); + $this->log->extractDataSetZone(__($dungeon->name, [], 'en-US')); } } diff --git a/app/Service/CombatLog/CombatLogMappingVersionService.php b/app/Service/CombatLog/CombatLogMappingVersionService.php index 97ba04a2a1..18c0868ec4 100644 --- a/app/Service/CombatLog/CombatLogMappingVersionService.php +++ b/app/Service/CombatLog/CombatLogMappingVersionService.php @@ -170,7 +170,7 @@ private function createMappingVersionFromCombatLog( foreach ($dungeon->floors as $floor) { if ($floor->ingame_min_x === null || $floor->ingame_min_y === null || $floor->ingame_max_x === null || $floor->ingame_max_y === null) { throw new Exception( - sprintf('Floor %s is not configured yet - cannot place enemies on it!', __($floor->name, [], 'en')) + sprintf('Floor %s is not configured yet - cannot place enemies on it!', __($floor->name, [], 'en-US')) ); } } diff --git a/app/Service/MDT/Logging/MDTMappingImportServiceLogging.php b/app/Service/MDT/Logging/MDTMappingImportServiceLogging.php index 5116050dfb..ec342471e2 100644 --- a/app/Service/MDT/Logging/MDTMappingImportServiceLogging.php +++ b/app/Service/MDT/Logging/MDTMappingImportServiceLogging.php @@ -7,11 +7,6 @@ class MDTMappingImportServiceLogging extends StructuredLogging implements MDTMappingImportServiceLoggingInterface { - public function __construct() - { - $this->setChannel('stderr'); - } - /** * @param string|null $mdtMappingHash * @param string $latestMdtMappingHash diff --git a/app/Service/Subcreation/AffixGroupEaseTierService.php b/app/Service/Subcreation/AffixGroupEaseTierService.php deleted file mode 100644 index 093bf5f3f7..0000000000 --- a/app/Service/Subcreation/AffixGroupEaseTierService.php +++ /dev/null @@ -1,73 +0,0 @@ -first(); - - if ($latestSubcreationEaseTierPull !== null) { - /** @var AffixGroupEaseTier|null $affixGroupEaseTier */ - $affixGroupEaseTier = $latestSubcreationEaseTierPull->affixgroupeasetiers() - ->where('affix_group_id', $affixGroup->id) - ->where('dungeon_id', $dungeon->id) - ->first(); - - if ($affixGroupEaseTier !== null) { - $result = $affixGroupEaseTier->tier; - } - } - - return $result; - } - - /** - * @inheritDoc - */ - function getTiersByAffixGroups(Collection $affixGroups): Collection - { - $result = collect(); - - $latestSubcreationEaseTierPull = SubcreationEaseTierPull::latest()->first(); - if ($latestSubcreationEaseTierPull !== null) { - /** @var AffixGroupEaseTier|null $affixGroupEaseTier */ - $result = $latestSubcreationEaseTierPull->affixgroupeasetiers() - ->whereIn('affix_group_id', $affixGroups->pluck('id')->toArray()) - ->get() - ->groupBy('affix_group_id'); - } - - return $result; - } - - /** - * @inheritDoc - */ - function getTiers(): Collection - { - $result = collect(); - - $latestSubcreationEaseTierPull = SubcreationEaseTierPull::latest()->first(); - if ($latestSubcreationEaseTierPull !== null) { - $result = $latestSubcreationEaseTierPull->affixgroupeasetiers; - } - - return $result; - } - -} diff --git a/app/Service/Subcreation/AffixGroupEaseTierServiceInterface.php b/app/Service/Subcreation/AffixGroupEaseTierServiceInterface.php deleted file mode 100644 index 9cc5c469c2..0000000000 --- a/app/Service/Subcreation/AffixGroupEaseTierServiceInterface.php +++ /dev/null @@ -1,29 +0,0 @@ -curlGet('https://subcreation.net/api/v0/dungeon_ease_tier_list_overall'); - - $response = json_decode($responseStr, true); - - if (!is_array($response)) { - throw new InvalidResponseException($responseStr); - } - - return $response; - } -} diff --git a/app/Service/Subcreation/SubcreationApiServiceInterface.php b/app/Service/Subcreation/SubcreationApiServiceInterface.php deleted file mode 100644 index 3cc8e1d465..0000000000 --- a/app/Service/Subcreation/SubcreationApiServiceInterface.php +++ /dev/null @@ -1,9 +0,0 @@ - 2, 'tries' => 3, ], + 'supervisor-long-running' => [ + 'connection' => 'redis', + 'queue' => [sprintf('%s-production-long-running', env('APP_TYPE'))], + 'balance' => 'simple', + 'processes' => 1, + 'tries' => 1, + 'timeout' => 0, + ], 'supervisor-thumbnail' => [ 'connection' => 'redis', 'queue' => [sprintf('%s-production-thumbnail', env('APP_TYPE'))], @@ -171,6 +179,14 @@ 'processes' => 1, 'tries' => 3, ], + 'supervisor-long-running' => [ + 'connection' => 'redis', + 'queue' => [sprintf('%s-local-long-running', env('APP_TYPE'))], + 'balance' => 'simple', + 'processes' => 1, + 'tries' => 1, + 'timeout' => 0, + ], 'supervisor-thumbnail' => [ 'connection' => 'redis', 'queue' => [sprintf('%s-local-thumbnail', env('APP_TYPE'))], diff --git a/database/migrations/2024_02_21_205131_rename_subcreation_ease_tier_pulls_table.php b/database/migrations/2024_02_21_205131_rename_subcreation_ease_tier_pulls_table.php new file mode 100644 index 0000000000..a6dba13156 --- /dev/null +++ b/database/migrations/2024_02_21_205131_rename_subcreation_ease_tier_pulls_table.php @@ -0,0 +1,28 @@ +dropColumn('source_url'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tier_pulls', function (Blueprint $table) { + $table->string('source_url')->after('id'); + }); + } +} diff --git a/database/migrations/2024_02_21_210945_add_tiers_hash_column_to_affix_group_ease_tier_pulls_table.php b/database/migrations/2024_02_21_210945_add_tiers_hash_column_to_affix_group_ease_tier_pulls_table.php new file mode 100644 index 0000000000..10a82ab3ef --- /dev/null +++ b/database/migrations/2024_02_21_210945_add_tiers_hash_column_to_affix_group_ease_tier_pulls_table.php @@ -0,0 +1,33 @@ +string('tiers_hash')->after('current_affixes'); + $table->index(['tiers_hash']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tier_pulls', function (Blueprint $table) { + $table->dropColumn('tiers_hash'); + }); + } +} diff --git a/database/migrations/2024_02_21_214055_add_affix_group_ease_tier_pull_id_column_to_affix_group_ease_tiers_table.php b/database/migrations/2024_02_21_214055_add_affix_group_ease_tier_pull_id_column_to_affix_group_ease_tiers_table.php new file mode 100644 index 0000000000..77fd2d4ee4 --- /dev/null +++ b/database/migrations/2024_02_21_214055_add_affix_group_ease_tier_pull_id_column_to_affix_group_ease_tiers_table.php @@ -0,0 +1,37 @@ +dropIndex(['affix_group_id']); + $table->dropIndex(['subcreation_ease_tier_pull_id']); + $table->renameColumn('subcreation_ease_tier_pull_id', 'affix_group_ease_tier_pull_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tiers', function (Blueprint $table) { + $table->renameColumn('affix_group_ease_tier_pull_id', 'subcreation_ease_tier_pull_id'); + $table->index(['subcreation_ease_tier_pull_id']); + $table->index(['affix_group_id']); + }); + } +} diff --git a/database/migrations/2024_02_22_104337_add_affix_group_id_column_to_affix_group_ease_tier_pulls_table.php b/database/migrations/2024_02_22_104337_add_affix_group_id_column_to_affix_group_ease_tier_pulls_table.php new file mode 100644 index 0000000000..c654c6bdfa --- /dev/null +++ b/database/migrations/2024_02_22_104337_add_affix_group_id_column_to_affix_group_ease_tier_pulls_table.php @@ -0,0 +1,34 @@ +integer('affix_group_id')->after('id'); + + $table->index(['affix_group_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tier_pulls', function (Blueprint $table) { + $table->dropColumn('affix_group_id'); + }); + } +} diff --git a/database/migrations/2024_02_22_104800_fill_affix_group_id_column_in_affix_group_ease_tier_pulls_table.php b/database/migrations/2024_02_22_104800_fill_affix_group_id_column_in_affix_group_ease_tier_pulls_table.php new file mode 100644 index 0000000000..bb63fee3b7 --- /dev/null +++ b/database/migrations/2024_02_22_104800_fill_affix_group_id_column_in_affix_group_ease_tier_pulls_table.php @@ -0,0 +1,55 @@ +make(AffixGroupEaseTierServiceInterface::class); + + foreach ($rows as $row) { + $row = (array)$row; + + $affixGroup = $affixGroupEaseTierService->getAffixGroupByString($row['current_affixes']); + if ($affixGroup === null) { + // Delete it through Eloquent so that it cleans up the relationships as well + AffixGroupEaseTierPull::findOrFail($row['id'])->delete(); + } else { + DB::update(' + UPDATE affix_group_ease_tier_pulls SET affix_group_id = :affixGroupId WHERE id = :id + ', [ + 'affixGroupId' => $affixGroup->id, + 'id' => $row['id'], + ]); + } + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + /** @noinspection SqlWithoutWhere */ + DB::update(' + UPDATE affix_group_ease_tier_pulls SET affix_group_id = 0; + '); + } +} diff --git a/database/migrations/2024_02_22_105341_drop_current_affixes_column_in_affix_group_ease_tier_pulls_table.php b/database/migrations/2024_02_22_105341_drop_current_affixes_column_in_affix_group_ease_tier_pulls_table.php new file mode 100644 index 0000000000..0bf71fd853 --- /dev/null +++ b/database/migrations/2024_02_22_105341_drop_current_affixes_column_in_affix_group_ease_tier_pulls_table.php @@ -0,0 +1,32 @@ +dropColumn('current_affixes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tier_pulls', function (Blueprint $table) { + $table->string('current_affixes')->after('affix_group_id'); + }); + } +} diff --git a/database/migrations/2024_02_22_151036_remove_timestamp_columns_from_affix_group_ease_tiers_table.php b/database/migrations/2024_02_22_151036_remove_timestamp_columns_from_affix_group_ease_tiers_table.php new file mode 100644 index 0000000000..5ce2e3da53 --- /dev/null +++ b/database/migrations/2024_02_22_151036_remove_timestamp_columns_from_affix_group_ease_tiers_table.php @@ -0,0 +1,34 @@ +dropColumn('created_at'); + $table->dropColumn('updated_at'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('affix_group_ease_tiers', function (Blueprint $table) { + $table->timestamp('updated_at')->after('tier'); + $table->timestamp('created_at')->after('tier'); + }); + } +} diff --git a/database/seeders/releases/v8.1.json b/database/seeders/releases/v8.1.json new file mode 100644 index 0000000000..89400afea0 --- /dev/null +++ b/database/seeders/releases/v8.1.json @@ -0,0 +1,39 @@ +{ + "id": 223, + "release_changelog_id": 230, + "version": "v8.1", + "title": "Subcreation integration replaced with Archon.gg", + "silent": 0, + "spotlight": 0, + "created_at": "2024-02-22T21:51:37+00:00", + "updated_at": "2024-02-22T21:51:37+00:00", + "changelog": { + "id": 230, + "release_id": 223, + "description": null, + "changes": [ + { + "release_changelog_id": 230, + "release_changelog_category_id": 1, + "ticket_id": 2210, + "change": "Subcreation implementation has been replaced with Archon.gg implementation instead. No changes to functionality are to be expected - only that all Subcreation references are replaced with Archon.gg instead.", + "category": { + "id": 1, + "key": "general_changes", + "name": "releasechangelogcategories.general_changes" + } + }, + { + "release_changelog_id": 230, + "release_changelog_category_id": 5, + "ticket_id": 2209, + "change": "Background job performing caching operations should no longer time out after 60 seconds.", + "category": { + "id": 5, + "key": "bugfixes", + "name": "releasechangelogcategories.bugfixes" + } + } + ] + } +} diff --git a/resources/lang/de-DE/views/common.php b/resources/lang/de-DE/views/common.php index 3cb790fa50..594e506e6e 100644 --- a/resources/lang/de-DE/views/common.php +++ b/resources/lang/de-DE/views/common.php @@ -62,7 +62,7 @@ 'filter' => '@todo de: .dungeonroute.table.filter', ], 'tier' => [ - 'data_by_subcreation' => '@todo de: .dungeonroute.tier.data_by_subcreation', + 'data_by_archon_gg' => '@todo de: .dungeonroute.tier.data_by_archon_gg', ], ], 'forms' => [ diff --git a/resources/lang/en-US/views/common.php b/resources/lang/en-US/views/common.php index 084f0fac8b..1a275f68d7 100644 --- a/resources/lang/en-US/views/common.php +++ b/resources/lang/en-US/views/common.php @@ -62,7 +62,7 @@ 'filter' => 'Filter', ], 'tier' => [ - 'data_by_subcreation' => '%s - data by https://mplus.subcreation.net', + 'data_by_archon_gg' => '%s - data by https://www.archon.gg/wow', ], ], 'forms' => [ diff --git a/resources/lang/en-US/views/home.php b/resources/lang/en-US/views/home.php index 533b79d7c9..653ce2c02d 100644 --- a/resources/lang/en-US/views/home.php +++ b/resources/lang/en-US/views/home.php @@ -10,7 +10,7 @@ 'create_route' => 'Create route', 'discover_new_routes' => 'Discover new routes', 'discover_new_routes_description' => 'Easily browse for routes per dungeon in various categories to find a route that suits your group perfectly. - Integration with :subcreation makes it easy to see which dungeons are the easiest to time for any affix. + Integration with :archon_gg makes it easy to see which dungeons are the easiest to time for any affix. Still can\'t find a route that suits your needs? The :routesearch page allows you to dial in on your exact needs to find a perfect match.', 'create_your_own_routes' => 'Create your own routes', 'create_your_own_routes_description' => 'Import your routes from Mythic Dungeon Tools or :createANewRoute from scratch. Keystone.guru offers various tools to make your route a memorable one, diff --git a/resources/lang/ru-RU/views/common.php b/resources/lang/ru-RU/views/common.php index edf015f1c5..e93254f538 100644 --- a/resources/lang/ru-RU/views/common.php +++ b/resources/lang/ru-RU/views/common.php @@ -62,7 +62,7 @@ 'filter' => 'Фильтр', ], 'tier' => [ - 'data_by_subcreation' => '%s - данные https://mplus.subcreation.net', + 'data_by_archon_gg' => '%s - данные https://mplus.subcreation.net', ], ], 'forms' => [ diff --git a/resources/lang/ru-RU/views/home.php b/resources/lang/ru-RU/views/home.php index 0262e14883..0cda67418d 100644 --- a/resources/lang/ru-RU/views/home.php +++ b/resources/lang/ru-RU/views/home.php @@ -9,7 +9,7 @@ 'create_route' => 'Создать маршрут', 'discover_new_routes' => 'Поиск маршрута', 'discover_new_routes_description' => 'Ищите маршруты для каждого подземелья в различных категориях, чтобы найти маршрут, идеально подходящий для вашей группы. - Интеграция с :subcreation позволяет определить, какие подземелья легче всего пройти на различных аффиксах. + Интеграция с :archon_gg позволяет определить, какие подземелья легче всего пройти на различных аффиксах. Все еще не можете найти маршрут, который вам подходит? Страница :routesearch позволяет вам точно узнать, что вам нужно, чтобы найти свой идеальный маршрут.', 'create_your_own_routes' => 'Создавайте свои собственные маршруты', 'create_your_own_routes_description' => 'Импортируйте свои маршруты из Mythic Dungeon Tools или :createANewRoute с нуля. Keystone.guru предлагает различные инструменты, которые помогут сделать ваш маршрут максимально информативным. diff --git a/resources/views/common/dungeon/griddiscover.blade.php b/resources/views/common/dungeon/griddiscover.blade.php index da65649195..3075c77a19 100644 --- a/resources/views/common/dungeon/griddiscover.blade.php +++ b/resources/views/common/dungeon/griddiscover.blade.php @@ -1,5 +1,5 @@ -@inject('seasonService', 'App\Service\Season\SeasonService') -@inject('subcreationTierListService', 'App\Service\Subcreation\AffixGroupEaseTierServiceInterface') +@inject('seasonService', \App\Service\Season\SeasonServiceInterface::class) +@inject('subcreationTierListService', \App\Service\AffixGroup\AffixGroupEaseTierServiceInterface::class) @if($tier !== null) - +

{!! __('views/home.discover_new_routes_description', - ['subcreation' => 'mplus.subcreation.net', + ['archon_gg' => 'archon.gg', 'routesearch' => sprintf('%s', route('dungeonroutes.search'), __('route search'))]) !!}

@@ -286,7 +286,6 @@