FileAccessPlugin

版本 v1.7.2·更新於 2024-03-15

Provides standardized methods for accessing both local file and url resources. Automatically handles searching local folders for assets.

模組介紹 作者原文

File Access Plugin

This unofficial TaleSpire plugin for providing a standardized method of accessing

both local and internet resources (files). Plugins that use this plugin for file

access will be able to access both local file resources and internet resources,

without having to have different code, just by specifying a local or internet

source. When using local files this plugin automatically searches plugin folders

and the common folder (if present) for content which means the parent plugin does

not need to worry about such details.

Change Log

1.7.2: Fixed bug with sort order

1.7.1: Hide File Not Found exception for URL based Exist unless diagnostics are on

1.7.0: Added ability to re-load the cache (needed by plugins that modify files)

1.6.0: Added Plugin namespace with related methods

1.5.3: Update to keyboard detection code

1.5.1: Improved diagnostics

1.5.1: Fixed bug with Find when using URL

1.4.1: Fix Talespire takedown bug

1.4.0: Added support for Assets folders used by CALP

1.3.1: Bug Fix: CacheSetting produces Null Exception Error

1.3.0: The SetCacheType method is marked as obsolete and does not do anything.

The cache setting is now controlled at the File Access Plugin level via

R2ModMan configuration setting. This prevents plugins from changing the

cache setting on each other.

1.3.0: Removed unnecessary log entries

1.2.3: Catalog returns bare info by default (usable in code) with option to return

extended infromation for logging purpose

1.2.1: Find returns full path if a full path source is provided

1.2.0: Supports direct path option

1.1.1: Better location of the plugins folder in case manual install was done.

1.1.0: Fixed issue with forced R2ModMan profile. Plugin now auto detects profile.

1.0.0: Initial release

Install

Install using R2ModMan or similar and reference the plugin DLL when building the

parent plugin. This gives access to the LordAshes.FileAccessPlugin namespace with

most of the file related functions under the sub-namespace File, some image loading

function under the sub-namepace Image and an assetBundle loader under the sub-namespace

of AssetBundle.

Usage

GetProtocol(string source)

Gets the protocol portion of the source. Empty string if the source is a local file or

the protocol poriton (e.g. http or https) if it is a URL.

The following sub-namespaces are available...

File

AppendAllText(string source, string content)

string ReadAllText(string source)

WriteAllText(string source, string content)

Functions for appending, reading and writing the contents of the source as a single string.

Note: When using a URL for the source, append and write functions perform an upload.

AppendAllLines(string source, string content)

string ReadAllLines(string source)

WriteAllLines(string source, string content)

Functions for appending, reading and writing the contents of the source as an string array

of lines. Each line is the source is an individual entry in the array.

Note: When using a URL for the source, append and write functions perform an upload.

byte ReadAllBytes(string source)

WriteAllBytes(string source, byte content)

Functions for reading and writing the contents of the source as an byte array.

Note: When using a URL for the source, append and write functions perform an upload.

bool Exists(source)

Determines if the source exists. For local files it must exists in the plugin directories

or the common folder. For URL the resource needs to exists at the give source.

string Find(source)

When the source is a local file, finds where the source is located. Returns a string array

of resources that match the given source using a "contains" concept. When using any of the

append, reaad or write functions from this plugin, it is not necessary to use Find because

the functions take care of that on their own. However, if using a different function to

access the file, the Find function can be used to obtain the complete file path and namepace

of the file.

string Catalog(Bool extendedData)

Returns

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

bbepisTaleSpire-BepInExPackbrcoding-SetInjectionFlagPlugin

檔案與校驗

檔案名稱
FileAccessPlugin-1.7.2.zip
檔案大小
31.2 KiB