Skip to content

Commit

Permalink
Merge pull request #2699 from RaiderIO/development
Browse files Browse the repository at this point in the history
Release v11.9.7 - Even more heatmap changes
  • Loading branch information
Wotuu authored Jan 31, 2025
2 parents 8994a86 + cc66beb commit 59476eb
Show file tree
Hide file tree
Showing 21 changed files with 187 additions and 39 deletions.
2 changes: 2 additions & 0 deletions app/Http/Controllers/Dungeon/DungeonExploreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ public function embed(
$mapBackgroundColor = $request->get('mapBackgroundColor');
$showEnemyInfo = $request->get('showEnemyInfo', false);
$showTitle = $request->get('showTitle', true);
$defaultZoom = $request->get('defaultZoom', 1);

$parameters = [
'type' => $request->get('type'),
Expand Down Expand Up @@ -217,6 +218,7 @@ public function embed(
$seasonService->getWeeklyAffixGroupsSinceStart($mostRecentSeason, GameServerRegion::getUserOrDefaultRegion()) :
collect(),
'parameters' => $parameters,
'defaultZoom' => $defaultZoom,
'embedOptions' => [
'style' => $style,
'headerBackgroundColor' => $headerBackgroundColor,
Expand Down
1 change: 1 addition & 0 deletions app/Http/Requests/Heatmap/ExploreEmbedUrlFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function rules(): array
'mapBackgroundColor' => ['nullable', 'regex:/^#([a-f0-9]{6}|[a-f0-9]{3})$/i'],
'showEnemyInfo' => 'nullable|bool',
'showTitle' => 'nullable|bool',
'defaultZoom' => 'nullable|numeric',
]);
}
}
2 changes: 2 additions & 0 deletions app/Http/Requests/Heatmap/ExploreUrlFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Http\Requests\DungeonRoute\DungeonRouteBaseUrlFormRequest;
use App\Models\CombatLog\CombatLogEventDataType;
use App\Models\CombatLog\CombatLogEventEventType;
use App\Models\GameServerRegion;
use Illuminate\Validation\Rule;

/**
Expand All @@ -28,6 +29,7 @@ public function rules(): array
return array_merge(parent::rules(), [
'type' => ['nullable', Rule::in(CombatLogEventEventType::cases())],
'dataType' => ['nullable', Rule::in(CombatLogEventDataType::cases())],
'region' => ['nullable', Rule::exists(GameServerRegion::class, 'short')],
'minMythicLevel' => ['nullable', 'integer'],
'maxMythicLevel' => ['nullable', 'integer'],
'minItemLevel' => ['nullable', 'integer'],
Expand Down
2 changes: 2 additions & 0 deletions app/Models/GameServerRegion.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class GameServerRegion extends CacheModel
public const CHINA = 'cn';
public const TAIWAN = 'tw';
public const KOREA = 'kr';
public const WORLD = 'world';

public const DEFAULT_REGION = GameServerRegion::AMERICAS;

Expand All @@ -55,6 +56,7 @@ class GameServerRegion extends CacheModel
self::CHINA => 3,
self::TAIWAN => 4,
self::KOREA => 5,
self::WORLD => 6,
];

protected $fillable = ['short', 'name', 'epoch_start', 'timezone', 'reset_day_offset', 'reset_hours_offset'];
Expand Down
1 change: 1 addition & 0 deletions app/Providers/KeystoneGuruServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static function (View $view) use ($globalViewVariables) {
$view->with('featuredAffixesByActiveExpansion', $regionViewVariables['featuredAffixesByActiveExpansion']);

$view->with('characterClassSpecializations', $globalViewVariables['characterClassSpecializations']);
$view->with('allRegions', $globalViewVariables['allRegions']);
});
view()->composer('common.maps.controls.pulls', static function (View $view) {
$view->with('showAllEnabled', $_COOKIE['dungeon_speedrun_required_npcs_show_all'] ?? '0');
Expand Down
38 changes: 32 additions & 6 deletions app/Service/CombatLogEvent/Dtos/CombatLogEventFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
*/
class CombatLogEventFilter implements Arrayable
{
private ?int $keyLevelMin = null;
private ?int $keyLevelMax = null;
private ?int $itemLevelMin = null;
private ?int $itemLevelMax = null;
private ?int $playerDeathsMin = null;
private ?int $playerDeathsMax = null;
private ?string $region = null;
private ?int $keyLevelMin = null;
private ?int $keyLevelMax = null;
private ?int $itemLevelMin = null;
private ?int $itemLevelMax = null;
private ?int $playerDeathsMin = null;
private ?int $playerDeathsMax = null;

/** @var Collection<Affix> */
private Collection $affixes;
Expand Down Expand Up @@ -67,6 +68,18 @@ public function getDataType(): CombatLogEventDataType
return $this->dataType;
}

public function getRegion(): ?string
{
return $this->region;
}

public function setRegion(?string $region): CombatLogEventFilter
{
$this->region = $region;

return $this;
}

