-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Let’s go!
- Loading branch information
0 parents
commit 5da9bc7
Showing
252 changed files
with
7,155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* A single location to store configuration. | ||
*/ | ||
|
||
|
||
|
||
# EDIT ME PLEASE | ||
|
||
define('SYS_DB_NAME' ,''); // mysql db name | ||
define('SYS_DB_USER' ,''); // mysql username | ||
define('SYS_DB_PSWD' ,''); // mysql password | ||
define('SYS_DB_HOST' ,''); // mysql server name | ||
define('SYS_DB_PORT' ,3306); // mysql server port | ||
define('TIME_DELAY' ,'+ 2 HOURS'); // Time diff between u and GMT Time (eg: Brussels is + 2 HOURS from GMT) | ||
|
||
|
||
# Please, do not touch me, I'm fine ;) | ||
|
||
define('SYS_PATH' ,realpath(dirname(__FILE__))); // full path | ||
define('SYS_USESS_VAR' ,'usrSessVal'); // user session variable name | ||
define('SYS_DEVELOPMENT_MODE' , false); // debug mode | ||
define('HOST_URL' , $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['HTTP_HOST']); // Host | ||
|
||
|
||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<? | ||
|
||
|
||
// This file is loaded once every 24h by data the loader. | ||
// ------------------------------------------------------ | ||
|
||
|
||
$pokemons = json_decode($pokemon_file); | ||
|
||
$req = "SELECT pokemon_id, COUNT(1) as total FROM pokemon GROUP BY pokemon_id ORDER BY pokemon_id ASC"; | ||
$result = $mysqli->query($req); | ||
|
||
$total_pokemons = 0; | ||
|
||
while($data = $result->fetch_object()){ | ||
|
||
$pokemon_id = $data->pokemon_id; | ||
$total_pokemons = $total_pokemons + $data->total; | ||
|
||
$pokelist[$pokemon_id]['id'] = $pokemon_id; | ||
$pokelist[$pokemon_id]['total'] = $data->total; | ||
|
||
|
||
|
||
} | ||
|
||
|
||
foreach($pokelist as $pokemon){ | ||
|
||
$key = $pokemon['id']; | ||
|
||
$pourcent = ($pokemon['total']*100) / $total_pokemons; | ||
$arrondis = round($pourcent , 4); | ||
$pokelist[$key]['rate'] = $arrondis; | ||
|
||
|
||
// + 1 = Very common | ||
// + 0.25 = Common | ||
// + 0.05 = Rare | ||
// + 0.0001 = Mythic | ||
// Unseen | ||
|
||
if($arrondis >= 1){ | ||
|
||
$pokelist[$key]['status'] = 'Very common'; | ||
|
||
}elseif($arrondis >= 0.25){ | ||
|
||
$pokelist[$key]['status'] = 'Common'; | ||
|
||
}elseif($arrondis >= 0.05){ | ||
|
||
$pokelist[$key]['status'] = 'Rare'; | ||
|
||
}elseif($arrondis >= 0.0001){ | ||
|
||
$pokelist[$key]['status'] = 'Mythic'; | ||
|
||
}else{ | ||
|
||
$pokelist[$key]['status'] = 'Unseen'; | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
foreach($pokemons as $pokemon_id => $pokemon_data){ | ||
|
||
if(isset($pokelist[$pokemon_id])){ | ||
|
||
$pokemon_data->rarity = $pokelist[$pokemon_id]['status']; | ||
$pokemon_data->spawn_rate = $pokelist[$pokemon_id]['rate']; | ||
|
||
} | ||
else{ | ||
$pokemon_data->rarity = 'Unseen'; | ||
$pokemon_data->spawn_rate = 0.0000; | ||
|
||
} | ||
|
||
|
||
} | ||
|
||
$file_content = json_encode($pokemons); | ||
|
||
file_put_contents(SYS_PATH.'/core/json/pokelist_'.$lang.'.json', $file_content); | ||
|
||
|
||
?> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.