定制 ogetit/ogetit 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ogetit/ogetit

最新稳定版本:v2.0.0

Composer 安装命令:

composer require ogetit/ogetit

包简介

OGetIt is a open source PHP library for handling the new OGame API as of version 6.

README 文档

README

#OGetIt

OGetIt is a open source library for handling the new OGame API as of version 6.

It handles everything from connecting with the API, parsing the API to advanced calculations to get detailed results.

##Supported features ###Reports

  • Combat
  • Harvest
  • Espionage
  • Missile

##How to use?

include('autoload.php'); //Or via Composer
$ogetit = new OGetIt($uni, $lang, $apikey);

//Get Combat report
$cr = $ogetit->getCombatReport($crkey);

//Get Harvest report
$rr = $ogetit->getHarvestReport($rrkey);

//Get Spy report
$sr = $ogetit->getSpyReport($srkey);

//Get Missile report
$mr = $ogetit->getMissileReport($mrkey);

###Examples ####Get attacker losses from combat report

$cr = $ogetit->getCombatReport($crkey);
$result = $cr->getCalculator()->getFinalResult();
$result->getAttackers()->getLosses();

####Get harvested metal from harvest report

$rr = $ogetit->getHarvestReport($rrkey);
$rr->getMetal();

####Get Astrophysics level from espionage report

$sr = $ogetit->getSpyReport($srkey);
$sr->getDefender()->getResearch()[Astrophysics::TYPE];

####Get defender losses from missile report

$mr = $ogetit->getMissileReport($mrkey);
$mr->getDefender()->getLosses();

##Requirements

  • PHP v5.4+ (64-bit)
  • PHP cURL (libcurl v7.10.5+)

##Exceptions

###cURL codes

http://curl.haxx.se/libcurl/c/libcurl-errors.html

###OGame API codes

OK = 1000;
INVALID_VERSION = 4000;
INVALID_API_KEY = 4001;
INVALID_API_KEY_EXPIRED = 4002;
INVALID_API_PERMISSION = 4003;
INVALID_PATH = 4004;
INTERNAL_ERROR = 5000;
INVALID_CR_ID = 6000;

##Contributing

If you want to contribute code please fork this repository and create a pull request to merge your changes. Your changes will be reviewed and merged afterwards if approved by the repository maintainers.

##License

GNU Lesser General Public License, version 2.1

统计信息

  • 总下载量: 228
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 26
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 26
  • Watchers: 8
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-2.1
  • 更新时间: 2015-07-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固