Skip to content

Commit 0476092

Browse files
DuckySoLuckyDarthGigiJoonaFinland
authored
bump prod (#47)
* fix: crap ton of changes and bug fixes * feat: forgot to add texture here * fix: 64x32 skulls being white * fix: back left being flipped * fix: openapi docs * fix: endpoint * chore: regenerate openapi schema * refactor: small consistency fixes, add consumable secton * feat: sort items based on the inventory index as well, not only rarity, so it's like befroe * fix: sunflower garden milestone * feat: add sea creatures * fix: replacing entire accessory data for dupes * feat: add mutations * feat: add attribute_shards endpoint * perf: do not fetch if it's bot * feat: add missing accessories * perf: better username resolving caching * feat: add ability to toggle verbose logging & forensics * feat: add new museum categories * Fix: Bukkit Case 351 damage 2 maps to cactus_green (#37) * Fix: case 351 wrong dye mapping (cyan → cactus_green) * Updated Cases 402 and 405 Some fucktwat tried at least lol * perf: make startup a lot faster, especially dev * Fix: use green_dye instead of cactus_green for dye ID 351 (#38) * panic: failed to connect to Redis: could not connect to Redis: LOADING Redis is loading the dataset in memory * refactor: do not use go git * fix: start update loop only on main thread * fix: update on all threads, forgot to add on last commit * fix: trophy fish * feat(inventory): add sacks * very important fix, trust me nocap * fix: error * fix: hypixelCase at SkyCrypt, gen types * fix: consumables texture * fix: foraging lvl cap * fix: embed * build: bump mongodb to v2 * fix: FS link * H+ link * feat: add rank to the embed * bump docs * disable bot detection to test smth * reenable bot detection * change format of embed data * fix: datatype * fix: sacks error, bot detection * fix: attribute_shards owned count * fix: farming items being under foraging section * fix: VOTER_BADGE_SUPREME being recomb * feat: add crap ton of probs for frontend guy to play around * feat: add /api/combined endpoint * fix: possible fix, idk? * feat: add pre commit hook * fix: specific textures failing cuz durability/damage isn't 0 in API response (wtf hypixel) * fix: possible fix? idk, wth is going on here with JS * fix: JS stop acting up * refactor: future proof this as I guess? --------- Co-authored-by: DarthGigi <47110839+DarthGigi@users.noreply.github.com> Co-authored-by: Joona Jokivuori <43171241+JoonaFinland@users.noreply.github.com>
1 parent 8a3cb6a commit 0476092

39 files changed

+650
-329
lines changed

.githooks/pre-push

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
if ! command -v swag >/dev/null 2>&1; then
6+
echo "swag is not installed or not on PATH" >&2
7+
exit 1
8+
fi
9+
10+
swag init -g main.go --v3.1 --parseDependency --parseInternal

NotEnoughUpdates-REPO

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ If you have already cloned the repository without submodules:
170170
git submodule update --init --recursive
171171
```
172172

173+
Enable the repository git hooks so `swag init` runs automatically before each push:
174+
175+
```bash
176+
git config core.hooksPath .githooks
177+
```
178+
173179
Download Go dependencies:
174180

175181
```bash

docs/docs.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/swagger.json

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

docs/swagger.yaml

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@ components:
2121
type: object
2222
models.AttributeShard:
2323
properties:
24-
captured:
24+
abilityLevel:
2525
type: integer
26+
abilityMaxLevel:
27+
type: integer
28+
abilityName:
29+
type: string
30+
capturedTimestamp:
31+
type: integer
32+
family:
33+
items:
34+
type: string
35+
type: array
36+
uniqueItems: false
2637
lore:
2738
items:
2839
type: string
@@ -34,6 +45,10 @@ components:
3445
type: string
3546
owned:
3647
type: integer
48+
rarity:
49+
type: string
50+
shardId:
51+
type: string
3752
syphoned:
3853
type: integer
3954
texture:
@@ -216,6 +231,38 @@ components:
216231
totalCollections:
217232
type: integer
218233
type: object
234+
models.CombinedOutput:
235+
properties:
236+
accessories:
237+
$ref: '#/components/schemas/models.GetMissingAccessoresOutput'
238+
bestiary:
239+
$ref: '#/components/schemas/models.BestiaryOutput'
240+
collections:
241+
$ref: '#/components/schemas/models.CollectionsOutput'
242+
crimsonIsle:
243+
$ref: '#/components/schemas/models.CrimsonIsleOutput'
244+
dungeons:
245+
$ref: '#/components/schemas/models.DungeonsOutput'
246+
gear:
247+
$ref: '#/components/schemas/models.Gear'
248+
inventory:
249+
items:
250+
$ref: '#/components/schemas/models.StrippedItem'
251+
type: array
252+
uniqueItems: false
253+
minions:
254+
$ref: '#/components/schemas/models.MinionsOutput'
255+
misc:
256+
$ref: '#/components/schemas/models.MiscOutput'
257+
pets:
258+
$ref: '#/components/schemas/models.OutputPets'
259+
rift:
260+
$ref: '#/components/schemas/models.RiftOutput'
261+
skills:
262+
$ref: '#/components/schemas/models.SkillsOutput'
263+
slayers:
264+
$ref: '#/components/schemas/models.SlayersOutput'
265+
type: object
219266
models.Commissions:
220267
properties:
221268
completions:
@@ -1561,6 +1608,8 @@ components:
15611608
$ref: '#/components/schemas/models.FishingOuput'
15621609
foraging:
15631610
$ref: '#/components/schemas/models.ForagingOutput'
1611+
hunting:
1612+
$ref: '#/components/schemas/models.AttributeShardsOutput'
15641613
mining:
15651614
$ref: '#/components/schemas/models.MiningOutput'
15661615
type: object
@@ -2139,9 +2188,9 @@ paths:
21392188
summary: Get accessories stats of a specified player
21402189
tags:
21412190
- accessories
2142-
/api/attribute_shards/{uuid}/{profileId}:
2191+
/api/bestiary/{uuid}/{profileId}:
21432192
get:
2144-
description: Returns attribute shards stats for the given user and profile ID
2193+
description: Returns bestiary for the given user and profile ID
21452194
parameters:
21462195
- description: User UUID
21472196
in: path
@@ -2160,20 +2209,20 @@ paths:
21602209
content:
21612210
application/json:
21622211
schema:
2163-
$ref: '#/components/schemas/models.AttributeShardsOutput'
2212+
$ref: '#/components/schemas/models.BestiaryOutput'
21642213
description: OK
21652214
"400":
21662215
content:
21672216
application/json:
21682217
schema:
21692218
$ref: '#/components/schemas/models.ProcessingError'
21702219
description: Bad Request
2171-
summary: Get attribute shards stats of a specified player
2220+
summary: Get bestiary stats of a specified player
21722221
tags:
2173-
- attribute_shards
2174-
/api/bestiary/{uuid}/{profileId}:
2222+
- bestiary
2223+
/api/collections/{uuid}/{profileId}:
21752224
get:
2176-
description: Returns bestiary for the given user and profile ID
2225+
description: Returns collections for the given user and profile ID
21772226
parameters:
21782227
- description: User UUID
21792228
in: path
@@ -2192,20 +2241,20 @@ paths:
21922241
content:
21932242
application/json:
21942243
schema:
2195-
$ref: '#/components/schemas/models.BestiaryOutput'
2244+
$ref: '#/components/schemas/models.CollectionsOutput'
21962245
description: OK
2197-
"400":
2246+
"500":
21982247
content:
21992248
application/json:
22002249
schema:
22012250
$ref: '#/components/schemas/models.ProcessingError'
2202-
description: Bad Request
2203-
summary: Get bestiary stats of a specified player
2251+
description: Internal Server Error
2252+
summary: Get collections stats of a specified player
22042253
tags:
2205-
- bestiary
2206-
/api/collections/{uuid}/{profileId}:
2254+
- collections
2255+
/api/combined/{uuid}/{profileId}:
22072256
get:
2208-
description: Returns collections for the given user and profile ID
2257+
description: Returns combined stats for the given user and profile ID
22092258
parameters:
22102259
- description: User UUID
22112260
in: path
@@ -2224,17 +2273,23 @@ paths:
22242273
content:
22252274
application/json:
22262275
schema:
2227-
$ref: '#/components/schemas/models.CollectionsOutput'
2276+
$ref: '#/components/schemas/models.CombinedOutput'
22282277
description: OK
2278+
"400":
2279+
content:
2280+
application/json:
2281+
schema:
2282+
$ref: '#/components/schemas/models.ProcessingError'
2283+
description: Bad Request
22292284
"500":
22302285
content:
22312286
application/json:
22322287
schema:
22332288
$ref: '#/components/schemas/models.ProcessingError'
22342289
description: Internal Server Error
2235-
summary: Get collections stats of a specified player
2290+
summary: Get combined stats of a specified player
22362291
tags:
2237-
- collections
2292+
- combinedStats
22382293
/api/crimson_isle/{uuid}/{profileId}:
22392294
get:
22402295
description: Returns Crimson Isle stats for the given user and profile ID

src/NotEnoughUpdates/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func ParseNEURepository() error {
135135
return fmt.Errorf("failed to unmarshal JSON from %s: %w", filePath, err)
136136
}
137137

138-
NEUConstants.AttributeShards = neustats.FormatAttributeShards(attributeShards.Attributes, GetItem)
138+
NEUConstants.AttributeShards = neustats.FormatAttributeShards(attributeShards, GetItem)
139139
} else if constant.Name() == "sacks.json" {
140140
filePath := fmt.Sprintf("%s/%s", constantsPath, constant.Name())
141141
data, err := os.ReadFile(filePath)

src/api/hypixel_constants.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func getSkyBlockItemsFromCache(cachedData string) ([]models.HypixelItem, error)
7272
err = json.Unmarshal([]byte(cachedData), &data)
7373
if err == nil {
7474
return data.Items, nil
75+
} else {
76+
fmt.Printf("%s\n", err)
7577
}
7678
}
7779
time.Sleep(500 * time.Millisecond)
@@ -157,7 +159,7 @@ func processItems(items *[]models.HypixelItem) map[string]models.ProcessedHypixe
157159
Name: item.Name,
158160
ItemId: constants.BUKKIT_TO_ID[item.Material],
159161
Rarity: strings.ToLower(item.Rarity),
160-
Damage: item.Damage,
162+
Damage: int(item.Damage),
161163
Texture: texture,
162164
TextureId: utility.GetSkinHash(item.Skin.Value),
163165
Category: strings.ToLower(item.Category),

src/constants/accessories.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,10 @@ var SPECIAL_ACCESSORIES = map[string]specialAccessoryConstant{
226226
AllowsRecomb: false,
227227
AllowsEnrichment: true,
228228
},
229+
"VOTER_BADGE_SUPREME": {
230+
AllowsRecomb: false,
231+
AllowsEnrichment: true,
232+
},
229233
}
230234

