public static function CheckForUpdateByBuild($BuildNumber, $Format = false)
 {
     $Versions = LauncherAPI::GetVersions();
     for ($i = 0; $i <= Text::ASearch($Versions, $BuildNumber); $i++) {
         unset($Versions[$i]);
     }
     if (empty($Versions)) {
         return false;
     } else {
         if ($Format) {
             return LauncherAPI::StringToVersion(end($Versions));
         } else {
             return end($Versions);
         }
     }
 }
Beispiel #2
0
         API::GenerateResponse(1404, true);
     } else {
         if (Text::IsRequestSet($_REQUEST, ['first_launch'])) {
             echo Text::SimpleJson(1201, 'status', LauncherAPI::StringToVersion(LauncherAPI::CheckForUpdate($_REQUEST['assembly_version'], false, true)));
         } else {
             $UpdateStatus = LauncherAPI::CheckForUpdate($_REQUEST['assembly_version'], true);
             if (!$UpdateStatus) {
                 echo Text::SimpleJson(1200, 'status', 'No Update Needed');
             } else {
                 echo Text::SimpleJson(1201, 'status', $UpdateStatus);
             }
         }
     }
     break;
 case 'get-latest-update':
     echo LauncherAPI::StringToVersion(LauncherAPI::LatestUpdate());
     break;
 case 'checkupdate-build':
     if (!Text::IsRequestSet($_REQUEST, ['last_build'])) {
         API::GenerateResponse(1404, true);
     } else {
         $UpdateStatus = LauncherAPI::CheckForUpdateByBuild($_REQUEST['last_build'], true);
         if (!$UpdateStatus) {
             echo Text::SimpleJson(1200, 'status', 'No Update Needed');
         } else {
             echo Text::SimpleJson(1201, 'status', $UpdateStatus);
         }
     }
     break;
 case 'downloadupdatelist':
     if (Text::IsRequestSet($_REQUEST, ['assembly_version', 'updating_to'])) {