Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"minLevel": true,
"showBigKarp": true,
"showTinyRat": true,
"showSeenType": true,
"showDespawnTimeType": true,
"showPokemonGender": true,
"hidePokemonCoords": true,
Expand Down Expand Up @@ -179,6 +180,7 @@
"noRarityDisplay": true,
"noWeatherIcons": true,
"noIvShadow": true,
"noRankShadow": true,
"hideQuestsPokemon": true,
"hideQuestsItem": true,
"hideQuestsEnergy": true,
Expand Down Expand Up @@ -246,6 +248,7 @@
"processShinyStats": true,
"noPvp": true,
"noHideSingleMarker": true,
"enableJSDebug": true
"enableJSDebug": true,
"pvpRankingMethod": true
}
}
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This fork is different is so many ways that its impossible to name them all. Mai
> Current Version 2.0 - Second release! with OpenStreetMap engine

PokeMap Standalone Frontend or PMSF for short is a PHP Map Interface for RDM, MAD designed to be completely standalone and able to run on any traditional web server. Manual submissions are supported but no longer maintained.

## Login Support:
### oAuth:
* Discord
Expand All @@ -24,8 +24,7 @@ It supports all the common database engines, including MySQL, MariaDB.
* [Wiki](https://github.com/pmsf/PMSF/wiki).

* Join our [Discord](https://discord.gg/JAWztHdqeB) channel for more info about installation.



## Feature Requests
[![Feature Requests](https://feathub.com/pmsf/PMSF?format=svg)](https://feathub.com/pmsf/PMSF)

Expand Down
10 changes: 8 additions & 2 deletions config/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
$noRarityDisplay = false; // true/false
$noWeatherIcons = true; // true/false
$no100IvShadow = false; // true/false
$noRank1Shadow = false; // true/false
$noHideSingleMarker = false; // true/false

/* Notification Settings */
Expand Down Expand Up @@ -256,6 +257,8 @@
$pokemonGenSearchString = 'generation'; // When custom string is used translations do not work.

$noPvp = false; // true/false
$noPvpRankingMethod = false; // true/false
$pvpRankingMethod = 'competition'; // 'competition', 'dense', 'ordinal'

$excludeMinIV = '[]'; // [] for empty

Expand All @@ -268,6 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
$noSeenType = true; // true/false
$showSeenType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
Expand All @@ -279,6 +284,7 @@
$hideGymCoords = false; // true/false
$noExEligible = false; // true/false
$exEligible = 'false'; // true/false
$noArEligible = false; // true/false
$noTeams = false; // true/false
$noInBattle = false; // true/false
$noOpenSpot = false; // true/false
Expand Down Expand Up @@ -333,8 +339,8 @@
$noQuestsEnergy = false; // true/false
$noQuestsCandy = false; // true/false
$noQuestsStardust = false; // true/false
$noItemNames = false; // true/false
$noItemNumbers = true; // true/false
$noItemNames = false; // true/false
$noItemNumbers = false; // true/false
$defaultDustAmount = 500;
$hideQuestsPokemon = '[]'; // Pokemon ids will default be hidden in the menu every user is able to change this personaly
$excludeQuestsPokemon = []; // All Pokémon in this array will not be shown in the filter.
Expand Down
8 changes: 7 additions & 1 deletion config/example.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
$noRarityDisplay = false; // true/false
$noWeatherIcons = true; // true/false
$no100IvShadow = false; // true/false
$noRank1Shadow = false; // true/false
$noHideSingleMarker = false; // true/false

/* Notification Settings */
Expand Down Expand Up @@ -256,6 +257,8 @@
$pokemonGenSearchString = 'generation'; // When custom string is used translations do not work.

$noPvp = false; // true/false
$noPvpRankingMethod = false; // true/false
$pvpRankingMethod = 'competition'; // 'competition', 'dense', 'ordinal'

$excludeMinIV = '[131, 143, 147, 148, 149, 248]'; // [] for empty

Expand All @@ -268,6 +271,8 @@
$noMissingIVOnly = true; // true/false
$noBigKarp = false; // true/false
$noTinyRat = false; // true/false
$noSeenType = true; // true/false
$showSeenType = 0; // 0 = All, 1 = Wild + Nearby (Pokestop), 2 = Wild, 3 = Nearby (Pokestop + Other), 4 = Nearby (Pokestop), 5 = Nearby (Other)
$noDespawnTimeType = true; // true/false
$showDespawnTimeType = 0; // 0 = All, 1 = Verified, 2 = Unverified, 3 = Unverified + Nearby (Nearby = no spawn point)
$noPokemonGender = false; // true/false
Expand All @@ -279,6 +284,7 @@
$hideGymCoords = false; // true/false
$noExEligible = false; // true/false
$exEligible = 'false'; // true/false
$noArEligible = false; // true/false
$noTeams = false; // true/false
$noInBattle = false; // true/false
$noOpenSpot = false; // true/false
Expand Down Expand Up @@ -334,7 +340,7 @@
$noQuestsCandy = false; // true/false
$noQuestsStardust = false; // true/false
$noItemNames = false; // true/false
$noItemNumbers = true; // true/false
$noItemNumbers = false; // true/false
$defaultDustAmount = 500;
$hideQuestsPokemon = '[]'; // Pokemon ids will default be hidden in the menu every user is able to change this personaly
$excludeQuestsPokemon = []; // All Pokémon in this array will not be shown in the filter.
Expand Down
54 changes: 46 additions & 8 deletions lib/RDM.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class RDM extends Scanner
{
public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
Expand All @@ -14,6 +14,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
expire_timestamp AS disappear_time,
id AS encounter_id,
spawn_id,
pokestop_id,
lat AS latitude,
lon AS longitude,
gender,
Expand Down Expand Up @@ -98,6 +99,19 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
if (!empty($seenType)) {
if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
} elseif ($seenType == 2) { // Wild
$conds[] = 'spawn_id IS NOT NULL';
} elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawn_id IS NULL';
} elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
} elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
}
}
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'expire_timestamp_verified = 1';
Expand All @@ -117,7 +131,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}

