@achievement-watcher/celes 中文文档教程

发布于 4年前 浏览 15 项目主页 更新于 3年前

NPM 版本 NodeJS CI 操作状态 Codecov 可维护性”></a> 
  <a href=许可证 contributions welcome

Celes

Celes 是一个开源文件和注册表抓取工具,可获取和存储游戏成就,无论其来源如何。

Table of Contents

About the project

Celes 是一个 Typescript 库,允许其他工具抓取文件和注册表以从中获取用户成就 多个来源。 它包括多种功能,如检测游戏、加载模式和生成列表 解锁成就,以及导入和导出功能。 它还有一个内置的数据库,允许它 存储本地缓存,也可以被其他工具使用 成就观察者 项目。

要查看兼容源和平台的列表,请参阅 兼容性

Built with

Getting Started

Prerequisites

你需要 NPM 来安装 Celes。 如果你没有它,你可以下载它 https://www.npmjs.com/

Installation

Celes 在 NPM 上可用,因此您可以直接从那里安装它:

npm install --save @achievement-watcher/celes

Usage

API

Import

import {Celes} from '@achievement-watcher/celes'

The Celes Object

Celes 是导出的主要类,也是必须使用的主要类。 如果可以广泛配置 下面:

class Celes {
    constructor(
        achievementWatcherRootPath: string, 
        additionalFoldersToScan?: string[], 
        enabledPlugins?: string[], 
        steamPluginMode?: 0 | 1 | 2, 
        systemLanguage?: string, 
        useOldestUnlockTime?: boolean
    ) {}
}
Constructor parameters explanation
  • achievementWatcherRootPath: string: Root path of the data folder of the Achievement Watcher project. It should be created in the installation of Achievement Watcher and, usually, it defaults to %APPDATA%/Achievement Watcher. Inside of it, caches and schemas and user stats are stored.
  • additionalFoldersToScan?: string[]: List of folders defined by the user to scan. Used by some plugins to try to scrap achievement data from there.
  • enabledPlugins?: string[]: List of plugin names that have to be used. The plugin names are defined by the name of the files stored under (src/lib/plugins)[src/lib/plugins]. By deafault, all of them are enabled.
  • steamPluginMode?: 0 | 1 | 2: Work mode of the Steam plugin:
    • 0 -> Disabled.
    • 1 -> Enabled. Only Installed games are shown.
    • 2 -> Enabled. All games are shown.
  • systemLanguage?: string: User defined language. Defaults to english.
  • useOldestUnlockTime?: boolean: Method to be used when merging same achievements from different sources. By default, oldest unlock time is used, which means that, under collision, the unlock time stored is the most ancient one.

Celes API

这是 Celes 可用的公共方法列表。 始终更新的解释可以在 src/lib/Celes.ts 文件。 在的情况下 NPM包,详细解释应该在 dist/lib/Celes.d.ts

Pull
async pull(callbackProgress?: (progress: number) => void): Promise<ScrapResult> {};
Load
async load(callbackProgress?: (progress: number) => void): Promise<GameData[]> {};
Export
async export(filePath: string): Promise<void> {};
Import
async import(filePath: string, force?: boolean): Promise<GameData[]> {};
Add Game
async addGame(appId: string, platform: Platform): Promise<void> {};

Remove manually added Game
async removeManuallAddedGame(appId: string, platform: Platform): Promise<void> {};

Unlock Achievement
async unlockAchievement(appId: string, platform: Platform, achievementId: string, unlockTime = 0): Promise<void> {};

Remove Manually Unlocked Achievement
async removeManuallyUnlockedAchievement(appId: string, platform: Platform, achievementId: string): Promise<void> {};
Set Achievement Unlock Time
async setAchievementUnlockTime(appId: string, source: Source, platform: Platform, achievementId: string, 
                               unlockTime: number): Promise<void> {};
Add Game Playtime
async addGamePlaytime(appId: string, platform: Platform, playtime: number, 
                      force?: boolean): Promise<void> {};

Contributing

欢迎投稿。 请参阅贡献 了解更多信息。

License