231235
var MAGICAL_POWER = map[string]int{

src/models/NEU/attribute_shards.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
package neu
22

33
type FormattedShard struct {
4+
Texture string `json:"texture"`
45
Name string `json:"name"`
5-
ShardName string `json:"shardName"`
6+
AbilityName string `json:"abilityName"`
67
Lore []string `json:"lore"`
7-
Texture string `json:"texture"`
8+
Rarity string `json:"rarity"`
9+
Family []string `json:"family"`
10+
ShardID string `json:"shardId"`
811
ShardStackId string `json:"shardStackId"`
912
ShardOwnedId string `json:"shardOwnedId"`
10-
Rarity string `json:"rarity"`
13+
BazaarName string `json:"bazaarName"`
1114
}
1215

1316
type AttributeShardRaw struct {
@@ -22,5 +25,13 @@ type AttributeShardRaw struct {
2225
}
2326

2427
type AttributeShardsRaw struct {
25-
Attributes []AttributeShardRaw `json:"attributes"`
28+
Attributes []AttributeShardRaw `json:"attributes"`
29+
Level map[string][]int `json:"attribute_levelling"`
30+
UnconsumableShards []string `json:"unconsumable_attributes"`
31+
}
32+
33+
type FormattedShards struct {
34+
Shards []FormattedShard `json:"shards"`
35+
Level map[string][]int `json:"attribute_levelling"`
36+
UnconsumableShards []string `json:"unconsumable_attributes"`
2637
}

0 commit comments

Comments
 (0)