Skip to content

Commit

Permalink
Merge pull request #41 from sidelux/master
Browse files Browse the repository at this point in the history
Automatic download of updated json for operators, deleted 'extra' folder and added organizations for new operators
  • Loading branch information
Seems2Legit authored Feb 26, 2019
2 parents 654bc0e + 4d1b91d commit 3e08108
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
32 changes: 31 additions & 1 deletion Operators.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
<?php

$operators_string = '{"capitao":{"images":{"badge":"assets/images/badge-capitao.6603e417c1.png","figure":{"small":"assets/images/small-capitao.31c21fd075.png","large":"assets/images/large-capitao.984e75b759.png"},"mask":"assets/images/mask-capitao.f56d66af19.png"},"stats":{"pvp":"operatorpvp_capitao_lethaldartkills:2:8","pve":"operatorpve_capitao_lethaldartkills:2:8"},"index":"2:8","id":"capitao","category":"atk"},"zofia":{"images":{"badge":"assets/images/badge-zofia.2a892bf5dc.png","figure":{"small":"assets/images/small-zofia.28fa7ba766.png","large":"assets/images/large-zofia.f9f7568bc4.png"},"mask":"assets/images/mask-zofia.29e5102fef.png"},"stats":{"pvp":"operatorpvp_concussiongrenade_detonate:3:C","pve":"operatorpve_concussiongrenade_detonate:3:C"},"index":"3:C","id":"zofia","category":"atk"},"kaid":{"images":{"badge":"assets/images/badge-kaid.ae2bfa7a5b.png","figure":{"small":"assets/images/small-kaid.e38b6341ae.png","large":"assets/images/large-kaid.d801cd6fa4.png"},"mask":"assets/images/mask-kaid.e8bb20882b.png"},"stats":{"pvp":"operatorpvp_Kaid_Electroclaw_Hatches:3:11","pve":"operatorpve_Kaid_Electroclaw_Hatches:3:11"},"index":"3:11","id":"kaid","category":"def"},"castle":{"images":{"badge":"assets/images/badge-castle.378f8f4e24.png","figure":{"small":"assets/images/small-castle.cd963832fb.png","large":"assets/images/large-castle.6a1677f53f.png"},"mask":"assets/images/mask-castle.08abe353e2.png"},"stats":{"pvp":"operatorpvp_castle_kevlarbarricadedeployed:2:2","pve":"operatorpve_castle_kevlarbarricadedeployed:2:2"},"index":"2:2","id":"castle","category":"def"},"vigil":{"images":{"badge":"assets/images/badge-vigil.4db5385b08.png","figure":{"small":"assets/images/small-vigil.0a3f4bbb3b.png","large":"assets/images/large-vigil.00339c3468.png"},"mask":"assets/images/mask-vigil.8ef2f7017a.png"},"stats":{"pvp":"operatorpvp_attackerdrone_diminishedrealitymode:3:D","pve":"operatorpve_attackerdrone_diminishedrealitymode:3:D"},"index":"3:D","id":"vigil","category":"def"},"sledge":{"images":{"badge":"assets/images/badge-sledge.00141f9258.png","figure":{"small":"assets/images/small-sledge.9ade04d351.png","large":"assets/images/large-sledge.832f6c6b3c.png"},"mask":"assets/images/mask-sledge.08fa548b40.png"},"stats":{"pvp":"operatorpvp_sledge_hammerhole:4:1","pve":"operatorpve_sledge_hammerhole:4:1"},"index":"4:1","id":"sledge","category":"atk"},"clash":{"images":{"badge":"assets/images/badge-clash.133f243da3.png","figure":{"small":"assets/images/small-clash.5d0756a523.png","large":"assets/images/large-clash.fb3f6fb344.png"},"mask":"assets/images/mask-clash.118cccde64.png"},"stats":{"pvp":"operatorpvp_clash_sloweddown:3:10","pve":"operatorpve_clash_sloweddown:3:10"},"index":"3:10","id":"clash","category":"def"},"fuze":{"images":{"badge":"assets/images/badge-fuze.9e7e92226e.png","figure":{"small":"assets/images/small-fuze.279743fadb.png","large":"assets/images/large-fuze.5f8fb3ba84.png"},"mask":"assets/images/mask-fuze.090fe62680.png"},"stats":{"pvp":"operatorpvp_fuze_clusterchargekill:3:4","pve":"operatorpve_fuze_clusterchargekill:3:4"},"index":"3:4","id":"fuze","category":"atk"},"echo":{"images":{"badge":"assets/images/badge-echo.a77c7d7eb5.png","figure":{"small":"assets/images/small-echo.6c60bd2a15.png","large":"assets/images/large-echo.592cfb343c.png"},"mask":"assets/images/mask-echo.43fff69139.png"},"stats":{"pvp":"operatorpvp_echo_enemy_sonicburst_affected:3:9","pve":"operatorpve_echo_enemy_sonicburst_affected:3:9"},"index":"3:9","id":"echo","category":"def"},"thermite":{"images":{"badge":"assets/images/badge-thermite.9010fa3311.png","figure":{"small":"assets/images/small-thermite.f9441d1f1a.png","large":"assets/images/large-thermite.e973bb0498.png"},"mask":"assets/images/mask-thermite.a46a67f0b5.png"},"stats":{"pvp":"operatorpvp_thermite_reinforcementbreached:5:2","pve":"operatorpve_thermite_reinforcementbreached:5:2"},"index":"5:2","id":"thermite","category":"atk"},"tachanka":{"images":{"badge":"assets/images/badge-tachanka.ae7943f00d.png","figure":{"small":"assets/images/small-tachanka.4c41f39c84.png","large":"assets/images/large-tachanka.41caebce49.png"},"mask":"assets/images/mask-tachanka.a613ee385a.png"},"stats":{"pvp":"operatorpvp_tachanka_turretkill:5:4","pve":"operatorpve_tachanka_turretkill:5:4"},"index":"5:4","id":"tachanka","category":"def"},"blackbeard":{"images":{"badge":"assets/images/badge-blackbeard.fccd7e2c03.png","figure":{"small":"assets/images/small-blackbeard.cba9e22d86.png","large":"assets/images/large-blackbeard.2292a7911f.png"},"mask":"assets/images/mask-blackbeard.4dbca57284.png"},"stats":{"pvp":"operatorpvp_blackbeard_gunshieldblockdamage:2:7","pve":"operatorpve_blackbeard_gunshieldblockdamage:2:7"},"index":"2:7","id":"blackbeard","category":"atk"},"buck":{"images":{"badge":"assets/images/badge-buck.2fc3e09779.png","figure":{"small":"assets/images/small-buck.6b66cd57a3.png","large":"assets/images/large-buck.78712d24f8.png"},"mask":"assets/images/mask-buck.e9bc3630cf.png"},"stats":{"pvp":"operatorpvp_buck_kill:2:6","pve":"operatorpve_buck_kill:2:6"},"index":"2:6","id":"buck","category":"atk"},"frost":{"images":{"badge":"assets/images/badge-frost.e5362220a9.png","figure":{"small":"assets/images/small-frost.a7f18f5b86.png","large":"assets/images/large-frost.f4325d10e2.png"},"mask":"assets/images/mask-frost.51971e4dda.png"},"stats":{"pvp":"operatorpvp_frost_dbno:3:6","pve":"operatorpve_frost_beartrap_kill:3:6"},"index":"3:6","id":"frost","category":"def"},"caveira":{"images":{"badge":"assets/images/badge-caveira.757e9259e4.png","figure":{"small":"assets/images/small-caveira.f7bb7af3be.png","large":"assets/images/large-caveira.e4d82365c0.png"},"mask":"assets/images/mask-caveira.2971b2c5e0.png"},"stats":{"pvp":"operatorpvp_caveira_interrogations:3:8","pve":"operatorpve_caveira_aikilledinstealth:3:8"},"index":"3:8","id":"caveira","category":"def"},"ela":{"images":{"badge":"assets/images/badge-ela.63ec2d26e4.png","figure":{"small":"assets/images/small-ela.b8458c8473.png","large":"assets/images/large-ela.a50c192d00.png"},"mask":"assets/images/mask-ela.eba6e6df45.png"},"stats":{"pvp":"operatorpvp_concussionmine_detonate:2:C","pve":"operatorpve_concussionmine_detonate:2:C"},"index":"2:C","id":"ela","category":"def"},"thatcher":{"images":{"badge":"assets/images/badge-thatcher.b1cac8e7c0.png","figure":{"small":"assets/images/small-thatcher.df2b7de48d.png","large":"assets/images/large-thatcher.73132fcdbe.png"},"mask":"assets/images/mask-thatcher.b7c658b343.png"},"stats":{"pvp":"operatorpvp_thatcher_gadgetdestroywithemp:5:1","pve":"operatorpve_thatcher_gadgetdestroywithemp:5:1"},"index":"5:1","id":"thatcher","category":"atk"},"hibana":{"images":{"badge":"assets/images/badge-hibana.c2a8477d1b.png","figure":{"small":"assets/images/small-hibana.494345ca09.png","large":"assets/images/large-hibana.d3ceb7759e.png"},"mask":"assets/images/mask-hibana.b41fbe46f3.png"},"stats":{"pvp":"operatorpvp_hibana_detonate_projectile:2:9","pve":"operatorpve_hibana_detonate_projectile:2:9"},"index":"2:9","id":"hibana","category":"atk"},"kapkan":{"images":{"badge":"assets/images/badge-kapkan.562d0701e7.png","figure":{"small":"assets/images/small-kapkan.b796e6065e.png","large":"assets/images/large-kapkan.606a9fc0d3.png"},"mask":"assets/images/mask-kapkan.93f6064146.png"},"stats":{"pvp":"operatorpvp_kapkan_boobytrapkill:4:4","pve":"operatorpve_kapkan_boobytrapkill:4:4"},"index":"4:4","id":"kapkan","category":"def"},"maverick":{"images":{"badge":"assets/images/badge-maverick.7eab7c75e7.png","figure":{"small":"assets/images/small-maverick.9e685421f1.png","large":"assets/images/large-maverick.2676adff62.png"},"mask":"assets/images/mask-maverick.d7db4066f7.png"},"stats":{"pvp":"operatorpvp_maverick_wallbreached:2:10","pve":"operatorpve_maverick_wallbreached:2:10"},"index":"2:10","id":"maverick","category":"atk"},"twitch":{"images":{"badge":"assets/images/badge-twitch.83cbfa9789.png","figure":{"small":"assets/images/small-twitch.0421265dc4.png","large":"assets/images/large-twitch.84ad765cee.png"},"mask":"assets/images/mask-twitch.715147fcdf.png"},"stats":{"pvp":"operatorpvp_twitch_gadgetdestroybyshockdrone:4:3","pve":"operatorpve_twitch_gadgetdestroybyshockdrone:4:3"},"index":"4:3","id":"twitch","category":"atk"},"bandit":{"images":{"badge":"assets/images/badge-bandit.385144d970.png","figure":{"small":"assets/images/small-bandit.113ec809d3.png","large":"assets/images/large-bandit.463ee8297b.png"},"mask":"assets/images/mask-bandit.8879a650ec.png"},"stats":{"pvp":"operatorpvp_bandit_batterykill:5:5","pve":"operatorpve_bandit_batterykill:5:5"},"index":"5:5","id":"bandit","category":"def"},"dokkaebi":{"images":{"badge":"assets/images/badge-dokkaebi.2f83a34f88.png","figure":{"small":"assets/images/small-dokkaebi.495c615562.png","large":"assets/images/large-dokkaebi.17504ff442.png"},"mask":"assets/images/mask-dokkaebi.869d844585.png"},"stats":{"pvp":"operatorpvp_phoneshacked:2:D","pve":"operatorpve_phoneshacked:2:D"},"index":"2:D","id":"dokkaebi","category":"atk"},"smoke":{"images":{"badge":"assets/images/badge-smoke.874e98880d.png","figure":{"small":"assets/images/small-smoke.2726e30872.png","large":"assets/images/large-smoke.1bf9006654.png"},"mask":"assets/images/mask-smoke.c84491688f.png"},"stats":{"pvp":"operatorpvp_smoke_poisongaskill:2:1","pve":"operatorpve_smoke_poisongaskill:2:1"},"index":"2:1","id":"smoke","category":"def"},"iq":{"images":{"badge":"assets/images/badge-iq.b1acee1a4c.png","figure":{"small":"assets/images/small-iq.0d7885fbe8.png","large":"assets/images/large-iq.22b58f3bd4.png"},"mask":"assets/images/mask-iq.855499c7b3.png"},"stats":{"pvp":"operatorpvp_iq_gadgetspotbyef:3:5","pve":"operatorpve_iq_gadgetspotbyef:3:5"},"index":"3:5","id":"iq","category":"atk"},"mute":{"images":{"badge":"assets/images/badge-mute.3e4f2b0170.png","figure":{"small":"assets/images/small-mute.96a6566576.png","large":"assets/images/large-mute.ae51429f4f.png"},"mask":"assets/images/mask-mute.d9917f856f.png"},"stats":{"pvp":"operatorpvp_mute_gadgetjammed:3:1","pve":"operatorpve_mute_gadgetjammed:3:1"},"index":"3:1","id":"mute","category":"def"},"rook":{"images":{"badge":"assets/images/badge-rook.eb954a4e67.png","figure":{"small":"assets/images/small-rook.55b6bc4c7e.png","large":"assets/images/large-rook.eed2777a17.png"},"mask":"assets/images/mask-rook.be9b0ac99a.png"},"stats":{"pvp":"operatorpvp_rook_armortakenteammate:3:3","pve":"operatorpve_rook_armortakenteammate:3:3"},"index":"3:3","id":"rook","category":"def"},"alibi":{"images":{"badge":"assets/images/badge-alibi.7fba8d3300.png","figure":{"small":"assets/images/small-alibi.9b68753a5e.png","large":"assets/images/large-alibi.3cf80a66b1.png"},"mask":"assets/images/mask-alibi.2f8c8bb326.png"},"stats":{"pvp":"operatorpvp_deceiver_revealedattackers:3:F","pve":"operatorpve_deceiver_revealedattackers:3:F"},"index":"3:F","id":"alibi","category":"def"},"jackal":{"images":{"badge":"assets/images/badge-jackal.0326ca29ca.png","figure":{"small":"assets/images/small-jackal.8c3e419115.png","large":"assets/images/large-jackal.e7ec96e645.png"},"mask":"assets/images/mask-jackal.b183ae5448.png"},"stats":{"pvp":"operatorpvp_cazador_assist_kill:2:A","pve":"operatorpve_cazador_assist_kill:2:A"},"index":"2:A","id":"jackal","category":"atk"},"nomad":{"images":{"badge":"assets/images/badge-nomad.dbd9a315fa.png","figure":{"small":"assets/images/small-nomad.50642fb12f.png","large":"assets/images/large-nomad.ec87176490.png"},"mask":"assets/images/mask-nomad.fdb16c874b.png"},"stats":{"pvp":"operatorpvp_Nomad_Assist:2:11","pve":"operatorpve_Nomad_Assist:2:11"},"index":"2:11","id":"nomad","category":"atk"},"glaz":{"images":{"badge":"assets/images/badge-glaz.43dd3bdfbc.png","figure":{"small":"assets/images/small-glaz.a89bfa89dc.png","large":"assets/images/large-glaz.8cd96a16f8.png"},"mask":"assets/images/mask-glaz.f3a01dea74.png"},"stats":{"pvp":"operatorpvp_glaz_sniperkill:2:4","pve":"operatorpve_glaz_sniperkill:2:4"},"index":"2:4","id":"glaz","category":"atk"},"lion":{"images":{"badge":"assets/images/badge-lion.696370754d.png","figure":{"small":"assets/images/small-lion.d9a0faed93.png","large":"assets/images/large-lion.68296c0e60.png"},"mask":"assets/images/mask-lion.488ea9cca4.png"},"stats":{"pvp":"operatorpvp_tagger_tagdevice_spot:3:E","pve":"operatorpve_tagger_tagdevice_spot:3:E"},"index":"3:E","id":"lion","category":"atk"},"finka":{"images":{"badge":"assets/images/badge-finka.71d3a2432f.png","figure":{"small":"assets/images/small-finka.53104c1345.png","large":"assets/images/large-finka.46fb7c595e.png"},"mask":"assets/images/mask-finka.82e49f1a08.png"},"stats":{"pvp":"operatorpvp_rush_adrenalinerush:4:E","pve":"operatorpve_rush_adrenalinerush:4:E"},"index":"4:E","id":"finka","category":"atk"},"valkyrie":{"images":{"badge":"assets/images/badge-valkyrie.f87cb6bdc2.png","figure":{"small":"assets/images/small-valkyrie.b2df5baedd.png","large":"assets/images/large-valkyrie.c1f143fb3c.png"},"mask":"assets/images/mask-valkyrie.c93357698e.png"},"stats":{"pvp":"operatorpvp_valkyrie_camdeployed:3:7","pve":"operatorpve_valkyrie_camdeployed:3:7"},"index":"3:7","id":"valkyrie","category":"def"},"ying":{"images":{"badge":"assets/images/badge-ying.b88be612bd.png","figure":{"small":"assets/images/small-ying.6bec33ffd1.png","large":"assets/images/large-ying.ce15b076b7.png"},"mask":"assets/images/mask-ying.0e91da74eb.png"},"stats":{"pvp":"operatorpvp_dazzler_gadget_detonate:2:B","pve":"operatorpve_dazzler_gadget_detonate:2:B"},"index":"2:B","id":"ying","category":"atk"},"blitz":{"images":{"badge":"assets/images/badge-blitz.cd45df08f6.png","figure":{"small":"assets/images/small-blitz.0553bf11e0.png","large":"assets/images/large-blitz.2e74d4b8ac.png"},"mask":"assets/images/mask-blitz.bcde0a3313.png"},"stats":{"pvp":"operatorpvp_blitz_flashedenemy:2:5","pve":"operatorpve_blitz_flashedenemy:2:5"},"index":"2:5","id":"blitz","category":"atk"},"ash":{"images":{"badge":"assets/images/badge-ash.16913d82e3.png","figure":{"small":"assets/images/small-ash.692668cc8a.png","large":"assets/images/large-ash.9d28aebe23.png"},"mask":"assets/images/mask-ash.ad5c86d093.png"},"stats":{"pvp":"operatorpvp_ash_bonfirewallbreached:3:2","pve":"operatorpve_ash_bonfirewallbreached:3:2"},"index":"3:2","id":"ash","category":"atk"},"pulse":{"images":{"badge":"assets/images/badge-pulse.9de627c54e.png","figure":{"small":"assets/images/small-pulse.927fa707a4.png","large":"assets/images/large-pulse.30ab3682ce.png"},"mask":"assets/images/mask-pulse.0b2985b7ea.png"},"stats":{"pvp":"operatorpvp_pulse_heartbeatspot:4:2","pve":"operatorpve_pulse_heartbeatspot:4:2"},"index":"4:2","id":"pulse","category":"def"},"mira":{"images":{"badge":"assets/images/badge-mira.22fb72a5cc.png","figure":{"small":"assets/images/small-mira.4196bc073d.png","large":"assets/images/large-mira.0c9e3bd8d8.png"},"mask":"assets/images/mask-mira.3d59212129.png"},"stats":{"pvp":"operatorpvp_black_mirror_gadget_deployed:3:A","pve":"operatorpve_black_mirror_gadget_deployed:3:A"},"index":"3:A","id":"mira","category":"def"},"doc":{"images":{"badge":"assets/images/badge-doc.29fe751bea.png","figure":{"small":"assets/images/small-doc.2cc6664a0e.png","large":"assets/images/large-doc.0b0321eb2f.png"},"mask":"assets/images/mask-doc.951579fcec.png"},"stats":{"pvp":"operatorpvp_doc_teammaterevive:2:3","pve":"operatorpve_doc_teammaterevive:2:3"},"index":"2:3","id":"doc","category":"def"},"montagne":{"images":{"badge":"assets/images/badge-montagne.2078ee847a.png","figure":{"small":"assets/images/small-montagne.0bc5133625.png","large":"assets/images/large-montagne.d48591cc9f.png"},"mask":"assets/images/mask-montagne.b392c01592.png"},"stats":{"pvp":"operatorpvp_montagne_shieldblockdamage:5:3","pve":"operatorpve_montagne_shieldblockdamage:5:3"},"index":"5:3","id":"montagne","category":"atk"},"maestro":{"images":{"badge":"assets/images/badge-maestro.b6cf7905ed.png","figure":{"small":"assets/images/small-maestro.7f3f2bcb8b.png","large":"assets/images/large-maestro.fc1e1753fc.png"},"mask":"assets/images/mask-maestro.210c8915d0.png"},"stats":{"pvp":"operatorpvp_barrage_killswithturret:2:F","pve":"operatorpve_barrage_killswithturret:2:F"},"index":"2:F","id":"maestro","category":"def"},"jager":{"images":{"badge":"assets/images/badge-jager.600b2773be.png","figure":{"small":"assets/images/small-jager.bc9087b7b2.png","large":"assets/images/large-jager.edd9f74950.png"},"mask":"assets/images/mask-jager.58cba6d598.png"},"stats":{"pvp":"operatorpvp_jager_gadgetdestroybycatcher:4:5","pve":"operatorpve_jager_gadgetdestroybycatcher:4:5"},"index":"4:5","id":"jager","category":"def"},"lesion":{"images":{"badge":"assets/images/badge-lesion.07c3d352ca.png","figure":{"small":"assets/images/small-lesion.8165c6b9a4.png","large":"assets/images/large-lesion.d48d6d3321.png"},"mask":"assets/images/mask-lesion.576ad9e46b.png"},"stats":{"pvp":"operatorpvp_caltrop_enemy_affected:3:B","pve":"operatorpve_caltrop_enemy_affected:3:B"},"index":"3:B","id":"lesion","category":"def"}}';
$arrContextOptions = array(
"ssl" => array(
"verify_peer" => false,
"verify_peer_name" => false,
),
);