public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
Expand All @@ -127,6 +141,7 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
expire_timestamp AS disappear_time,
id AS encounter_id,
spawn_id,
pokestop_id,
lat AS latitude,
lon AS longitude,
gender,
Expand Down Expand Up @@ -204,6 +219,19 @@ public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $t
$conds[] = '(level >= ' . $minLevel . ' OR pokemon_id IN(' . $exMinIv . ') )';
}
}
if (!empty($seenType)) {
if ($seenType == 1) { // Wild + Nearby (Pokestop)
$conds[] = '(spawn_id IS NOT NULL OR pokestop_id IS NOT NULL)';
} elseif ($seenType == 2) { // Wild
$conds[] = 'spawn_id IS NOT NULL';
} elseif ($seenType == 3) { // Nearby (Pokestop + Other)
$conds[] = 'spawn_id IS NULL';
} elseif ($seenType == 4) { // Nearby (Pokestop)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NOT NULL)';
} elseif ($seenType == 5) { // Nearby (Other)
$conds[] = '(spawn_id IS NULL AND pokestop_id IS NULL)';
}
}
if (!empty($despawnTimeType)) {
if ($despawnTimeType == 1) {
$conds[] = 'expire_timestamp_verified = 1';
Expand Down Expand Up @@ -261,6 +289,9 @@ public function query_active($select, $conds, $params, $encSql = '')
$pokemon["weight"] = isset($pokemon["weight"]) ? floatval($pokemon["weight"]) : null;
$pokemon["height"] = isset($pokemon["height"]) ? floatval($pokemon["height"]) : null;

$pokemon["level"] = isset($pokemon["level"]) ? intval($pokemon["level"]) : null;
$pokemon["cp"] = isset($pokemon["cp"]) ? intval($pokemon["cp"]) : null;

$pokemon["individual_attack"] = isset($pokemon["individual_attack"]) ? intval($pokemon["individual_attack"]) : null;
$pokemon["individual_defense"] = isset($pokemon["individual_defense"]) ? intval($pokemon["individual_defense"]) : null;
$pokemon["individual_stamina"] = isset($pokemon["individual_stamina"]) ? intval($pokemon["individual_stamina"]) : null;
Expand All @@ -277,6 +308,9 @@ public function query_active($select, $conds, $params, $encSql = '')
$pokemon["pokemon_name"] = i8ln($this->data[$pokemon["pokemon_id"]]['name']);
$pokemon["pokemon_rarity"] = i8ln($this->data[$pokemon["pokemon_id"]]['rarity']);

$pokemon["move_1"] = isset($pokemon["move_1"]) ? intval($pokemon["move_1"]) : null;
$pokemon["move_2"] = isset($pokemon["move_2"]) ? intval($pokemon["move_2"]) : null;

if (isset($pokemon["form"]) && $pokemon["form"] > 0) {
$forms = $this->data[$pokemon["pokemon_id"]]["forms"];
foreach ($forms as $f => $v) {
Expand Down Expand Up @@ -515,7 +549,7 @@ public function get_stops_quest($greids, $qpreids, $qereids, $qcreids, $qireids,

public function query_stops($conds, $params)
{
global $db;
global $db, $noArEligible;

$query = "SELECT id AS pokestop_id,
lat AS latitude,
Expand All @@ -525,6 +559,7 @@ public function query_stops($conds, $params)
updated AS last_seen,
lure_expire_timestamp AS lure_expiration,
incident_expire_timestamp AS incident_expiration,
ar_scan_eligible,
lure_id,
grunt_type,
quest_type,
Expand Down Expand Up @@ -568,6 +603,8 @@ public function query_stops($conds, $params)
}
$pokestop["latitude"] = floatval($pokestop["latitude"]);
$pokestop["longitude"] = floatval($pokestop["longitude"]);
$pokestop["url"] = ! empty($pokestop["url"]) ? preg_replace("/^http:/i", "https:", $pokestop["url"]) : null;
$pokestop["ar_scan_eligible"] = $noArEligible ? 0 : intval($pokestop["ar_scan_eligible"]);
$pokestop["quest_type"] = intval($pokestop["quest_type"]);
$pokestop["quest_condition_type"] = intval($pokestop["quest_condition_type"]);
$pokestop["quest_condition_type_1"] = intval($pokestop["quest_condition_type_1"]);
Expand All @@ -582,7 +619,6 @@ public function query_stops($conds, $params)
$pokestop["reward_item_id"] = intval($pokestop["reward_item_id"]);
$pokestop["reward_item_name"] = empty($item_pid) ? null : i8ln($this->items[$item_pid]["name"]);
$pokestop["reward_amount"] = intval($pokestop["reward_amount"]);
$pokestop["url"] = ! empty($pokestop["url"]) ? preg_replace("/^http:/i", "https:", $pokestop["url"]) : null;
$pokestop["lure_expiration"] = $pokestop["lure_expiration"] * 1000;
$pokestop["incident_expiration"] = $pokestop["incident_expiration"] * 1000;
$pokestop["lure_id"] = intval($pokestop["lure_id"]);
Expand Down Expand Up @@ -668,7 +704,7 @@ public function get_gyms($rbeids, $reeids, $swLat, $swLng, $neLat, $neLng, $exEl

public function query_gyms($conds, $params, $raids, $gyms, $rbeids, $reeids)
{
global $db, $noTeams, $noExEligible, $noInBattle;
global $db, $noTeams, $noExEligible, $noArEligible, $noInBattle;

$query = "SELECT id AS gym_id,
lat AS latitude,
Expand All @@ -690,6 +726,7 @@ public function query_gyms($conds, $params, $raids, $gyms, $rbeids, $reeids)
raid_pokemon_cp,
raid_pokemon_gender,
raid_pokemon_evolution,
ar_scan_eligible,
ex_raid_eligible AS park,
in_battle
FROM gym
Expand All @@ -707,22 +744,23 @@ public function query_gyms($conds, $params, $raids, $gyms, $rbeids, $reeids)
$raid_pid = null;
$gym["raid_pokemon_id"] = null;
}
$gym["latitude"] = floatval($gym["latitude"]);
$gym["longitude"] = floatval($gym["longitude"]);
$gym["url"] = ! empty($gym["url"]) ? preg_replace("/^http:/i", "https:", $gym["url"]) : null;
$gym["team_id"] = $noTeams ? 0 : intval($gym["team_id"]);
$gym["pokemon"] = [];
$gym["raid_pokemon_name"] = empty($raid_pid) ? null : i8ln($this->data[$raid_pid]["name"]);
$gym["raid_pokemon_form"] = intval($gym["raid_pokemon_form"]);
$gym["raid_pokemon_costume"] = intval($gym["raid_pokemon_costume"]);
$gym["raid_pokemon_evolution"] = intval($gym["raid_pokemon_evolution"]);
$gym["raid_pokemon_gender"] = intval($gym["raid_pokemon_gender"]);
$gym["latitude"] = floatval($gym["latitude"]);
$gym["longitude"] = floatval($gym["longitude"]);
$gym["slots_available"] = $noTeams ? 0 : intval($gym["slots_available"]);
$gym["in_battle"] = $noInBattle ? 0 : intval($gym["in_battle"]);
$gym["last_modified"] = $gym["last_modified"] * 1000;
$gym["last_scanned"] = $gym["last_scanned"] * 1000;
$gym["raid_start"] = $gym["raid_start"] * 1000;
$gym["raid_end"] = $gym["raid_end"] * 1000;
$gym["url"] = ! empty($gym["url"]) ? preg_replace("/^http:/i", "https:", $gym["url"]) : null;
$gym["ar_scan_eligible"] = $noArEligible ? 0 : intval($gym["ar_scan_eligible"]);
$gym["park"] = $noExEligible ? 0 : intval($gym["park"]);
if (isset($gym["raid_pokemon_form"]) && $gym["raid_pokemon_form"] > 0) {
$forms = $this->data[$gym["raid_pokemon_id"]]["forms"];
Expand Down
5 changes: 3 additions & 2 deletions lib/RocketMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct()
$this->setCpMultiplier();
}

public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng, $tstamp = 0, $oSwLat = 0, $oSwLng = 0, $oNeLat = 0, $oNeLng = 0, $encId = 0)
{
global $db;
$conds = array();
Expand Down Expand Up @@ -93,7 +93,7 @@ public function get_active($eids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRa
return $this->query_active($select, $conds, $params, $encSql);
}

public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
public function get_active_by_id($ids, $minIv, $minLevel, $exMinIv, $bigKarp, $tinyRat, $seenType, $despawnTimeType, $gender, $swLat, $swLng, $neLat, $neLng)
{
global $db;
$conds = array();
Expand Down Expand Up @@ -505,6 +505,7 @@ public function query_gyms($conds, $params, $raids, $gyms, $rbeids, $reeids)
$gym["raid_start"] = $gym["raid_start"] * 1000;
$gym["raid_end"] = $gym["raid_end"] * 1000;
$gym["park"] = $noExEligible ? 0 : intval($gym["park"]);
$gym["ar_scan_eligible"] = 0;
if (isset($gym["raid_pokemon_form"]) && $gym["raid_pokemon_form"] > 0) {
$forms = $this->data[$gym["raid_pokemon_id"]]["forms"];
foreach ($forms as $f => $v) {
Expand Down
Loading