Пример #1
0
 public static function GetResetStatus($JSONP)
 {
     $WorldStates = [20001, 20002, 20003, 20006, 20007];
     $Response = [];
     $Statement = parent::$CharConnection->prepare('SELECT * from worldstates WHERE entry IN(20001, 20002, 20003, 20006, 20007);');
     $Statement->execute();
     $Result = $Statement->fetchAll(PDO::FETCH_ASSOC);
     if (Database::IsEmpty($Statement)) {
         foreach ($WorldStates as $ID) {
             $Response[] = [ArmoryAPI::GetWorldstateByID($ID) => '0'];
         }
     } else {
         foreach ($Result as $WS) {
             foreach ($WorldStates as $ID) {
                 if ($ID == $WS['entry']) {
                     $Response[] = [ArmoryAPI::GetWorldstateByID($ID) => $WS['value']];
                     break;
                 } else {
                     $Response[] = [ArmoryAPI::GetWorldstateByID($WS['entry']) => '0'];
                     break;
                 }
             }
         }
     }
     return parent::Encode($Response, $JSONP, "wsrt");
 }
Пример #2
0
             break;
     }
     break;
 case 'achievement':
     API::EnableAPIExtension('Achievement');
     switch ($_REQUEST['method']) {
         case 'simple':
             AchievementAPI::GetSimpleAchievement($_REQUEST['datatype'], $_REQUEST['jsonp']);
             break;
     }
     break;
 case 'armory':
     API::EnableAPIExtension('Armory');
     switch ($_REQUEST['method']) {
         case 'wsrt':
             ArmoryAPI::GetResetStatus($_REQUEST['jsonp']);
             break;
     }
     break;
 case 'auction':
     API::GenerateResponse(501, true);
     break;
 case 'character':
     API::GenerateResponse(501, true);
     break;
 case 'item':
     API::EnableAPIExtension('Item');
     switch ($_REQUEST['method']) {
         case 'single':
             ItemAPI::GetSingleItem($_REQUEST['datatype'], $_REQUEST['jsonp']);
             break;