diff --git a/src/controllers/gym.js b/src/controllers/gym.js index 209b3b124..c09428c2f 100644 --- a/src/controllers/gym.js +++ b/src/controllers/gym.js @@ -25,7 +25,7 @@ class Gym extends Controller { select humans.id, humans.name, humans.type, humans.language, humans.latitude, humans.longitude, gym.template, gym.distance, gym.clean, gym.ping from gym join humans on (humans.id = gym.id and humans.current_profile_no = gym.profile_no) where humans.enabled = 1 and humans.admin_disable = false and - gym.team = ${data.teamId} + (gym.team = ${data.teamId} or gym.team = 4) ${changeQuery} ${strictareastring} and diff --git a/src/controllers/raid.js b/src/controllers/raid.js index 721c8445b..e4a388dcb 100644 --- a/src/controllers/raid.js +++ b/src/controllers/raid.js @@ -10,7 +10,7 @@ class Raid extends Controller { select humans.id, humans.name, humans.type, humans.language, humans.latitude, humans.longitude, raid.template, raid.distance, raid.clean, raid.ping from raid join humans on (humans.id = raid.id and humans.current_profile_no = raid.profile_no) where humans.enabled = 1 and humans.admin_disable = false and (humans.blocked_alerts IS NULL OR humans.blocked_alerts NOT LIKE '%raid%') and - (pokemon_id=${data.pokemon_id} or (pokemon_id=9000 and raid.level=${data.level})) and + (pokemon_id=${data.pokemon_id} or (pokemon_id=9000 and (raid.level=${data.level} or raid.level=90))) and (raid.team = ${data.team_id} or raid.team = 4) and (raid.exclusive = ${data.ex} or raid.exclusive = 0) and (raid.form = ${data.form} or raid.form = 0) and @@ -73,7 +73,7 @@ class Raid extends Controller { select humans.id, humans.name, humans.type, humans.language, humans.latitude, humans.longitude, egg.template, egg.distance, egg.clean, egg.ping from egg join humans on (humans.id = egg.id and humans.current_profile_no = egg.profile_no) where humans.enabled = 1 and humans.admin_disable = false and (humans.blocked_alerts IS NULL OR humans.blocked_alerts NOT LIKE '%egg%') and - egg.level = ${data.level} and + (egg.level = ${data.level} or egg.level = 90) and (egg.team = ${data.team_id} or egg.team = 4) and (egg.exclusive = ${data.ex} or egg.exclusive = 0) ${strictareastring} diff --git a/src/lib/poracleMessage/commands/tracked.js b/src/lib/poracleMessage/commands/tracked.js index 3ba7c8143..8c1790148 100644 --- a/src/lib/poracleMessage/commands/tracked.js +++ b/src/lib/poracleMessage/commands/tracked.js @@ -68,14 +68,14 @@ async function raidRowText(config, translator, GameData, raid, scannerQuery) { const moveName = raid.move !== 9000 && GameData.moves[raid.move] ? `${translator.translate(GameData.moves[raid.move].name)}/${translator.translate(GameData.moves[raid.move].type)}` : '' if (+raid.pokemon_id === 9000) { - return `**${translator.translate('level').charAt(0).toUpperCase() + translator.translate('level').slice(1)} ${raid.level} ${translator.translate('raids')}** ${raid.distance ? ` | ${translator.translate('distance')}: ${raid.distance}m` : ''}${moveName ? ` | ${translator.translate('with move')} ${moveName}` : ''}${raid.team === 4 ? '' : ` | ${translator.translate('controlled by')} ${raidTeam}`}${raid.exclusive ? ` | ${translator.translate('must be an EX Gym')}` : ''} ${standardText(config, translator, raid)}${raid.gym_id ? ` ${translator.translate('at gym ')} ${gymNameText}` : ''}` + return `**${raid.level === 90 ? translator.translate('All level') : `${translator.translate('level').charAt(0).toUpperCase() + translator.translate('level').slice(1)} ${raid.level}`} ${translator.translate('raids')}** ${raid.distance ? ` | ${translator.translate('distance')}: ${raid.distance}m` : ''}${moveName ? ` | ${translator.translate('with move')} ${moveName}` : ''}${raid.team === 4 ? '' : ` | ${translator.translate('controlled by')} ${raidTeam}`}${raid.exclusive ? ` | ${translator.translate('must be an EX Gym')}` : ''} ${standardText(config, translator, raid)}${raid.gym_id ? ` ${translator.translate('at gym ')} ${gymNameText}` : ''}` } return `**${monsterName}**${formName ? ` ${translator.translate('form')}: ${formName}` : ''}${raid.distance ? ` | ${translator.translate('distance')}: ${raid.distance}m` : ''}${moveName ? ` | ${translator.translate('with move')} ${moveName}` : ''}${raid.team === 4 ? '' : ` | ${translator.translate('controlled by')} ${raidTeam}`}${raid.exclusive ? ` | ${translator.translate('must be an EX Gym')}` : ''} ${standardText(config, translator, raid)}${raid.gym_id ? ` ${translator.translate('at gym ')} ${gymNameText}` : ''}` } async function gymRowText(config, translator, GameData, gym, scannerQuery) { - const raidTeam = translator.translate(GameData.utilData.teams[gym.team].name) + const raidTeam = (gym.team === 4) ? translator.translate('All team\'s') : translator.translate(GameData.utilData.teams[gym.team].name) let gymNameText = null if (gym.gym_id) gymNameText = scannerQuery ? await scannerQuery.getGymName(gym.gym_id) || gym.gym_id : gym.gym_id @@ -106,7 +106,7 @@ async function eggRowText(config, translator, GameData, egg, scannerQuery) { let gymNameText = null if (egg.gym_id) gymNameText = scannerQuery ? await scannerQuery.getGymName(egg.gym_id) || egg.gym_id : egg.gym_id - return `**${translator.translate('level').charAt(0).toUpperCase() + translator.translate('level').slice(1)} ${egg.level} ${translator.translate('eggs')}** ${egg.distance ? ` | ${translator.translate('distance')}: ${egg.distance}m` : ''} ${egg.team === 4 ? '' : ` | ${translator.translate('controlled by')} ${raidTeam}`}${egg.exclusive ? ` | ${translator.translate('must be an EX Gym')}` : ''} ${standardText(config, translator, egg)}${egg.gym_id ? ` ${translator.translate('at gym ')} ${gymNameText}` : ''}` + return `**${egg.level === 90 ? translator.translate('All level') : `${translator.translate('level').charAt(0).toUpperCase() + translator.translate('level').slice(1)} ${egg.level}`} ${translator.translate('eggs')}** ${egg.distance ? ` | ${translator.translate('distance')}: ${egg.distance}m` : ''} ${egg.team === 4 ? '' : ` | ${translator.translate('controlled by')} ${raidTeam}`}${egg.exclusive ? ` | ${translator.translate('must be an EX Gym')}` : ''} ${standardText(config, translator, egg)}${egg.gym_id ? ` ${translator.translate('at gym ')} ${gymNameText}` : ''}` } function questRowText(config, translator, GameData, quest) { diff --git a/src/routes/apiTrackingEgg.js b/src/routes/apiTrackingEgg.js index 419dd8a09..685ff76b9 100644 --- a/src/routes/apiTrackingEgg.js +++ b/src/routes/apiTrackingEgg.js @@ -85,7 +85,7 @@ module.exports = async (fastify, options, next) => { const insert = insertReq.map((row) => { const level = +row.level - if (row.level === undefined || level < 1 || level > 6) { + if (row.level === undefined || level < 1 || (level > 6 && level !== 90)) { throw new Error('Invalid level') } return { diff --git a/src/routes/apiTrackingGym.js b/src/routes/apiTrackingGym.js index 45d8a9f8d..d7592575f 100644 --- a/src/routes/apiTrackingGym.js +++ b/src/routes/apiTrackingGym.js @@ -84,7 +84,7 @@ module.exports = async (fastify, options, next) => { const insert = insertReq.map((row) => { const team = +row.team - if (row.team === undefined || team < 0 || team > 3) { + if (row.team === undefined || team < 0 || team > 4) { throw new Error('Invalid team') } return { diff --git a/src/routes/apiTrackingRaid.js b/src/routes/apiTrackingRaid.js index a79f84d4d..433f41c86 100644 --- a/src/routes/apiTrackingRaid.js +++ b/src/routes/apiTrackingRaid.js @@ -86,7 +86,7 @@ module.exports = async (fastify, options, next) => { let level = 9000 if (row.pokemon_id === 9000) { level = +row.level - if (row.level === undefined || level < 1 || level > 6) { + if (row.level === undefined || level < 1 || (level > 6 && level !== 90)) { throw new Error('Invalid level (must be specified if no pokemon_id') } }