public function getKeyLevelMin(): ?int
{
return $this->keyLevelMin;
Expand Down Expand Up @@ -227,6 +240,7 @@ public function toArray(): array
'challenge_mode_id' => $this->dungeon->challenge_mode_id,
'event_type' => $this->eventType->value,
'data_type' => $this->dataType,
'region' => $this->region,
'key_level_min' => $this->keyLevelMin,
'key_level_max' => $this->keyLevelMax,
'item_level_min' => $this->itemLevelMin,
Expand All @@ -252,6 +266,17 @@ public function toOpensearchQuery(array $must = []): array

$must[] = MatchOne::make('challenge_mode_id', $dungeon->challenge_mode_id);
$must[] = MatchOne::make('event_type', $this->eventType->value);
// These are raider.io region IDs
if ($this->region !== GameServerRegion::WORLD) {
$must[] = MatchOne::make('region_id', match ($this->region) {
GameServerRegion::EUROPE => 3,
GameServerRegion::AMERICAS => 2,
GameServerRegion::CHINA => 6,
GameServerRegion::KOREA => 4,
GameServerRegion::TAIWAN => 5,
default => 2, // US
});
}

// /** @var Floor $firstFloor */
// $firstFloor = $dungeon->floors->first();
Expand Down Expand Up @@ -367,6 +392,7 @@ public static function fromHeatmapDataFilter(SeasonServiceInterface $seasonServi
$heatmapDataFilter->getDataType()
);

$combatLogEventFilter->setRegion($heatmapDataFilter->getRegion());
$combatLogEventFilter->setKeyLevelMin($heatmapDataFilter->getKeyLevelMin());
$combatLogEventFilter->setKeyLevelMax($heatmapDataFilter->getKeyLevelMax());
$combatLogEventFilter->setItemLevelMin($heatmapDataFilter->getItemLevelMin());
Expand Down
29 changes: 23 additions & 6 deletions app/Service/RaiderIO/Dtos/HeatmapDataFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
*/
class HeatmapDataFilter implements Arrayable
{
private ?int $keyLevelMin = null;
private ?int $keyLevelMax = null;
private ?int $itemLevelMin = null;
private ?int $itemLevelMax = null;
private ?int $playerDeathsMin = null;
private ?int $playerDeathsMax = null;
private ?string $region = null;
private ?int $keyLevelMin = null;
private ?int $keyLevelMax = null;
private ?int $itemLevelMin = null;
private ?int $itemLevelMax = null;
private ?int $playerDeathsMin = null;
private ?int $playerDeathsMax = null;
/** @var Collection<Affix> */
private Collection $includeAffixIds;
/** @var Collection<CharacterClassSpecialization> */
Expand Down Expand Up @@ -57,6 +58,18 @@ public function getDataType(): CombatLogEventDataType
return $this->dataType;
}

public function getRegion(): ?string
{
return $this->region;
}

public function setRegion(?string $region): HeatmapDataFilter
{
$this->region = $region;

return $this;
}

public function getKeyLevelMin(): ?int
{
return $this->keyLevelMin;
Expand Down Expand Up @@ -225,6 +238,9 @@ public function toArray(Season $mostRecentSeason = null): array
'dataType' => $this->getDataType()->value,
];

if ($this->getRegion() !== GameServerRegion::WORLD) {
$result['regionId'] = $this->getRegion();
}
$result['minMythicLevel'] = $this->getKeyLevelMin();
$result['maxMythicLevel'] = $this->getKeyLevelMax();
$result['minItemLevel'] = $this->getItemLevelMin();
Expand Down Expand Up @@ -263,6 +279,7 @@ public static function fromArray(array $requestArray): HeatmapDataFilter
dataType: CombatLogEventDataType::from($requestArray['dataType'] ?? CombatLogEventDataType::PlayerPosition->value)
);

$heatmapDataFilter->setRegion($requestArray['region'] ?? null);
$heatmapDataFilter->setKeyLevelMin(isset($requestArray['minMythicLevel']) ? (int)$requestArray['minMythicLevel'] : null);
$heatmapDataFilter->setKeyLevelMax(isset($requestArray['maxMythicLevel']) ? (int)$requestArray['maxMythicLevel'] : null);
$heatmapDataFilter->setItemLevelMin(isset($requestArray['minItemLevel']) ? (int)$requestArray['minItemLevel'] : null);
Expand Down
9 changes: 9 additions & 0 deletions database/seeders/GameServerRegionsSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ public function run(): void
'reset_day_offset' => 2,
'reset_hours_offset' => 23,
],
// https://www.reddit.com/r/wow/comments/9sbujc/korean_wow_user_back_brought_some_korean_wow/e8ntkck/?context=3
[
'short' => GameServerRegion::WORLD,
'name' => 'gameserverregions.world',
'epoch_start' => '2005-12-28 23:00:00',
'timezone' => 'Europe/London',
'reset_day_offset' => 2,
'reset_hours_offset' => 7,
],
];

