当前位置: 首页>>代码示例>>PHP>>正文


PHP API::GenerateResponse方法代码示例

本文整理汇总了PHP中API::GenerateResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP API::GenerateResponse方法的具体用法?PHP API::GenerateResponse怎么用?PHP API::GenerateResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在API的用法示例。


在下文中一共展示了API::GenerateResponse方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: GetSimpleSpell

 public static function GetSimpleSpell($SpellID, $JSONP)
 {
     $SpellInfo = Spells::SpellInfo($SpellID);
     if ($SpellInfo) {
         $SpellData = Text::RemapArray($SpellInfo, ['SpellID', 'Name', 'Description', 'icon'], ['id', 'name', 'description', 'icon']);
         parent::Encode($SpellData, $JSONP);
     } else {
         parent::GenerateResponse(404, true);
     }
 }
开发者ID:anonymous33rus,项目名称:FreedomCore,代码行数:10,代码来源:Spell.FreedomCoreAPI.php

示例2: GetSimpleAchievement

 public static function GetSimpleAchievement($AchievementID, $JSONP)
 {
     $Statement = parent::$DBConnection->prepare('SELECT a.id, a.faction as factionID, a.name_loc0 as title, a.description_loc0 as description, a.points, a.reward_loc0 as reward, LOWER(si.iconname) as icon FROM freedomcore_achievement a LEFT JOIN freedomcore_spellicons si ON a.icon = si.id WHERE a.id = :aid');
     $Statement->bindParam(':aid', $AchievementID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     if ($Statement->rowCount() > 0) {
         $GetAchievementCriterias = AchievementAPI::GetAchievementCriteria($AchievementID);
         foreach ($GetAchievementCriterias as $Criteria) {
             $Result['criteria'][] = $Criteria;
         }
         return parent::Encode($Result, $JSONP);
     } else {
         return parent::GenerateResponse(404, true);
     }
 }
开发者ID:Expecto,项目名称:FreedomCore,代码行数:16,代码来源:Achievement.FreedomCoreAPI.php

示例3: switch

                                DataAPI::CharacterClasses($_REQUEST['jsonp']);
                                break;
                            default:
                                API::GenerateResponse(403, true);
                                break;
                        }
                        break;
                    case 'item':
                        switch ($_REQUEST['datatype']) {
                            case 'classes':
                                DataAPI::ItemClasses($_REQUEST['jsonp']);
                                break;
                            default:
                                API::GenerateResponse(403, true);
                                break;
                        }
                        break;
                    default:
                        API::GenerateResponse(403, true);
                        break;
                }
                break;
            default:
                header('Content-Type: text/html; charset=utf-8');
                $Smarty->translate('Developer');
                $Smarty->assign('Page', Page::Info('dev', array('bodycss' => '', 'pagetitle' => $Smarty->GetConfigVars('Developer_Page_Title') . ' - ')));
                $Smarty->display('developer');
                break;
        }
        break;
}
开发者ID:kotishe,项目名称:FreedomCore,代码行数:31,代码来源:api.php

示例4: VerifyRequestEligibility

 public static function VerifyRequestEligibility($SecondsPerRequest)
 {
     if (!isset($_SESSION['last_request_time'])) {
         $_SESSION['last_request_time'] = $SecondsPerRequest;
         Session::UpdateSession($_SESSION);
     }
     if ($_SESSION['last_request_time'] && time() - $_SESSION['last_request_time'] > $SecondsPerRequest) {
         $_SESSION['last_request_time'] = time();
         Session::UpdateSession($_SESSION);
     } else {
         API::GenerateResponse(429, true);
     }
 }
开发者ID:Expecto,项目名称:FreedomCore,代码行数:13,代码来源:API.FreedomCore.php

示例5: GetItemSet

 public static function GetItemSet($SetID, $JSONP)
 {
     $Statement = parent::$DBConnection->prepare('SELECT * FROM freedomcore_itemset WHERE itemsetID = :setid');
     $Statement->bindParam(':setid', $SetID);
     $Statement->execute();
     $Result = $Statement->fetch(PDO::FETCH_ASSOC);
     if ($Statement->rowCount() > 0) {
         $FinalArray = [];
         $FinalArray['id'] = $Result['itemsetID'];
         $FinalArray['name'] = $Result['name_loc0'];
         $i = 8;
         while ($i > 0) {
             if ($Result['bonus' . $i] != 0) {
                 $FinalArray['setBonuses'][] = ['description' => Spells::SpellInfo($Result['spell' . $i])['Description'], 'threshold' => $Result['bonus' . $i]];
             }
             $i--;
         }
         $SetItems = [];
         for ($i = 1; $i <= 10; $i++) {
             if ($Result['item' . $i] != 0) {
                 $SetItems[] = $Result['item' . $i];
             }
         }
         $FinalArray['items'] = $SetItems;
         parent::Encode($FinalArray, $JSONP);
     } else {
         parent::GenerateResponse(404, true);
     }
 }
开发者ID:anonymous33rus,项目名称:FreedomCore,代码行数:29,代码来源:Item.FreedomCoreAPI.php


注:本文中的API::GenerateResponse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。