diff --git a/Operators.php b/Operators.php index 44124b0..5d06519 100644 --- a/Operators.php +++ b/Operators.php @@ -1,6 +1,36 @@ 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); diff --git a/extras/OperatorsGenerator.jar b/extras/OperatorsGenerator.jar deleted file mode 100644 index ef97680..0000000 Binary files a/extras/OperatorsGenerator.jar and /dev/null differ diff --git a/extras/updateOperators.bat b/extras/updateOperators.bat deleted file mode 100644 index cbc4103..0000000 --- a/extras/updateOperators.bat +++ /dev/null @@ -1 +0,0 @@ -java -jar OperatorsGenerator.jar \ No newline at end of file diff --git a/extras/updateOperators.sh b/extras/updateOperators.sh deleted file mode 100755 index cbc4103..0000000 --- a/extras/updateOperators.sh +++ /dev/null @@ -1 +0,0 @@ -java -jar OperatorsGenerator.jar \ No newline at end of file diff --git a/getOperators.php b/getOperators.php index b50b314..7ffc979 100644 --- a/getOperators.php +++ b/getOperators.php @@ -120,7 +120,7 @@ function printID($name) } $operatorArray = array(); -$operatorOrg = json_decode('{"zofia":{"name":"Zofia","organisation":"GROM"},"castle":{"name":"Castle","organisation":"FBI SWAT"},"jager":{"name":"Jäger","organisation":"GSG 9"},"vigil":{"name":"Vigil","organisation":"SMB"},"sledge":{"name":"Sledge","organisation":"SAS"},"echo":{"name":"Echo","organisation":"SAT"},"fuze":{"name":"Fuze","organisation":"Spetnaz"},"thermite":{"name":"Thermite","organisation":"FBI SWAT"},"blackbeard":{"name":"Blackbeard","organisation":"Navy Seal"},"buck":{"name":"Buck","organisation":"JTF2"},"frost":{"name":"Frost","organisation":"JTF2"},"caveira":{"name":"Caveira","organisation":"Bope"},"ela":{"name":"Ela","organisation":"GROM"},"capitao":{"name":"Capitão","organisation":"BOPE"},"hibana":{"name":"Hibana","organisation":"SAT"},"thatcher":{"name":"Thatcher","organisation":"SAS"},"tachanka":{"name":"Tachanka","organisation":"Spetnaz"},"kapkan":{"name":"Kapkan","organisation":"Spetnaz"},"twitch":{"name":"Twitch","organisation":"GIGN"},"bandit":{"name":"Bandit","organisation":"GSG 9"},"dokkaebi":{"name":"Dokkaebi","organisation":"SMB"},"smoke":{"name":"Smoke","organisation":"SAS"},"iq":{"name":"IQ","organisation":"GSG 9"},"mute":{"name":"Mute","organisation":"SAS"},"alibi":{"name":"Alibi","organisation":"GIS"},"rook":{"name":"Rook","organisation":"GIGN"},"jackal":{"name":"Jackal","organisation":"GEO"},"lion":{"name":"Lion","organisation":"CBRN"},"glaz":{"name":"Glaz","organisation":"Spetnaz"},"finka":{"name":"Finka","organisation":"CBRN"},"valkyrie":{"name":"Valkyrie","organisation":"Navy Seal"},"ying":{"name":"Ying","organisation":"SDU"},"blitz":{"name":"Blitz","organisation":"GSG 9"},"ash":{"name":"Ash","organisation":"FBI SWAT"},"mira":{"name":"Mira","organisation":"GEO"},"pulse":{"name":"Pulse","organisation":"FBI SWAT"},"doc":{"name":"Doc","organisation":"GIGN"},"montagne":{"name":"Montagne","organisation":"GIGN"},"maestro":{"name":"Maestro","organisation":"GIS"},"lesion":{"name":"Lesion","organisation":"SDU"},"maverick":{"name":"Maverick","organisation":"GSUTR"},"clash":{"name":"Clash","organisation":"GSUTR"},"nomad":{"name":"Nomad","organisation":"GIGR"},"kaid":{"name":"Kaid","organisation":"GIGR"}}', true); +$operatorOrg = json_decode('{"zofia":{"name":"Zofia","organisation":"GROM"},"castle":{"name":"Castle","organisation":"FBI SWAT"},"jager":{"name":"Jäger","organisation":"GSG 9"},"vigil":{"name":"Vigil","organisation":"SMB"},"sledge":{"name":"Sledge","organisation":"SAS"},"echo":{"name":"Echo","organisation":"SAT"},"fuze":{"name":"Fuze","organisation":"Spetnaz"},"thermite":{"name":"Thermite","organisation":"FBI SWAT"},"blackbeard":{"name":"Blackbeard","organisation":"Navy Seal"},"buck":{"name":"Buck","organisation":"JTF2"},"frost":{"name":"Frost","organisation":"JTF2"},"caveira":{"name":"Caveira","organisation":"Bope"},"ela":{"name":"Ela","organisation":"GROM"},"capitao":{"name":"Capitão","organisation":"BOPE"},"hibana":{"name":"Hibana","organisation":"SAT"},"thatcher":{"name":"Thatcher","organisation":"SAS"},"tachanka":{"name":"Tachanka","organisation":"Spetnaz"},"kapkan":{"name":"Kapkan","organisation":"Spetnaz"},"twitch":{"name":"Twitch","organisation":"GIGN"},"bandit":{"name":"Bandit","organisation":"GSG 9"},"dokkaebi":{"name":"Dokkaebi","organisation":"SMB"},"smoke":{"name":"Smoke","organisation":"SAS"},"iq":{"name":"IQ","organisation":"GSG 9"},"mute":{"name":"Mute","organisation":"SAS"},"alibi":{"name":"Alibi","organisation":"GIS"},"rook":{"name":"Rook","organisation":"GIGN"},"jackal":{"name":"Jackal","organisation":"GEO"},"lion":{"name":"Lion","organisation":"CBRN"},"glaz":{"name":"Glaz","organisation":"Spetnaz"},"finka":{"name":"Finka","organisation":"CBRN"},"valkyrie":{"name":"Valkyrie","organisation":"Navy Seal"},"ying":{"name":"Ying","organisation":"SDU"},"blitz":{"name":"Blitz","organisation":"GSG 9"},"ash":{"name":"Ash","organisation":"FBI SWAT"},"mira":{"name":"Mira","organisation":"GEO"},"pulse":{"name":"Pulse","organisation":"FBI SWAT"},"doc":{"name":"Doc","organisation":"GIGN"},"montagne":{"name":"Montagne","organisation":"GIGN"},"maestro":{"name":"Maestro","organisation":"GIS"},"lesion":{"name":"Lesion","organisation":"SDU"},"maverick":{"name":"Maverick","organisation":"GSUTR"},"clash":{"name":"Clash","organisation":"GSUTR"},"nomad":{"name":"Nomad","organisation":"GIGR"},"kaid":{"name":"Kaid","organisation":"GIGR"},"mozzie":{"name":"Mozzie","organisation":"SASR"},"gridlock":{"name":"Gridlock","organisation":"SASR"}}', true); foreach($operators as $operator=>$info) { $operatorArray[$operator] = array();