mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-25 23:18:44 -07:00
Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -85,16 +85,17 @@ public class AvatarItemsController(DorkNetDbContext db, IConfiguration config) :
|
|||||||
if (!config.GetValue("Avatar:EnableUnlockedItems", true))
|
if (!config.GetValue("Avatar:EnableUnlockedItems", true))
|
||||||
return Ok(new List<UnlockedAvatarItemDto>());
|
return Ok(new List<UnlockedAvatarItemDto>());
|
||||||
|
|
||||||
// Defaults raised (30 → 100, 4 → 20) — the old 4-per-slot silently
|
// The old [1,120] / [1,20] ceilings reflected the 2020 *watch's*
|
||||||
// dropped any newly-purchased item once a slot held 4+ entries (the
|
// render-budget headroom — feeding it too many BrowsableAvatarItem /
|
||||||
// "I bought it but it's gone after relog" symptom). The clamp
|
// DynamicAvatarItemImposter rows could crash its wardrobe drawer.
|
||||||
// ranges stay at [1,120] / [1,20] — those reflect empirical watch
|
// This branch (march-2023-03-21) serves the 2023 DESKTOP client, which
|
||||||
// testing on render-budget headroom (per the prior maintainer note
|
// has no such limit, and the watch-era cap was silently truncating the
|
||||||
// about BrowsableAvatarItem / DynamicAvatarItemImposter thrash
|
// owned wardrobe to 100 ("most of my items don't show"). Raise the
|
||||||
// above this count); raising the clamp ceiling without retesting
|
// ceilings well above the full catalog (882 base items + variants) so
|
||||||
// could crash the watch's wardrobe drawer.
|
// nothing the player owns is dropped; the config keys still let an
|
||||||
var maxItems = Math.Clamp(config.GetValue("Avatar:MaxUnlockedItems", 100), 1, 120);
|
// operator dial it back down for a watch build.
|
||||||
var maxPerSlot = Math.Clamp(config.GetValue("Avatar:MaxUnlockedItemsPerSlot", 20), 1, 20);
|
var maxItems = Math.Clamp(config.GetValue("Avatar:MaxUnlockedItems", 4000), 1, 8000);
|
||||||
|
var maxPerSlot = Math.Clamp(config.GetValue("Avatar:MaxUnlockedItemsPerSlot", 1000), 1, 2000);
|
||||||
|
|
||||||
var pid = this.CurrentPlayerId();
|
var pid = this.CurrentPlayerId();
|
||||||
if (pid is not long me) return Ok(new List<UnlockedAvatarItemDto>());
|
if (pid is not long me) return Ok(new List<UnlockedAvatarItemDto>());
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user