villermen/runescape-lookup-commons
Composer 安装命令:
composer require villermen/runescape-lookup-commons
包简介
A PHP library containing RuneScape lookup components.
README 文档
README
A PHP library containing RuneScape lookup components.
Features
- Fetch and compare RS3 and OSRS high scores.
- Alternatively for RS3, RuneMetrics can be used to obtain high scores and activity feed together. It may contain high score data even for non-member players, but lacks activity high scores.
- Fetch player activity feed via RuneMetrics or Adventurer's log.
- Calculate combat levels and virtual skill levels.
Installation
composer require villermen/runescape-lookup-commons
Usage
Create or obtain an instance of Player and use it with the PlayerDataFetcher service to obtain high scores and other
information.
use Villermen\RuneScape\HighScore\HighScoreSkill; use Villermen\RuneScape\HighScore\OsrsSkill; use Villermen\RuneScape\HighScore\Rs3HighScore; use Villermen\RuneScape\HighScore\Rs3Skill; use Villermen\RuneScape\Player; use Villermen\RuneScape\Service\PlayerDataFetcher; $fetcher = new PlayerDataFetcher(); // You can optionally provide your own HTTP client. $player = new Player('playername'); $rs3HighScore = $fetcher->fetchIndexLite($player, oldSchool: false); $mining = $rs3HighScore->getSkill(Rs3Skill::MINING); $mining->level; // 110 $mining->getVirtualLevel(); // 123 $mining->getXpToNextLevel(); // 1231231 $rs3HighScore->getSkill(Rs3Skill::NECROMANCY)->xp // null $rs3HighScore->getSkill(Rs3Skill::TOTAL)->rank; // 1200000 $rs3HighScore->getCombatLevel(includeSummoning: true); // 138 $osrsHighScore = $fetcher->fetchIndexLite($player, oldSchool: true); $osrsHighScore->getSkill(OsrsSkill::HITPOINTS)->getLevelOrMinimum(); // 10 $highScore1 = new Rs3HighScore(skills: [new HighScoreSkill( skill: Rs3Skill::ATTACK, rank: null, level: 24, xp: 7420, )], activities: []); $highScore2 = new Rs3HighScore(skills: [new HighScoreSkill( skill: Rs3Skill::ATTACK, rank: 2000000, level: 25, xp: 7840, )], activities: []); $comparison = $highScore1->compareTo($highScore2); $comparison->getLevelDifference(Rs3Skill::ATTACK); // -1 $comparison->getRankDifference(Rs3Skill::ATTACK); // null $comparison->getXpDifference(Rs3Skill::ATTACK); // 420 $runeMetrics = $fetcher->fetchRuneMetrics($player); $runeMetrics->displayName; // "PlayerName" $runeMetrics->highScore; // Rs3HighScore $runeMetrics->activityFeed->items[0]->title; // "Quest complete: Evil Dave's big day out" $adventurersLog = $fetcher->fetchAdventurersLog($player); $adventurersLog->displayName; // "PlayerName" $adventurersLog->activityFeed->items[0]->description; // "I somehow switched bodies with Evil Dave and survived enough chores and shouting from Doris to find a way to swap back!"
villermen/runescape-lookup-commons 适用场景与选型建议
villermen/runescape-lookup-commons 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 125 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 09 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 villermen/runescape-lookup-commons 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 villermen/runescape-lookup-commons 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 125
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-03