Skip to content

Commit 3f3b60a

Browse files
authored
plugin: Update deps, fix GetGameRegion (#1008)
1 parent 6fa28dc commit 3f3b60a

5 files changed

Lines changed: 34 additions & 30 deletions

File tree

plugin/CactbotEventSource/CactbotEventSource.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public override void Start() {
220220
overlay_plugin_version_ = versions.GetOverlayPluginVersion();
221221
ffxiv_plugin_version_ = versions.GetFFXIVPluginVersion();
222222
act_version_ = versions.GetACTVersion();
223-
game_region_ = versions.GetGameRegion();
223+
game_region_ = plugin_helper.GetGameRegion();
224224

225225
if (overlay_plugin_version_.CompareTo(new Version("0.19.0.0")) < 0) {
226226
var str = String.Format("Old OverlayPlugin {0} detected. To fix this, follow these instructions: https://overlayplugin.github.io/OverlayPlugin/fork_update.html (this url is also pinned in FFXIV ACT Discord #general)", overlay_plugin_version_.ToString());

plugin/CactbotEventSource/FFXIVPlugin.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@ public string GetLocaleString() {
4747
}
4848
}
4949

50+
internal VersionChecker.GameRegion GetGameRegion() {
51+
if (ffxiv_plugin_ == null) {
52+
logger_.Log(LogLevel.Error, Strings.NoFFXIVACTPluginFoundErrorMessage);
53+
return VersionChecker.GameRegion.International;
54+
}
55+
56+
try {
57+
dynamic plugin_derived = ffxiv_plugin_;
58+
switch ((byte)plugin_derived.DataRepository.GetGameRegion())
59+
{
60+
default:
61+
case 1:
62+
return VersionChecker.GameRegion.International;
63+
case 2:
64+
return VersionChecker.GameRegion.Chinese;
65+
case 3:
66+
return VersionChecker.GameRegion.Korean;
67+
case 4:
68+
return VersionChecker.GameRegion.TraditionalChinese;
69+
}
70+
} catch (Exception e) {
71+
logger_.Log(LogLevel.Error, Strings.DeterminingLanguageErrorMessage, e.ToString());
72+
return VersionChecker.GameRegion.International;
73+
}
74+
}
75+
5076
public int GetLanguageId() {
5177
if (ffxiv_plugin_ == null) {
5278
logger_.Log(LogLevel.Error, Strings.NoFFXIVACTPluginFoundErrorMessage);

plugin/CactbotEventSource/VersionChecker.cs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,28 +105,6 @@ public enum GameRegion {
105105
TraditionalChinese,
106106
}
107107

108-
public GameRegion GetGameRegion() {
109-
try {
110-
var mach = Assembly.Load("Machina.FFXIV");
111-
var opcode_manager_type = mach.GetType("Machina.FFXIV.Headers.Opcodes.OpcodeManager");
112-
var opcode_manager = opcode_manager_type.GetProperty("Instance").GetValue(null);
113-
var machina_region = opcode_manager_type.GetProperty("GameRegion").GetValue(opcode_manager).ToString();
114-
switch (machina_region) {
115-
case "Chinese":
116-
return GameRegion.Chinese;
117-
case "Korean":
118-
return GameRegion.Korean;
119-
case "TraditionalChinese":
120-
return GameRegion.TraditionalChinese;
121-
default:
122-
return GameRegion.International;
123-
}
124-
} catch (Exception e) {
125-
logger_.Log(LogLevel.Error, Strings.GetGameRegionException, e.Message);
126-
return GameRegion.International;
127-
}
128-
}
129-
130108
public async void DoUpdateCheck(CactbotEventSourceConfig config) {
131109
var pluginDirectory = GetCactbotDirectory();
132110
if (pluginDirectory == "") {

util/DEPS.json5

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@
33
// I just borrowed the basic concept and naming scheme.
44
{
55
"ACT": {
6-
"url": "https://github.com/EQAditu/AdvancedCombatTracker/releases/download/3.6.2.279/ACTv3.zip",
6+
"url": "https://github.com/EQAditu/AdvancedCombatTracker/releases/download/3.8.4.287/ACTv3.zip",
77
"dest": "plugin/ThirdParty/ACT",
88
"strip": 0,
9-
"hash": ["sha256", "8822e08147a44d0b82548068033dc18177c1fac993e8564e1ac32ed94c570e08"],
9+
"hash": ["sha256", "c19916dffed435594e37ffeab99681c9cf2005b45e80016fdfb1eb8f60c9c480"],
1010
},
1111
"FFXIV_ACT": {
12-
"url": "https://github.com/ravahn/FFXIV_ACT_Plugin/raw/master/Releases/FFXIV_ACT_Plugin_SDK_2.2.1.6.zip",
12+
"url": "https://github.com/ravahn/FFXIV_ACT_Plugin/raw/master/Releases/FFXIV_ACT_Plugin_SDK_3.0.0.6.zip",
1313
"dest": "plugin/ThirdParty/FFXIV_ACT",
1414
"strip": 0,
15-
"hash": ["sha256", "9a801d2df30c186b3915cb75dd12d1c75e559de09f71038bf1f68f7d8a3aa34a"],
15+
"hash": ["sha256", "6a7927f455a25cc14cdb8a210aebd0797b64e5f216b15fac6edf907d4a1280c5"],
1616
},
1717
"OverlayPlugin": {
18-
"url": "https://github.com/OverlayPlugin/OverlayPlugin/releases/download/v0.19.21/OverlayPlugin-0.19.21.zip",
18+
"url": "https://github.com/OverlayPlugin/OverlayPlugin/releases/download/v0.19.86/OverlayPlugin-0.19.86.zip",
1919
"dest": "plugin/ThirdParty/OverlayPlugin",
2020
"strip": 1,
21-
"hash": ["sha256", "5abd855169dc02bb8a337bdff511f24e1ed0b783dca197bdce3e9ec160735624"],
21+
"hash": ["sha256", "bdc863b939e68a1a4ae7129c6c0ec1cb033ac37f3577c87acfd7290a7c79a033"],
2222
},
2323
}

util/fetch_deps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ const extractFile = async (dlname: string, meta: Meta): Promise<void> => {
8888
if (meta['url'].endsWith('.zip')) {
8989
const zip = await JSZip.loadAsync(await fs.readFile(dlname));
9090
for (const [relativePath, entry] of Object.entries(zip.files)) {
91-
const distPath = path.join(dest, relativePath.split('/').slice(meta.strip).join('/'));
91+
const distPath = path.join(dest, relativePath.split(/[/\\]/).slice(meta.strip).join('/'));
9292
const dir = path.dirname(distPath);
9393
if (entry.dir) {
9494
await fs.mkdir(distPath, { recursive: true });

0 commit comments

Comments
 (0)