Skip to content

Commit 30dd7b5

Browse files
authored
Merge pull request #1743 from ThingEngineering/main
Deploy
2 parents e6895e6 + 972a1e2 commit 30dd7b5

21 files changed

Lines changed: 233 additions & 278 deletions

File tree

apps/backend/Jobs/Data/DataAuctionsJob.cs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,8 @@ public override async Task Run(string[] data)
166166
Dictionary<int, List<ApiDataAuctionsAuction>> commodities;
167167
await using (var writer = await connection.BeginBinaryImportAsync(string.Format(CopyAuctions, tableName)))
168168
{
169-
(auctionsByAppearanceId, auctionsByAppearanceSource, commodities) = await WriteAuctionData(writer, _connectedRealmId, result.Data.Auctions);
169+
(auctionsByAppearanceId, auctionsByAppearanceSource, commodities) =
170+
await WriteAuctionData(writer, _connectedRealmId, result.Data.Auctions);
170171
}
171172

172173
timer.AddPoint("Copy");
@@ -182,6 +183,7 @@ public override async Task Run(string[] data)
182183
await Task.Delay(100);
183184
}
184185
}
186+
185187
timer.AddPoint("Lock");
186188

187189
// Get current partitions
@@ -300,9 +302,9 @@ await db.HashSetAsync(
300302

301303
private async Task<
302304
(
303-
Dictionary<int, List<ApiDataAuctionsAuction>> appearanceIds,
304-
Dictionary<string, List<ApiDataAuctionsAuction>> appearanceSources,
305-
Dictionary<int, List<ApiDataAuctionsAuction>> commodities
305+
Dictionary<int, List<ApiDataAuctionsAuction>> appearanceIds,
306+
Dictionary<string, List<ApiDataAuctionsAuction>> appearanceSources,
307+
Dictionary<int, List<ApiDataAuctionsAuction>> commodities
306308
)
307309
> WriteAuctionData(NpgsqlBinaryImporter writer, int connectedRealmId, List<ApiDataAuctionsAuction> dataAuctions)
308310
{
@@ -342,16 +344,19 @@ Dictionary<int, List<ApiDataAuctionsAuction>> commodities
342344

343345
if (!Hardcoded.IgnoredAuctionItemIds.Contains(auction.Item.Id))
344346
{
345-
if (!_itemModifiedAppearances.ItemIdAndModifierToAppearanceId.TryGetValue((auction.Item.Id, modifier),
346-
out int actualAppearanceId))
347+
int actualAppearanceId = 0;
348+
349+
if (_itemModifiedAppearances.ByItemIdAndModifier.TryGetValue((auction.Item.Id, modifier),
350+
out var record))
347351
{
348-
if (_itemModifiedAppearances.ModifiersByItemId.TryGetValue(auction.Item.Id,
352+
actualAppearanceId = record.AppearanceId;
353+
}
354+
else if (_itemModifiedAppearances.ModifiersByItemId.TryGetValue(auction.Item.Id,
349355
out short[] possibleModifiers))
350-
{
351-
modifier = possibleModifiers[0];
352-
actualAppearanceId =
353-
_itemModifiedAppearances.ItemIdAndModifierToAppearanceId[(auction.Item.Id, modifier)];
354-
}
356+
{
357+
modifier = possibleModifiers[0];
358+
record = _itemModifiedAppearances.ByItemIdAndModifier[(auction.Item.Id, modifier)];
359+
actualAppearanceId = record?.AppearanceId ?? 0;
355360
}
356361

357362
if (actualAppearanceId > 0)

apps/backend/Jobs/User/UserUploadJob.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -488,14 +488,14 @@ private async Task Process(string luaData) {
488488
var itemModifiedAppearanceIds = SquishUtilities.Unsquish(parsed.TransmogSourcesSquishV2);
489489
foreach (int itemModifiedAppearanceId in itemModifiedAppearanceIds)
490490
{
491-
if (imaCache.IdToItemIdAndModifier.TryGetValue(itemModifiedAppearanceId, out var itemIdAndModifier))
491+
if (imaCache.ById.TryGetValue(itemModifiedAppearanceId, out var itemModifiedAppearance))
492492
{
493-
if (imaCache.ItemIdAndModifierToAppearanceId.TryGetValue(itemIdAndModifier, out int appearanceId))
493+
if (itemModifiedAppearance.AppearanceId > 0)
494494
{
495-
ids.Add(appearanceId);
495+
ids.Add(itemModifiedAppearance.AppearanceId);
496496
}
497497

498-
sources.Add($"{itemIdAndModifier.Item1}_{itemIdAndModifier.Item2}");
498+
sources.Add($"{itemModifiedAppearance.ItemId}_{itemModifiedAppearance.Modifier}");
499499
}
500500
else
501501
{

apps/backend/Models/Cache/ItemModifiedAppearanceCache.cs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
using Wowthing.Lib.Models.Wow;
1+
using Wowthing.Lib.Enums;
2+
using Wowthing.Lib.Models.Wow;
23

34
namespace Wowthing.Backend.Models.Cache;
45

56
public class ItemModifiedAppearanceCache
67
{
7-
public readonly Dictionary<int, (int, short)> IdToItemIdAndModifier = new();
8-
public readonly Dictionary<(int, short), int> ItemIdAndModifierToAppearanceId = new();
8+
public readonly Dictionary<int, ItemModifiedAppearance> ById = new();
9+
public readonly Dictionary<(int, short), ItemModifiedAppearance> ByItemIdAndModifier = new();
910
public readonly Dictionary<int, short[]> ModifiersByItemId;
1011

1112
public ItemModifiedAppearanceCache(WowItemModifiedAppearance[] itemModifiedAppearances)
@@ -14,8 +15,15 @@ public ItemModifiedAppearanceCache(WowItemModifiedAppearance[] itemModifiedAppea
1415

1516
foreach (var ima in itemModifiedAppearances)
1617
{
17-
IdToItemIdAndModifier[ima.Id] = (ima.ItemId, ima.Modifier);
18-
ItemIdAndModifierToAppearanceId[(ima.ItemId, ima.Modifier)] = ima.AppearanceId;
18+
var record = new ItemModifiedAppearance(
19+
ima.AppearanceId,
20+
ima.ItemId,
21+
ima.Modifier,
22+
ima.SourceType != TransmogSourceType.CantCollect &&
23+
ima.SourceType != TransmogSourceType.NotValidForTransmog
24+
);
25+
ById[ima.Id] = record;
26+
ByItemIdAndModifier[(ima.ItemId, ima.Modifier)] = record;
1927

2028
if (!tempModifiers.TryGetValue(ima.ItemId, out var modifiers))
2129
{
@@ -31,4 +39,6 @@ public ItemModifiedAppearanceCache(WowItemModifiedAppearance[] itemModifiedAppea
3139
kvp => kvp.Value.Order().ToArray()
3240
);
3341
}
42+
43+
public record ItemModifiedAppearance(int AppearanceId, int ItemId, short Modifier, bool Collectable);
3444
}

apps/backend/Services/MemoryCacheService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public async Task<ItemModifiedAppearanceCache> GetItemModifiedAppearances()
122122

123123
var itemModifiedAppearances = await contextWrapper.Context.WowItemModifiedAppearance
124124
.AsNoTracking()
125-
.Where(wima => wima.SourceType != TransmogSourceType.CantCollect &&
126-
wima.SourceType != TransmogSourceType.NotValidForTransmog)
125+
// .Where(wima => wima.SourceType != TransmogSourceType.CantCollect &&
126+
// wima.SourceType != TransmogSourceType.NotValidForTransmog)
127127
.ToArrayAsync();
128128

129129
return new ItemModifiedAppearanceCache(itemModifiedAppearances);

apps/frontend/components/achievements/ScoreSummary.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
nulls++;
1818
continue;
1919
}
20+
21+
if (category.slug.endsWith('-hidden')) {
22+
continue;
23+
}
24+
2025
if (nulls === 0) {
2126
retNormal.push(category);
2227
} else if (nulls === 1) {

apps/frontend/components/auctions/AuctionsSpecificItem.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
import WowheadLink from '@/shared/components/links/WowheadLink.svelte';
1111
import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';
1212
13-
export let slug2: string;
13+
let { slug2 }: { slug2: string } = $props();
1414
15-
$: itemId = parseInt(slug2);
15+
let itemId = $derived(parseInt(slug2));
1616
</script>
1717

1818
<style lang="scss">

apps/frontend/components/characters/professions/CharacterProfessionsProfessionSkillRanks.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
class:status-shrug={userHas && currentRank < totalRanks}
3333
class:status-fail={!userHas}
3434
>
35-
{#each { length: 3 }, index}
35+
{#each { length: Math.max(totalRanks, 3) }, index}
3636
<WowheadLink
3737
id={index === 0 ? ability.spellId : ability.extraRanks[index - 1][1]}
3838
type="spell"

apps/frontend/components/home/table/row/HomeTableRowSettings.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,12 @@
4343
.settings-icon {
4444
cursor: pointer;
4545
position: relative;
46+
width: 24px;
4647
}
4748
.options-connector {
48-
border-top: 1px solid #ddd;
49+
border-top: 1px solid var(--border-color);
4950
height: 1px;
50-
left: 15px;
51+
left: 9px;
5152
position: absolute;
5253
top: 50%;
5354
transform: translateX(100%);
@@ -58,7 +59,7 @@
5859
padding: 0.2rem 0.4rem;
5960
position: absolute;
6061
top: 0;
61-
right: 0;
62+
right: -8px;
6263
transform: translateX(100%);
6364
}
6465
</style>

apps/frontend/data/enchants.ts

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import { InventorySlot } from '@/enums/inventory-slot';
2+
import type { Character } from '@/types/character';
3+
4+
// SpellItemEnchantment.db2
5+
export const validEnchants: Record<number, number[]> = {
6+
[InventorySlot.MainHand]: [
7+
3368, // Rune of the Fallen Crusader [DK]
8+
5870, // Rune of the Fallen Crusader [DK]
9+
// 6243, // Rune of Hysteria [DK]
10+
3370, // Rune of Razorice [DK]
11+
5869, // Rune of Razorice [DK]
12+
6241, // Rune of Sanguination [DK]
13+
3847, // Rune of the Stoneskin Gargoyle [DK]
14+
15+
8038, // Acuity of the Ren'dorei 1
16+
8039, // Acuity of the Ren'dorei 2
17+
8040, // Arcane Mastery 1
18+
8041, // Arcane Mastery 2
19+
7982, // Berserker's Rage 1
20+
7983, // Berserker's Rage 2
21+
8036, // Flames of the Sin'dorei 1
22+
8037, // Flames of the Sin'dorei 2
23+
7980, // Jan'alai's Precision 1
24+
7981, // Jan'alai's Precision 2
25+
7978, // Strength of Halazzi 1
26+
7979, // Strength of Halazzi 2
27+
8010, // Worldsoul Aegis 1
28+
8009, // Worldsoul Aegis 2
29+
8008, // Worldsoul Cradle 1
30+
8007, // Worldsoul Cradle 2
31+
8010, // Worldsoul Tenacity 1
32+
8011, // Worldsoul Tenacity 2
33+
],
34+
35+
[InventorySlot.Head]: [
36+
7990, // Empowered Blessing of Speed 1
37+
7991, // Empowered Blessing of Speed 1
38+
7960, // Empowered Hex of Leeching 1
39+
7961, // Empowered Hex of Leeching 1
40+
8016, // Empowered Rune of Avoidance 1
41+
8017, // Empowered Rune of Avoidance 1
42+
],
43+
44+
[InventorySlot.Shoulders]: [
45+
7972, // Akil'zon's Swiftness 1
46+
7973, // Akil'zon's Swiftness 2
47+
8000, // Amirdrassil's Grace 1
48+
8001, // Amirdrassil's Grace 2
49+
8030, // Silvermoon's Mending 1
50+
8031, // Silvermoon's Mending 2
51+
],
52+
53+
[InventorySlot.Chest]: [
54+
7956, // Mark of Nalorakk 1
55+
7957, // Mark of Nalorakk 2
56+
8012, // Mark of the Magister 1
57+
8013, // Mark of the Magister 2
58+
7984, // Mark of the Rootwarden 1
59+
7985, // Mark of the Rootwarden 2
60+
7986, // Mark of the Worldsoul 1
61+
7987, // Mark of the Worldsoul 2
62+
],
63+
64+
[InventorySlot.Legs]: [
65+
7936, // Arcanoweave Spellthread 1
66+
7937, // Arcanoweave Spellthread 2
67+
8162, // Blood Knight's Armor Kit 1
68+
8163, // Blood Knight's Armor Kit 2
69+
8158, // Forest Hunter's Armor Kit 1
70+
8159, // Forest Hunter's Armor Kit 2
71+
7934, // Sunfire Silk Spellthread 1
72+
7935, // Sunfire Silk Spellthread 2
73+
],
74+
75+
[InventorySlot.Feet]: [
76+
8018, // Farstrider's Hunt 1
77+
8019, // Farstrider's Hunt 2
78+
7962, // Lynx's Dexterity 1
79+
7963, // Lynx's Dexterity 2
80+
7992, // Shaladrassil's Roots 1
81+
7993, // Shaladrassil's Roots 2
82+
],
83+
84+
[InventorySlot.Ring1]: [
85+
7966, // Eyes of the Eagle 1
86+
7967, // Eyes of the Eagle 2
87+
7996, // Nature's Fury 1
88+
7997, // Nature's Fury 2
89+
8024, // Silvermoon's Alacrity 1
90+
8025, // Silvermoon's Alacrity 2
91+
8026, // Silvermoon's Tenacity 1
92+
8027, // Silvermoon's Tenacity 2
93+
7968, // Zul'jin's Mastery 1
94+
7969, // Zul'jin's Mastery 2
95+
],
96+
};
97+
98+
export const specialValidEnchants: Record<number, SpecialValidEnchant> = {
99+
// FIXME
100+
/*[InventorySlot.Hands]: {
101+
enchants: [
102+
6210, // Eternal Strength
103+
],
104+
checkFunc: (character: Character) =>
105+
specializationMap[character.activeSpecId]?.mainStat === PrimaryStat.Strength
106+
},
107+
108+
[InventorySlot.Wrist]: {
109+
enchants: [
110+
6220, // Eternal Intellect
111+
],
112+
checkFunc: (character: Character) =>
113+
specializationMap[character.activeSpecId]?.mainStat === PrimaryStat.Intellect
114+
},
115+
116+
[InventorySlot.Feet]: {
117+
enchants: [
118+
6211, // Eternal Agility
119+
],
120+
checkFunc: (character: Character) =>
121+
specializationMap[character.activeSpecId]?.mainStat === PrimaryStat.Agility
122+
},*/
123+
};
124+
125+
interface SpecialValidEnchant {
126+
enchants: number[];
127+
checkFunc: (character: Character) => boolean;
128+
}

0 commit comments

Comments
 (0)