GameServerRegion::from(DatabaseSeeder::getTempTableName(GameServerRegion::class))->insert($gameServerRegionAttributes);
Expand Down
31 changes: 31 additions & 0 deletions database/seeders/releases/v11.9.7.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"id": 273,
"release_changelog_id": 280,
"version": "v11.9.7",
"title": "Even more heatmap changes",
"backup_db": 1,
"silent": 1,
"spotlight": 0,
"released": 0,
"created_at": "2025-01-31T15:55:25+00:00",
"updated_at": "2025-01-31T15:55:25+00:00",
"changelog": {
"id": 280,
"release_id": 273,
"description": null,
"changes": [
{
"release_changelog_id": 280,
"release_changelog_category_id": 13,
"ticket_id": 2697,
"change": "You can now pass a defaultZoom to the explore embeds."
},
{
"release_changelog_id": 280,
"release_changelog_category_id": 13,
"ticket_id": 2660,
"change": "Specialization filters now once again support multiple specs at once"
}
]
}
}
13 changes: 6 additions & 7 deletions lang/en_US/gameserverregions.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

return [

'us' => 'Americas',
'eu' => 'Europe',
'cn' => 'China',
'tw' => 'Taiwan',
'kr' => 'Korea',

'us' => 'Americas',
'eu' => 'Europe',
'cn' => 'China',
'tw' => 'Taiwan',
'kr' => 'Korea',
'world' => 'World',
];
1 change: 1 addition & 0 deletions lang/en_US/js.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@
'filter_input_user_header' => 'User: :value',
'filter_input_event_type_header' => 'Event type: :value',
'filter_input_data_type_header' => 'Data type: :value',
'filter_input_region_header' => 'Region: :value',
'filter_input_date_header' => 'Date: :value',
'filter_input_date_from_header' => 'From date: :value',
'filter_input_date_to_header' => 'To date: :value',
Expand Down
5 changes: 5 additions & 0 deletions resources/assets/css/map.css
Original file line number Diff line number Diff line change
Expand Up @@ -1329,3 +1329,8 @@ html, body, #map, #app, .wrapper {
width: 16px;
height: 16px;
}

.filter_region_icon {
width: 24px;
height: 16px;
}
Binary file added resources/assets/images/flags/world.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class ItemLevelHandler {
constructor(min, max) {
this.min = min;
this.max = max;
constructor(from, to) {
this.min = 400;
this.max = 999;

this.from = from;
this.to = to;

this.rangeSlider = null;
}
Expand All @@ -13,8 +16,8 @@ class ItemLevelHandler {
type: 'double',
min: this.min,
max: this.max,
from: this.min,
to: this.max,
from: this.from,
to: this.to,
}, options)).data('ionRangeSlider');
}

Expand All @@ -25,8 +28,8 @@ class ItemLevelHandler {
this.rangeSlider.update({
min: this.min,
max: this.max,
from: this.min,
to: this.max,
from: this.from,
to: this.to,
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
* @property {String} filterEventTypeSelector
* @property {String} filterDataTypeContainerSelector
* @property {String} filterDataTypeSelector
* @property {String} filterRegionContainerSelector
* @property {String} filterRegionSelector
* @property {String} filterKeyLevelSelector
* @property {String} filterItemLevelSelector
* @property {String} filterPlayerDeathsSelector
Expand All @@ -51,8 +53,6 @@
* @property {String} edit
*
* @property {String[]} filterCollapseNames
*
*
*/

/**
Expand Down Expand Up @@ -85,6 +85,7 @@ class CommonMapsHeatmapsearchsidebar extends SearchInlineBase {
self._search();
}),
'dataType': new SearchFilterRadioDataType(this.options.filterDataTypeContainerSelector, this.options.filterDataTypeSelector, this._search.bind(this)),
'region': new SearchFilterRadioRegion(this.options.filterRegionContainerSelector, this.options.filterRegionSelector, this._search.bind(this)),
'keyLevel': new SearchFilterKeyLevel(this.options.filterKeyLevelSelector, this._search.bind(this), this.options.keyLevelMin, this.options.keyLevelMax),
'itemLevel': new SearchFilterItemLevel(this.options.filterItemLevelSelector, this._search.bind(this), this.options.itemLevelMin, this.options.itemLevelMax),
'playerDeaths': new SearchFilterPlayerDeaths(this.options.filterPlayerDeathsSelector, this._search.bind(this), this.options.playerDeathsMin, this.options.playerDeathsMax),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class SearchFilterRadioRegion extends SearchFilterRadio {
getFilterHeaderText() {
return lang.get('messages.filter_input_region_header')
.replace(':value', lang.get(`gameserverregions.${this.getValue()}`));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
class SearchFilterSelect extends SearchFilter {
/**
*
* @returns {Array}
*/
getValue() {
return $(`${this.selector}`).val();
}

/**
*
* @param value {string}
*/
setValue(value) {
let split = value.split(',');

$(`${this.selector}`).val(split);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class SearchFilterSpecializations extends SearchFilterInput {
class SearchFilterSpecializations extends SearchFilterSelect {
constructor(selector, onChange) {
super(selector, onChange);
}
Expand All @@ -16,10 +16,6 @@ class SearchFilterSpecializations extends SearchFilterInput {
});
}

getDefaultValue() {
return [];
}

getFilterHeaderText() {
let value = this.getValue();

Expand Down
Loading

0 comments on commit 59476eb

Please sign in to comment.