uldisn/sharkscope

用于操作SharkScope API的PHP库

1.0.17 2023-03-04 05:53 UTC

This package is auto-updated.

Last update: 2024-09-06 08:37:04 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License Code Climate

PHP SharkScope API

针对 https://www.sharkscope.com/

特性

  • 创建/删除组
  • 将玩家添加到组中
  • 获取组统计信息

安装

php composer.phar require uldisn/sharkscope dev-master

用法

        $domain = 'http://www.sharkscope.com';
        $userName = '???????????????';
        $password = '??????????';
        $appKey = '??????????????';
        $appName = '???????';

        $client = new SharcScopeClient($domain, $appName, $userName, $password, $appKey);
        $this->client->setLogging('shark-log',$username,'player statistic');
        
        if($client->requestGroupList()) {
            $groupList = $this->client->responseData;
        }else{
            $this->out('Invalid response from requestGroupList');
            print_r($this->client->respError);
            die();
        }
                    
        $playerStatistic = new ResponseHelper($groupList);
        $groupsPlayers = ($playerStatistic->findGroupPlayersAll('PREFIX_', '_SUFIX'));
        
        $from = new \DateTime($pgLimit->start_date);
        $to = new \DateTime($pgLimit->end_date);
        $filter = FilterHelper::createDateFromToValue($from, $to);        
                    
                    
        if(!$client->removePlayerFromGroup($groupName,$network,$player,$filter)){
            $this->out('Invalid response from removePlayerFromGroup');
            if($client->respError) {
                print_r($client->respError);
            }else {
                print_r($client->respHeader);
            }

        }                    
                    

变更日志

  • 1.0.0 (2017年4月25日) - 工作正常!
  • 1.0.1 (2017年4月27日) - 在 FilterHelper 中实现了 SharkScope 结束日期
  • 1.0.2 (2017年4月27日) - 实现了 DateTime 的 GMT 时区
  • 1.0.3 (2017年4月29日) - 向 FilterHelper 添加了 dateActualYear() 方法
  • 1.0.4 (2017年4月30日) - 解决了 GMT 问题
  • 1.0.8 (2021年3月1日) - 添加了 requestActiveTournaments() 方法
  • 1.0.13 (2022年11月16日) - 添加了 deleteGroup() 方法
  • 1.0.14 (2022年11月22日) - 添加了 requestUser() 方法
  • 1.0.15 (2023年2月22日) - 添加了日志记录功能
  • 1.0.16 (2023年3月3日) - 添加了 requestGroupListByFullName() 方法