$ubi_page = file_get_contents("https://game-rainbow6.ubi.com/it-it/home", false, stream_context_create($arrContextOptions));
preg_match("/main(.+)js/", $ubi_page, $matches);
$mainjs = file_get_contents("https://game-rainbow6.ubi.com/assets/scripts/main" . $matches[1] . "js", false, stream_context_create($arrContextOptions));
preg_match("/assets\/data\/operators(.+?)json/", $mainjs, $matches);
$operators_string = file_get_contents("https://game-rainbow6.ubi.com/assets/data/operators" . $matches[1] . "json", false, stream_context_create($arrContextOptions));

$json = json_decode($operators_string, true);
$arr_result = new \stdClass;
foreach ($json as $name => $operator) {
$arr_result->$name = new stdClass;
$arr_result->$name->images = new stdClass;
$arr_result->$name->stats = new stdClass;

$arr_result->$name->id = $operator["id"];
$arr_result->$name->index = $operator["index"];
$arr_result->$name->category = $operator["category"];
$arr_result->$name->images->badge = $operator["badge"];
$arr_result->$name->images->figure = $operator["figure"];
$arr_result->$name->images->mask = $operator["mask"];
$arr_result->$name->stats->pvp = $operator["uniqueStatistic"]["pvp"]["statisticId"];
$arr_result->$name->stats->pve = $operator["uniqueStatistic"]["pve"]["statisticId"];
}

$operators_string = json_encode($arr_result, JSON_UNESCAPED_SLASHES);

$operators_string = str_replace("assets/", "https://game-rainbow6.ubi.com/assets/", $operators_string);
$operators = json_decode($operators_string,true);
Expand Down
Binary file removed extras/OperatorsGenerator.jar
Binary file not shown.
1 change: 0 additions & 1 deletion extras/updateOperators.bat

This file was deleted.

1 change: 0 additions & 1 deletion extras/updateOperators.sh

This file was deleted.

Loading

0 comments on commit 3e08108

Please sign in to comment.