jleagle / battlenet-api-client

一个用于从Battle.net API获取信息的包

0.1.0 2015-11-27 23:55 UTC

This package is auto-updated.

Last update: 2024-09-09 13:48:13 UTC


README

Build Status (Scrutinizer) Code Quality (scrutinizer) Latest Stable Version Latest Unstable Version

一个用于从Battle.net API获取信息的包 (https://dev.battle.net/)

优点
  • 代码提示
  • 包含所有游戏API(暗黑破坏神3、星际争霸2和魔兽世界)
  • 包含认证账户和社区API,以及获取OAuth令牌的辅助函数

使用方法

使用您的游戏类实例化包,通过API密钥、服务器位置和响应区域传递

$warcraft = new Warcraft(
  $key,
  ServerLocations::EU,
  ResponseLocales::EN_GB
);

示例API调用

// Retrieve auction data
$auctions = $warcraft->getAuctions('outland');

// Retrieve realm list
$realms = $warcraft->getRealms();

// Retrieve achievement details
$achievement = $warcraft->getAchievement(2144);