Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
4861ab4
Dynamic Rarity
TurtIeSocks Jul 3, 2022
fdb77dd
Synced docker env vars with latest config
TurtIeSocks Jul 3, 2022
727503b
Cleanup Perms Functions
TurtIeSocks Jul 4, 2022
2ef734b
Extra Ranges
TurtIeSocks Jul 4, 2022
f3a6677
Synced docker env vars with latest config
TurtIeSocks Jul 4, 2022
96b46c2
linting
TurtIeSocks Jul 4, 2022
3832258
Split up Wayfarer
TurtIeSocks Jul 4, 2022
4169d36
Synced docker env vars with latest config
TurtIeSocks Jul 4, 2022
47da9b9
Merge pull request #530 from WatWowMap/extra-ranges
TurtIeSocks Jul 4, 2022
1076e16
Merge branch 'develop' into split-up-wayfarer
TurtIeSocks Jul 4, 2022
414d39e
Update WithSubItems.jsx
TurtIeSocks Jul 4, 2022
09efcc1
Linting
TurtIeSocks Jul 4, 2022
f8acda2
Merge pull request #531 from WatWowMap/split-up-wayfarer
TurtIeSocks Jul 4, 2022
4867e76
Merge branch 'develop' into dynamic-rarity
TurtIeSocks Jul 4, 2022
80d9eb2
Version Bump
TurtIeSocks Jul 4, 2022
29cc5c7
Wayfarer Tweaks & Fixes
TurtIeSocks Jul 4, 2022
48edf31
Merge pull request #532 from WatWowMap/wayfarer-tweaks
TurtIeSocks Jul 4, 2022
e91403b
fix click events
TurtIeSocks Jul 4, 2022
9d6d1d6
Merge pull request #529 from WatWowMap/cleanup-perms-fn
TurtIeSocks Jul 4, 2022
18415b0
fix mad
TurtIeSocks Jul 4, 2022
5de2d3f
Merge pull request #528 from WatWowMap/dynamic-rarity
TurtIeSocks Jul 4, 2022
a0ecadc
Add 0iv glow to default.json
TurtIeSocks Jul 6, 2022
0212728
Add historical rarity to the event loop
TurtIeSocks Jul 7, 2022
67ffb2f
Synced docker env vars with latest config
TurtIeSocks Jul 7, 2022
02e06bd
Linting
TurtIeSocks Jul 7, 2022
d12edb9
Merge branch 'historical-rarity-event-loop' of https://github.com/Wat…
TurtIeSocks Jul 7, 2022
063d525
Update nodemon
TurtIeSocks Jul 7, 2022
94bff62
Merge pull request #533 from WatWowMap/historical-rarity-event-loop
TurtIeSocks Jul 7, 2022
acf752b
Update AreaTile.jsx
TurtIeSocks Jul 7, 2022
5dcd5fb
Add Tap To Toggle Option
TurtIeSocks Jul 7, 2022
d8086c2
Synced docker env vars with latest config
TurtIeSocks Jul 7, 2022
5c99d88
Merge pull request #534 from WatWowMap/tap-to-toggle-option
TurtIeSocks Jul 7, 2022
960d7d6
Poi Power Up Filtering
TurtIeSocks Jul 7, 2022
ba487f2
Synced docker env vars with latest config
TurtIeSocks Jul 7, 2022
0a5e50e
version bump
TurtIeSocks Jul 7, 2022
5e2912b
Merge branch 'poi-powerup-filtering' of https://github.com/WatWowMap/…
TurtIeSocks Jul 7, 2022
5b4dd6f
Minor logic adjustment
TurtIeSocks Jul 7, 2022
95b90b6
Fixes
TurtIeSocks Jul 7, 2022
c87fc76
Merge pull request #535 from WatWowMap/poi-powerup-filtering
TurtIeSocks Jul 7, 2022
34db64f
Update Icons.js
TurtIeSocks Jul 8, 2022
31c00b4
Translations
TurtIeSocks Jul 9, 2022
5090af8
Configurable Pogo Endpoints
TurtIeSocks Jul 12, 2022
d9f970d
Synced docker env vars with latest config
TurtIeSocks Jul 12, 2022
b31a6a2
linting...
TurtIeSocks Jul 12, 2022
006abdb
Merge branch 'configurable-pogo-endpoints' of https://github.com/WatW…
TurtIeSocks Jul 12, 2022
89c2b8b
Update config.js
TurtIeSocks Jul 12, 2022
8ca776b
Merge pull request #537 from WatWowMap/configurable-pogo-endpoints
TurtIeSocks Jul 12, 2022
5f008bf
Update default invasions endpoint (temp)
TurtIeSocks Jul 18, 2022
796a096
Extra Lure Support
TurtIeSocks Jul 18, 2022
9ee3324
Merge pull request #538 from WatWowMap/extra-lure-support
TurtIeSocks Jul 19, 2022
35376ed
remove configurable drawer
TurtIeSocks Aug 1, 2022
6219f24
Synced docker env vars with latest config
TurtIeSocks Aug 1, 2022
eeba0a5
Update Invasions Endpoint
TurtIeSocks Aug 2, 2022
e6ef33e
Merge pull request #543 from WatWowMap/invasions-endpoint
TurtIeSocks Aug 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ jobs:

- name: Sentry Build
run: yarn release
env:
SENTRY_AUTH_TOKEN: ${{secrets.SENTRY_AUTH_TOKEN}}
SENTRY_DSN: ${{secrets.SENTRY_DSN}}
SENTRY_ORG: ${{secrets.SENTRY_ORG}}
SENTRY_PROJECT: ${{secrets.SENTRY_PROJECT}}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "reactmap",
"version": "1.3.0",
"version": "1.3.3",
"description": "React based frontend map.",
"main": "ReactMap.mjs",
"author": "TurtIeSocks <58572875+TurtIeSocks@users.noreply.github.com>",
Expand Down
4 changes: 3 additions & 1 deletion public/base-locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,5 +551,7 @@
"ultra_beast": "Ultrabestie",
"quest_condition": "Questbedingung",
"always_show_labels": "Labels immer anzeigen",
"scan_areas_options": "Optionen für Scanbereiche"
"scan_areas_options": "Optionen für Scanbereiche",
"tap_to_toggle": "Tippen zum Umschalten",
"power_up": "Aufladung"
}
16 changes: 14 additions & 2 deletions public/base-locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"generations": "Generations",
"types": "Types",
"forms": "Forms",
"rarity": "Rarity",
"rarity": "Current Rarity",
"others": "Others",
"categories": "Categories",
"rank": "Rank",
Expand Down Expand Up @@ -546,5 +546,17 @@
"poi_color": "POI Color",
"quest_condition": "Quest Condition",
"always_show_labels": "Always Show Labels",
"scan_areas_options": "Scan Areas Options"
"scan_areas_options": "Scan Areas Options",
"historic_rarity": "Historic Rarity",
"poi": "Points of Interest",
"300m_range": "300m Range",
"lure_range": "Lure Range",
"tap_to_toggle": "Tap To Toggle",
"power_up": "Power Up",
"never_alt": "Never",
"seen_nearby_stop": "Seen Nearby",
"seen_nearby_cell": "Seen in this Cell",
"seen_lure_encounter": "Lure Encounter",
"seen_lure_wild": "Lure Spawn",
"seen_wild": "Wild Spawn"
}
7 changes: 5 additions & 2 deletions server/scripts/createLocales.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-console */
const fs = require('fs')
const path = require('path')
const { api } = require('../src/services/config')

const fetchJson = require('../src/services/api/fetchJson')

Expand All @@ -9,6 +10,8 @@ const finalLocalesFolder = path.resolve(__dirname, '../../public/locales')
const missingFolder = path.resolve(__dirname, '../../public/missing-locales')

