Skip to content

Commit

Permalink
Merge pull request #2658 from RaiderIO/development
Browse files Browse the repository at this point in the history
Release v11.9 - Temple of Ahn'Qiraj Classic/SoD
  • Loading branch information
Wotuu authored Jan 20, 2025
2 parents 810db39 + 57558bb commit fb1bd9c
Show file tree
Hide file tree
Showing 127 changed files with 19,098 additions and 658 deletions.
3 changes: 2 additions & 1 deletion app/Console/Commands/Mapping/AssignMDTIDs.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public function handle(): int
$mappingVersions = MappingVersion::with(['enemies', 'dungeon'])->get();

$dungeonWhitelist = [
Dungeon::RAID_FIRELANDS,
Dungeon::RAID_TEMPLE_OF_AHN_QIRAJ,
Dungeon::RAID_TEMPLE_OF_AHN_QIRAJ_SOD,
];

foreach ($mappingVersions as $mappingVersion) {
Expand Down
6 changes: 6 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Exceptions\ThrottleRequestsException;
use Illuminate\Http\Request;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Validation\ValidationException;
Expand All @@ -16,6 +17,7 @@
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException;
use Teapot\StatusCode;
use Teapot\StatusCode\RFC\RFC6585;
use Throwable;

class Handler extends ExceptionHandler
Expand Down Expand Up @@ -82,8 +84,12 @@ public function render($request, Throwable $e)
], StatusCode::NOT_FOUND);
} else if ($e instanceof NotFoundHttpException) {
return response()->json(['message' => __('exceptions.handler.api_route_not_found')], StatusCode::NOT_FOUND);
} else if ($e instanceof ThrottleRequestsException) {
return response()->json(['message' => __('exceptions.handler.too_many_requests')], RFC6585::TOO_MANY_REQUESTS);
} else if (!config('app.debug')) {
return response()->json(['message' => __('exceptions.handler.internal_server_error')], StatusCode::INTERNAL_SERVER_ERROR);
} else {
return response()->json(['message' => $e->getMessage()], $e->getCode());
}
}

Expand Down
19 changes: 16 additions & 3 deletions app/Http/Controllers/Dungeon/DungeonExploreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ public function get(Request $request, CombatLogEventServiceInterface $combatLogE
]);
}