根据 GPL-3.0 许可证分发。 请参阅许可证 了解更多信息。

Legal Aspects

有关法律方面的信息,请参阅法律

NPM version NodeJS CI Actions Status Codecov Maintainability License contributions welcome

Celes

Celes is an Open Source file and registry scraper that obtains and stores game achievements, whatever the origin.

Table of Contents

About the project

Celes is a Typescript library that allows other tools to scrap files and registries to obtain user achievements from multiple sources. It includes multiples funcionalities like detecting games, loading schemas and generating a list of unlocked achievements, together with import and export features. It also has a built-in database, which allows it to store local caches than can also be used by other tools of the Achievement Watcher project.

To see the list of compatible sources and platforms, refer to COMPATIBILITY.

Built with

Getting Started

Prerequisites

You need NPM to install Celes. If you don't have it, you can download it at https://www.npmjs.com/.

Installation

Celes is available at NPM, so you can install it directly from there:

npm install --save @achievement-watcher/celes

Usage

API

Import

import {Celes} from '@achievement-watcher/celes'

The Celes Object

Celes is the main class exported and the one that has to be used principaly. If can be widely configured as presented below:

class Celes {
    constructor(
        achievementWatcherRootPath: string, 
        additionalFoldersToScan?: string[], 
        enabledPlugins?: string[], 
        steamPluginMode?: 0 | 1 | 2, 
        systemLanguage?: string, 
        useOldestUnlockTime?: boolean
    ) {}
}
Constructor parameters explanation
  • achievementWatcherRootPath: string: Root path of the data folder of the Achievement Watcher project. It should be created in the installation of Achievement Watcher and, usually, it defaults to %APPDATA%/Achievement Watcher. Inside of it, caches and schemas and user stats are stored.
  • additionalFoldersToScan?: string[]: List of folders defined by the user to scan. Used by some plugins to try to scrap achievement data from there.
  • enabledPlugins?: string[]: List of plugin names that have to be used. The plugin names are defined by the name of the files stored under (src/lib/plugins)[src/lib/plugins]. By deafault, all of them are enabled.
  • steamPluginMode?: 0 | 1 | 2: Work mode of the Steam plugin:
    • 0 -> Disabled.
    • 1 -> Enabled. Only Installed games are shown.
    • 2 -> Enabled. All games are shown.
  • systemLanguage?: string: User defined language. Defaults to english.
  • useOldestUnlockTime?: boolean: Method to be used when merging same achievements from different sources. By default, oldest unlock time is used, which means that, under collision, the unlock time stored is the most ancient one.

Celes API

This is the list of public methods available at Celes. An always-updated explanation can be found inside of the src/lib/Celes.ts file. In the case of the NPM package, the detailed explanation should be instead at dist/lib/Celes.d.ts.

Pull
async pull(callbackProgress?: (progress: number) => void): Promise<ScrapResult> {};
Load
async load(callbackProgress?: (progress: number) => void): Promise<GameData[]> {};
Export
async export(filePath: string): Promise<void> {};
Import
async import(filePath: string, force?: boolean): Promise<GameData[]> {};
Add Game
async addGame(appId: string, platform: Platform): Promise<void> {};

Remove manually added Game
async removeManuallAddedGame(appId: string, platform: Platform): Promise<void> {};

Unlock Achievement
async unlockAchievement(appId: string, platform: Platform, achievementId: string, unlockTime = 0): Promise<void> {};

Remove Manually Unlocked Achievement
async removeManuallyUnlockedAchievement(appId: string, platform: Platform, achievementId: string): Promise<void> {};
Set Achievement Unlock Time
async setAchievementUnlockTime(appId: string, source: Source, platform: Platform, achievementId: string, 
                               unlockTime: number): Promise<void> {};
Add Game Playtime
async addGamePlaytime(appId: string, platform: Platform, playtime: number, 
                      force?: boolean): Promise<void> {};

Contributing

Contributions are welcome. See CONTRIBUTING for more information.

License

Distributed under the GPL-3.0 License. See LICENSE for more information.

Legal Aspects

For legal aspects, see legal.

更多

友情链接

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文