const locales = async () => {
if (!api.pogoApiEndpoints.translations)
console.error('[LOCALES] No translations endpoint')
const localTranslations = await fs.promises.readdir(appLocalesFolder)
const englishRef = fs.readFileSync(
path.resolve(appLocalesFolder, 'en.json'),
Expand All @@ -22,7 +25,7 @@ const locales = async () => {
)

const availableRemote = await fetchJson(
'https://raw.githubusercontent.com/WatWowMap/pogo-translations/master/index.json',
`${api.pogoApiEndpoints.translations}/index.json`,
)

await Promise.all(
Expand All @@ -41,7 +44,7 @@ const locales = async () => {
try {
const hasRemote = availableRemote.includes(locale)
const remoteFiles = await fetchJson(
`https://raw.githubusercontent.com/WatWowMap/pogo-translations/master/static/locales/${
`${api.pogoApiEndpoints.translations}/static/locales/${
hasRemote ? baseName : 'en'
}.json`,
)
Expand Down
88 changes: 56 additions & 32 deletions server/scripts/generateMasterfile.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,81 @@
/* eslint-disable no-console */
/* eslint-disable no-restricted-syntax */
const fs = require('fs')
const path = require('path')
const { rarity } = require('../src/services/config')
const { resolve } = require('path')
const { rarity: customRarity, api } = require('../src/services/config')
const fetchJson = require('../src/services/api/fetchJson')
const defaultRarity = require('../src/data/defaultRarity.json')

const getRarityLevel = (id, pkmn) => {
let pkmnRarity
for (const [tier, pokemon] of Object.entries(defaultRarity)) {
if (rarity?.[tier]?.length) {
if (rarity[tier].includes(parseInt(id))) {
pkmnRarity = tier
}
} else if (pokemon.includes(parseInt(id))) {
pkmnRarity = tier
}
const rarityObj = {}
Object.entries(defaultRarity).forEach(([tier, pokemon]) => {
if (customRarity?.[tier]?.length) {
customRarity[tier].forEach((mon) => (rarityObj[mon] = tier))
} else {
pokemon.forEach((mon) => (rarityObj[mon] = tier))
}
if (pkmn.legendary) pkmnRarity = 'legendary'
if (pkmn.mythical) pkmnRarity = 'mythical'
if (pkmn.ultraBeast) pkmnRarity = 'ultraBeast'
return pkmnRarity
}
})

const generate = async (save) => {
const generate = async (
save = false,
historicRarity = new Map(),
dbRarity = new Map(),
) => {
try {
const masterfile = await fetchJson(
'https://raw.githubusercontent.com/WatWowMap/Masterfile-Generator/master/master-latest-react-map.json',
)
if (!api.pogoApiEndpoints.masterfile)
throw new Error('No masterfile endpoint')

const masterfile = await fetchJson(api.pogoApiEndpoints.masterfile)

Object.values(masterfile.pokemon).forEach((pokemon) => {
pokemon.rarity = getRarityLevel(pokemon.pokedexId, pokemon)
pokemon.types = pokemon.types || []
delete pokemon.mythical
delete pokemon.legendary
})
const newMf = {
...masterfile,
pokemon: Object.fromEntries(
Object.values(masterfile.pokemon).map((pokemon) => {
const { legendary, mythical, ultraBeast, ...rest } = pokemon
const historic =
historicRarity.get(pokemon.pokedexId.toString()) || 'never'

let rarity =
(dbRarity.size
? dbRarity.get(`${pokemon.pokedexId}-${pokemon.defaultFormId}`)
: rarityObj[pokemon.pokedexId]) || 'never'
if (legendary) rarity = 'legendary'
if (mythical) rarity = 'mythical'
if (ultraBeast) rarity = 'ultraBeast'
if (rarityObj[pokemon.pokedexId] === 'regional') rarity = 'regional'

const forms = Object.fromEntries(
Object.entries(pokemon.forms || {}).map(([formId, form]) => [
formId,
{
...form,
rarity:
+formId === pokemon.defaultFormId
? rarity
: dbRarity.get(`${pokemon.pokedexId}-${formId}`) || 'never',
},
]),
)
return [pokemon.pokedexId, { ...rest, forms, rarity, historic }]
}),
),
}

if (save) {
fs.writeFileSync(
path.resolve(`${__dirname}/../src/data/masterfile.json`),
JSON.stringify(masterfile, null, 2),
resolve(`${__dirname}/../src/data/masterfile.json`),
JSON.stringify(newMf, null, 2),
'utf8',
() => {},
)
}
return masterfile
return newMf
} catch (e) {
// eslint-disable-next-line no-console
console.warn('[WARN] Unable to generate new masterfile, using existing.', e)
}
}

module.exports.generate = generate

if (require.main === module) {
// eslint-disable-next-line no-console
generate(true).then(() => console.log('Masterfile generated'))
}
56 changes: 54 additions & 2 deletions server/src/configs/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
"nests": {
"__name": "API_QUERY_UPDATE_HOURS_NESTS",
"__format": "number"
},
"historicalRarity": {
"__name": "API_QUERY_UPDATE_HOURS_HISTORICAL_RARITY",
"__format": "number"
}
},
"queryOnSessionInit": {
Expand Down Expand Up @@ -213,6 +217,11 @@
"fetchTimeoutMs": {
"__name": "API_FETCH_TIMEOUT_MS",
"__format": "number"
},
"pogoApiEndpoints": {
"invasions": "API_POGO_API_ENDPOINTS_INVASIONS",
"masterfile": "API_POGO_API_ENDPOINTS_MASTERFILE",
"translations": "API_POGO_API_ENDPOINTS_TRANSLATIONS"
}
},
"multiDomains": {
Expand Down Expand Up @@ -370,8 +379,7 @@
"theme": {
"style": "MAP_THEME_STYLE",
"primary": "MAP_THEME_PRIMARY",
"secondary": "MAP_THEME_SECONDARY",
"drawer": "MAP_THEME_DRAWER"
"secondary": "MAP_THEME_SECONDARY"
},
"clustering": {
"gyms": {
Expand Down Expand Up @@ -529,6 +537,10 @@
"__name": "CLIENT_SIDE_OPTIONS_GYMS_INTERACTION_RANGES",
"__format": "boolean"
},
"300mRange": {
"__name": "CLIENT_SIDE_OPTIONS_GYMS_300M_RANGE",
"__format": "boolean"
},
"showExBadge": {
"__name": "CLIENT_SIDE_OPTIONS_GYMS_SHOW_EX_BADGE",
"__format": "boolean"
Expand Down Expand Up @@ -563,6 +575,10 @@
"__name": "CLIENT_SIDE_OPTIONS_POKESTOPS_INTERACTION_RANGES",
"__format": "boolean"
},
"lureRange": {
"__name": "CLIENT_SIDE_OPTIONS_POKESTOPS_LURE_RANGE",
"__format": "boolean"
},
"madQuestText": {
"__name": "CLIENT_SIDE_OPTIONS_POKESTOPS_MAD_QUEST_TEXT",
"__format": "boolean"
Expand Down Expand Up @@ -641,6 +657,10 @@
"alwaysShowLabels": {
"__name": "CLIENT_SIDE_OPTIONS_SCAN_AREAS_ALWAYS_SHOW_LABELS",
"__format": "boolean"
},
"tapToToggle": {
"__name": "CLIENT_SIDE_OPTIONS_SCAN_AREAS_TAP_TO_TOGGLE",
"__format": "boolean"
}
},
"weather": {
Expand Down Expand Up @@ -668,6 +688,7 @@
"__name": "DEFAULT_FILTERS_GYMS_ALL_GYMS",
"__format": "boolean"
},
"levels": "DEFAULT_FILTERS_GYMS_LEVELS",
"exEligible": {
"__name": "DEFAULT_FILTERS_GYMS_EX_ELIGIBLE",
"__format": "boolean"
Expand Down Expand Up @@ -736,6 +757,7 @@
"__name": "DEFAULT_FILTERS_POKESTOPS_ENABLED",
"__format": "boolean"
},
"levels": "DEFAULT_FILTERS_POKESTOPS_LEVELS",
"lures": {
"__name": "DEFAULT_FILTERS_POKESTOPS_LURES",
"__format": "boolean"
Expand Down Expand Up @@ -868,6 +890,18 @@
"enabled": {
"__name": "DEFAULT_FILTERS_SUBMISSION_CELLS_ENABLED",
"__format": "boolean"
},
"rings": {
"__name": "DEFAULT_FILTERS_SUBMISSION_CELLS_RINGS",
"__format": "boolean"
},
"s17Cells": {
"__name": "DEFAULT_FILTERS_SUBMISSION_CELLS_S17CELLS",
"__format": "boolean"
},
"s14Cells": {
"__name": "DEFAULT_FILTERS_SUBMISSION_CELLS_S14CELLS",
"__format": "boolean"
}
},
"weather": {
Expand Down Expand Up @@ -1407,6 +1441,20 @@
}
},
"rarity": {
"percents": {
"uncommon": {
"__name": "RARITY_PERCENTS_UNCOMMON",
"__format": "number"
},
"rare": {
"__name": "RARITY_PERCENTS_RARE",
"__format": "number"
},
"ultraRare": {
"__name": "RARITY_PERCENTS_ULTRA_RARE",
"__format": "number"
}
},
"common": {
"__name": "RARITY_COMMON",
"__format": "json"
Expand All @@ -1430,6 +1478,10 @@
"event": {
"__name": "RARITY_EVENT",
"__format": "json"
},
"never": {
"__name": "RARITY_NEVER",
"__format": "json"
}
},
"manualAreas": {
Expand Down
Loading