Skip to content

Commit

Permalink
Update README and a few code comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Renee Koecher committed Sep 16, 2022
1 parent 537bdaa commit 22167f3
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## About

XIPivot is an addon that allows to dynamically override parts of the ROM and sound
Pivot is an addon that allows to dynamically override parts of the ROM and sound
files of your FFXI client without touching the actual files.

It provides support for multiple overlay directories as well as runtime controls
of which overlays are loaded and used by the game.

The goals behind XIPivot are simple:
The goals behind Pivot are simple:

- no modifications to the original DAT / spw or bgw files
- no more huge folder with thousands of anonymous files
Expand All @@ -31,15 +31,15 @@ the current beta version of [Ashita v4](https://github.com/AshitaXI/Ashita-v4bet

#### Ashita Install

The latest version of XIPivot can always be installed from the plugins list in Ashita and will be updated automatically.
The latest version of Pivot can always be installed from the plugins list in Ashita and will be updated automatically.

### Ashita v4 (beta) Install

Follow the steps for manual installation for now.

## Modifications / Contribution
## Building from Source

If you would like to build XIPivot from source you need the Visual Studio 2020 or newer.
If you would like to build Pivot from source you need the Visual Studio 2020 or newer.
The Community Edition is available for free from [Microsoft](https://visualstudio.microsoft.com/vs/community/).

Otherwise it's just these three steps:
Expand All @@ -48,9 +48,27 @@ Otherwise it's just these three steps:
- open the solution
- chose "Build -> Rebuild Solution" .

The addon and plugin versions will be placed inside the directory `build\Release\Windower` and `build\Release\Ashita`.
The addon and plugin versions will be placed inside the directories below `build\Release\`.

## Contributions

Contributions in the form of new interfaces (xiloader would be one *hint hint*) are always welcome
as long as they don't modify the current interface exposed by the XiPivot::Core:: namespace.

Likewise feature requests are always welcome, with reason.

Pivot has one job - to intercept XI's DAT access and XI's - and it aims to do it in a very
specific and as conservative way as possible.

The classes below the XiPivot::Core:: namespace are considered stable and code-complete and do not currently
accept random contributions or pull-requests outside of compatibility fixes in case the game client changes.

Especially the Redirector class has been written based on a number of very specific implementation details of
the game client and changes to this class can cause any number of unexpected side effects. Further it has to be
compatible with all possible interface scenarios including to be loaded way before the actual game client (see
injection inte the POL process as is done in Ashita v4 right now).

## Disclaimer

I tested XIPivot to the best of my capabilities but I can not guarantee that it works without bugs for 100% of the time.
I tested Pivot to the best of my capabilities but I can not guarantee that it works without bugs for 100% of the time.
Use at your own discretion, I take no responsibility for any client crashes or data loss.
24 changes: 24 additions & 0 deletions XIPivot.Core/src/Redirector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,33 @@ namespace XiPivot
/* private stuff */
const char *Redirector::findRedirect(const char *realPath, int32_t &outPathKey)
{
/*
* findRedirect relies on a very specific implementation detail in the game client.
* Namely the fact that - probably based on the old PS2 code? - XI will use unix-style,
* denormalised paths when attempting to read DAT/VTBALE and FTABLE files for engine use.
* These paths are only used during gameplay, updates and the early launch as well as POL.exe
* all use reguler, normalised paths.
*
* With this in mind the scope of which files are attempted to be hooked can be kept as
* narrow as possible by checking for the denormalised '/ROM*' path suffix.
*
* This also - on purpose - prevents accidental hooking of addons or plugins that try to
* read the original game files.
*
* If an addon / plugin of any of the various interfaces needs a redirected path it SHOULD
* ask for it the same way the game would do natively.
*
* Yes, I'm aware that in case the developers at SE "fix" this pivot would have to be
* patched in order to work and this would also imply adding checks for when a file is requested
* and *from where in XIs code* in order to prevent unwanted redirection.
* However.. this has been around for 20 years now and I have my doubts it will be changed
* unless windows stops supporting denormalised paths.
*/
const char *romPath = strstr(realPath, "//ROM");
const char *sfxPath;

// FIXME: denormalised paths don't apply to music redirects with has the potential
// FIXME: to break music overlays in combination with the Ashita_v4 interface if there's an update to those.
if (strstr(realPath, "\\win\\se\\") != nullptr || strstr(realPath, "\\win\\music\\") != nullptr)
{
sfxPath = &(strstr(realPath, "\\win\\")[-1]);
Expand Down

0 comments on commit 22167f3

Please sign in to comment.