public function viewDungeon(Request $request, CombatLogEventServiceInterface $combatLogEventService, Dungeon $dungeon): RedirectResponse
public function viewDungeon(Request $request, Dungeon $dungeon): RedirectResponse
{
$dungeon->load(['currentMappingVersion']);

if (!$dungeon->active || $dungeon->currentMappingVersion === null) {
return redirect()->route('dungeon.explore.list');
}

$dungeon->load(['currentMappingVersion']);

/** @var Floor $defaultFloor */
$defaultFloor = Floor::where('dungeon_id', $dungeon->id)
->defaultOrFacade($dungeon->currentMappingVersion)
Expand All @@ -50,10 +56,15 @@ public function viewDungeonFloor(
Dungeon $dungeon,
string $floorIndex = '1'): View|RedirectResponse
{
$dungeon->load(['currentMappingVersion']);

if (!$dungeon->active || $dungeon->currentMappingVersion === null) {
return redirect()->route('dungeon.explore.list');
}

if (!is_numeric($floorIndex)) {
$floorIndex = '1';
}
$dungeon->load(['currentMappingVersion']);

/** @var Floor $floor */
$floor = Floor::where('dungeon_id', $dungeon->id)
Expand Down Expand Up @@ -87,7 +98,9 @@ public function viewDungeonFloor(

$mostRecentSeason = $dungeon->getActiveSeason($seasonService);

$heatmapActive = Feature::active(Heatmap::class) && $dungeon->gameVersion->has_seasons;
$heatmapActive = Feature::active(Heatmap::class) &&
$dungeon->gameVersion->has_seasons &&
$dungeon->challenge_mode_id !== null;

$dungeon->trackPageView();

Expand Down
7 changes: 3 additions & 4 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,19 @@ class Kernel extends HttpKernel
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
TrustProxies::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
TrustProxies::class,
],

'api' => [
ThrottleRequests::class . ':60,1',
'authentication' => ApiAuthentication::class,
TrustProxies::class,
'bindings',
'debug_info_context_logger' => DebugInfoContextLogger::class,
'read_only_mode' => ReadOnlyMode::class,
'authentication' => ApiAuthentication::class,
TrustProxies::class,
],
];

Expand Down
36 changes: 18 additions & 18 deletions app/Http/Requests/Api/V1/CombatLog/Route/CombatLogRouteRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ public function rules(): array
'metadata.wowInstanceId' => ['nullable', 'int'],
'settings.temporary' => ['nullable', 'bool'],
'settings.debugIcons' => ['nullable', 'bool'],
'roster.numMembers' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.averageItemLevel' => ['nullable', 'numeric'], // @TODO make required after raider.io supports it
'roster.characterIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.characterIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.specIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.specIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.classIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.classIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.numMembers' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.averageItemLevel' => ['nullable', 'numeric'], // @TODO make required after raider.io supports it
'roster.characterIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.characterIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.specIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.specIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'roster.classIds' => ['nullable', 'array'], // @TODO make required after raider.io supports it
'roster.classIds.*' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'challengeMode.start' => ['required', $dateFormat],
'challengeMode.end' => ['required', $dateFormat],
'challengeMode.durationMs' => ['required', 'int'],
Expand All @@ -65,7 +65,7 @@ public function rules(): array
'challengeMode.level' => ['required', 'int'],
'challengeMode.numDeaths' => ['nullable', 'int'], // @TODO make required after raider.io supports it
'challengeMode.affixes' => ['required', 'array'],
'challengeMode.affixes.*' => ['required', Rule::exists(Affix::class, 'affix_id')],
'challengeMode.affixes.*' => ['required', 'integer'], // #1818 Rule::exists(Affix::class, 'affix_id')],
'npcs' => ['required', 'array', new CombatLogRouteNpcChronologicalRule()],
'npcs.*.npcId' => ['required', 'integer'], // #1818 Rule::exists('npcs', 'id')
'npcs.*.spawnUid' => ['required', 'string', 'max:10'],
Expand All @@ -81,15 +81,15 @@ public function rules(): array
'spells.*.coord.x' => 'numeric',
'spells.*.coord.y' => 'numeric',
'spells.*.coord.uiMapId' => Rule::exists(Floor::class, 'ui_map_id'),
'playerDeaths' => 'nullable|array', // @TODO make required after raider.io supports it
'playerDeaths.*.characterId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.classId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.specId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.itemLevel' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.diedAt' => $dateFormat, // @TODO make required after raider.io supports it
'playerDeaths.*.coord.x' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.coord.y' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.coord.uiMapId' => Rule::exists(Floor::class, 'ui_map_id'), // @TODO make required after raider.io supports it
'playerDeaths' => 'nullable|array', // @TODO make required after raider.io supports it
'playerDeaths.*.characterId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.classId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.specId' => 'integer', // @TODO make required after raider.io supports it
'playerDeaths.*.itemLevel' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.diedAt' => $dateFormat, // @TODO make required after raider.io supports it
'playerDeaths.*.coord.x' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.coord.y' => 'numeric', // @TODO make required after raider.io supports it
'playerDeaths.*.coord.uiMapId' => Rule::exists(Floor::class, 'ui_map_id'), // @TODO make required after raider.io supports it
];
}
}
1 change: 1 addition & 0 deletions app/Http/Resources/Dungeon/DungeonResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* @OA\Property(type="boolean",property="speedrunEnabled",example="0",description="Whether speedrun is enabled for this dungeon")
* @OA\Property(type="boolean",property="speedrunDifficulty10ManEnabled",example="0",description="Whether 10-man difficulty is enabled for speedrunning")
* @OA\Property(type="boolean",property="speedrunDifficulty25ManEnabled",example="0",description="Whether 25-man difficulty is enabled for speedrunning")
* @OA\Property(type="array",property="floors",@OA\Items(ref="#/components/schemas/Floor"))
*
* @mixin Dungeon
*/
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Resources/Floor/FloorResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* @OA\Property(type="integer", property="uiMapId", example="259")
* @OA\Property(type="string", property="name", example="The Stonevault", description="The English name of the floor")
* @OA\Property(type="boolean", property="default", example="true", description="True if this is the floor any route for the dungeon opens up to")
* @OA\Property(type="number",format="float", property="ingameMinX", example="true", description="In-game coordinates of the minimum X value of the floor")
* @OA\Property(type="number",format="float", property="ingameMinY", example="true", description="In-game coordinates of the minimum Y value of the floor")
* @OA\Property(type="number",format="float", property="ingameMaxX", example="true", description="In-game coordinates of the maximum X value of the floor")
* @OA\Property(type="number",format="float", property="ingameMaxY", example="true", description="In-game coordinates of the maximum Y value of the floor")
* @OA\Property(type="number", format="float", property="ingameMinX", example="437.19", description="In-game coordinates of the minimum X value of the floor")
* @OA\Property(type="number", format="float", property="ingameMinY", example="-397.08", description="In-game coordinates of the minimum Y value of the floor")
* @OA\Property(type="number", format="float", property="ingameMaxX", example="-503.44", description="In-game coordinates of the maximum X value of the floor")
* @OA\Property(type="number", format="float", property="ingameMaxY", example="230", description="In-game coordinates of the maximum Y value of the floor")
*
* @mixin Floor
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Logic\CombatLog\CombatEvents\Advanced\Versions\V20\AdvancedDataV20;
use App\Logic\CombatLog\CombatEvents\Advanced\Versions\V22\AdvancedDataV22;
use App\Logic\CombatLog\CombatEvents\Advanced\Versions\V9\AdvancedDataV9;
use App\Logic\CombatLog\CombatEvents\Advanced\Versions\V9SoD\AdvancedDataV9SoD;
use App\Logic\CombatLog\CombatLogVersion;

class AdvancedDataBuilder
Expand All @@ -13,6 +14,7 @@ public static function create(int $combatLogVersion): AdvancedDataInterface
{
return match ($combatLogVersion) {
CombatLogVersion::CLASSIC => new AdvancedDataV9(),
CombatLogVersion::CLASSIC_SOD_1_15_5 => new AdvancedDataV9SoD(),
CombatLogVersion::RETAIL_10_1_0, CombatLogVersion::RETAIL_11_0_2 => new AdvancedDataV20(),
default => new AdvancedDataV22(),
};
Expand Down
Loading

0 comments on commit fb1bd9c

Please sign in to comment.