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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ logs/
cfg.js
.save
npm-debug.*
.idea
7 changes: 7 additions & 0 deletions cfg.js.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ export default {
DEBUG_DUMP_TRAFFIC: true,
DEBUG_LOG_REQUESTS: true,

//Populate map with Pokemon
RANDOM_SPAWNS_AT_PLAYERS: true,
RADIUS: 2, //In kilometers
RARITY_RATE: 1.5, //The higher, the less likely rare Pokemon will appear
NUMBER_SPAWNs: 500,
POKEMON_PER_SPAWN: 1,

// Choose a database type
DATABASE_TYPE: "MYSQL",

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
"node-pogo-protos": "^1.4.0",
"pcrypt": "git+https://github.com/laverdet/pcrypt.git",
"pogo-asset-downloader": "^0.3.1",
"pokerare": "^0.1.1",
"pogo-populate": "^0.0.8",
"pokemongo-protobuf": "^1.11.0",
"pokerare": "^0.1.1",
"prompt": "^1.0.0",
"s2-geometry": "^1.2.9",
"url": "^0.11.0"
Expand Down
10 changes: 10 additions & 0 deletions src/commands.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import print from "./print";
import CFG from "../cfg";
import Populate from "pogo-populate";

let populate = new Populate(CFG);
export function saveAllPlayers() {


if (this.world.players.length > 0) {
for (let player of this.world.players) {
CFG.RANDOM_SPAWNS_AT_PLAYERS && populate.createRandomPokemon(player.latitude, player.longitude).then((res, rej)=>{
if(rej){print(rej, 31)}
else {
print(`(${player.username})` + res, 33)
}
})
this.savePlayer(player);
};
}
Expand Down