This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
332 changed files
with
129,568 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.vscode | ||
.vscode | ||
__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
WIP | ||
GOG Galaxy 2.0 Final Fantasy XIV integration | ||
|
||
# Installation | ||
|
||
Clone repository to `%localappdata%\GOG.com\Galaxy\plugins\installed\ffxiv` | ||
|
||
# Working with code | ||
|
||
## Before starting | ||
Install Python extensions (shuold not be needed) `pip install -r requirements.txt -t ./modules --implementation cp --python-version 37 --only-binary=:all:` | ||
|
||
## Files and folders | ||
* ./html/ | ||
* folder with html files that will popup when first connecting integration | ||
* ./modules/ | ||
* folder with installed python modules required for proper functionality of integration | ||
* ./ffxiv_api.py | ||
* handles logging in and retrieving character details | ||
* ./ffxiv_localgame.py | ||
* handles tasks with local game - starting, deleting | ||
* ./ffxiv_tools.py | ||
* helper functions | ||
* ./plugin.py | ||
* main script responsible for launching integration | ||
* ./version.py | ||
* contains current version of integration | ||
* ./manifest.json | ||
* contains identification info about integration | ||
* ./requirements.txt | ||
* contains python modules required for proper functionality of integration | ||
|
||
# Changelog | ||
* v. 1.0.0 | ||
* First working release | ||
* Supports launching game, uninstalling game, detecting game launch and if it's running, synchronizing friends | ||
* Installing game currently not supported - WIP | ||
* Achievements syncing currently not supported - needs more research, may be unable to support because of platform limitations | ||
|
||
# Thanks | ||
|
||
[@gogcom](https://github.com/gogcom) for making GOG Galaxy 2 and giving me access to beta | ||
https://github.com/gogcom/galaxy-integrations-python-api | ||
|
||
[@Mixaill](https://github.com/Mixaill) for his GOG Galaxy Guild Wars 2 integration which I used as base for this integration. https://github.com/Mixaill/galaxy-integration-gw2 | ||
|
||
[@viion](https://twitter.com/viion) for A FINAL FANTASY XIV: Online REST API https://xivapi.com/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
import sys | ||
import logging | ||
import subprocess | ||
import xml.etree.ElementTree as ElementTree | ||
import ffxiv_tools | ||
|
||
from typing import List | ||
|
||
class FFXIVLocalGame(object): | ||
def __init__(self, game_dir, game_executable): | ||
self._dir = game_dir.lower() | ||
self._executable = game_executable.lower() | ||
|
||
def exe_name(self) -> str: | ||
return self._executable | ||
|
||
def run_game(self) -> None: | ||
subprocess.Popen([os.path.join(self._dir, self._executable)], creationflags=0x00000008, cwd = self._dir) | ||
|
||
def delete_game(self) -> None: | ||
subprocess.Popen(ffxiv_tools.get_uninstall_exe(), creationflags=0x00000008, cwd = self._dir, shell=True) | ||
|
||
def get_game_instances() -> List[FFXIVLocalGame]: | ||
result = list() | ||
install_folder = ffxiv_tools.get_installation_folder() | ||
|
||
if not os.path.exists(install_folder): | ||
return result | ||
|
||
result.append(FFXIVLocalGame(install_folder + "\\boot\\", "ffxivboot.exe")) | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import platform | ||
import sys | ||
import os | ||
|
||
if sys.platform == 'win32': | ||
import winreg | ||
|
||
def set_arch_keys(): | ||
if platform.machine().endswith('64'): | ||
arch_keys = {winreg.KEY_WOW64_32KEY, winreg.KEY_WOW64_64KEY} | ||
else: | ||
arch_keys = {0} | ||
|
||
return arch_keys | ||
|
||
def get_installation_folder(): | ||
arch_keys = set_arch_keys() | ||
|
||
for arch_key in arch_keys: | ||
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, winreg.KEY_READ | arch_key) | ||
|
||
for i in range(0, winreg.QueryInfoKey(key)[0]): | ||
skey_name = winreg.EnumKey(key, i) | ||
skey = winreg.OpenKey(key, skey_name) | ||
|
||
try: | ||
if (winreg.QueryValueEx(skey, 'DisplayName')[0] == "FINAL FANTASY XIV - A Realm Reborn"): | ||
install_location = winreg.QueryValueEx(skey, 'InstallLocation')[0] + "\\FINAL FANTASY XIV - A Realm Reborn" | ||
skey.Close() | ||
|
||
return install_location | ||
except OSError: | ||
pass | ||
finally: | ||
skey.Close() | ||
|
||
def get_uninstall_exe(): | ||
arch_keys = set_arch_keys() | ||
|
||
for arch_key in arch_keys: | ||
key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", 0, winreg.KEY_READ | arch_key) | ||
|
||
for i in range(0, winreg.QueryInfoKey(key)[0]): | ||
skey_name = winreg.EnumKey(key, i) | ||
skey = winreg.OpenKey(key, skey_name) | ||
|
||
try: | ||
if (winreg.QueryValueEx(skey, 'DisplayName')[0] == "FINAL FANTASY XIV - A Realm Reborn"): | ||
uninstall_exe = winreg.QueryValueEx(skey, 'UninstallString')[0] | ||
skey.Close() | ||
|
||
return uninstall_exe | ||
except OSError: | ||
pass | ||
finally: | ||
skey.Close() |
Oops, something went wrong.