Skip to content

Commit

Permalink
144.514.1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
MapleRecall committed Dec 18, 2022
1 parent 14cee76 commit 73a75f7
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 42 deletions.
30 changes: 2 additions & 28 deletions ACTDaLaMa/DaLaMaPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class ProgressEventArgsEx

private LinkLabel linkLabel1;

private CheckBox checkBoxAcce;

private LinkLabel linkLabel2;

private CheckBox checkBoxAutoInject;
Expand Down Expand Up @@ -132,11 +130,6 @@ private void InitializeConfig()
checkBoxAutoInject.Checked = true;
}

if (GetAppSettings("Accelerate", "false") == "true")
{
checkBoxAcce.Checked = true;
}

if (GetAppSettings("AutoCheckXL", "true") == "true")
{
checkBoxXL.Checked = true;
Expand Down Expand Up @@ -233,8 +226,7 @@ private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
private DalamudStartInfo GeneratingDalamudStartInfo(Process process, string dalamudPath)
{
var ffxivDir = Path.GetDirectoryName(process.MainModule.FileName);
var appDataDir = Path.Combine(rootPath);
var xivlauncherDir = Path.Combine(appDataDir, "XIVLauncher");
var xivlauncherDir = xivlauncherDirectory.FullName;

var gameVerStr = File.ReadAllText(Path.Combine(ffxivDir, "ffxivgame.ver"));

Expand All @@ -243,11 +235,11 @@ private DalamudStartInfo GeneratingDalamudStartInfo(Process process, string dala
ConfigurationPath = Path.Combine(xivlauncherDir, "dalamudConfig.json"),
PluginDirectory = Path.Combine(xivlauncherDir, "installedPlugins"),
DefaultPluginDirectory = Path.Combine(xivlauncherDir, "devPlugins"),
RuntimeDirectory = runtimeDirectory.FullName,
AssetDirectory = dalamudUpdater.AssetDirectory?.FullName ?? GetDefaultAssetDirectory(xivlauncherDir),
GameVersion = gameVerStr,
Language = "4",
OptOutMbCollection = false,
GlobalAccelerate = this.checkBoxAcce.Checked,
WorkingDirectory = dalamudPath
};

Expand Down Expand Up @@ -278,11 +270,6 @@ private void checkBoxAutoInject_CheckedChanged(object sender, EventArgs e)
AddOrUpdateAppSettings("AutoInject", checkBoxAutoInject.Checked ? "true" : "false");
}

private void checkBoxAcce_CheckedChanged(object sender, EventArgs e)
{
AddOrUpdateAppSettings("Accelerate", checkBoxAcce.Checked ? "true" : "false");
}

protected override void Dispose(bool disposing)
{
if (disposing && components != null)
Expand All @@ -299,7 +286,6 @@ private void InitializeComponent()
this.labelVersion = new System.Windows.Forms.Label();
this.buttonInject = new System.Windows.Forms.Button();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.checkBoxAcce = new System.Windows.Forms.CheckBox();
this.linkLabel2 = new System.Windows.Forms.LinkLabel();
this.checkBoxAutoInject = new System.Windows.Forms.CheckBox();
this.DalamudUpdaterIcon = new System.Windows.Forms.NotifyIcon(this.components);
Expand Down Expand Up @@ -389,17 +375,6 @@ private void InitializeComponent()
this.linkLabel1.Text = "加入QQ频道";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// checkBoxAcce
//
this.checkBoxAcce.AutoSize = true;
this.checkBoxAcce.Location = new System.Drawing.Point(400, 11);
this.checkBoxAcce.Name = "checkBoxAcce";
this.checkBoxAcce.Size = new System.Drawing.Size(78, 19);
this.checkBoxAcce.TabIndex = 4;
this.checkBoxAcce.Text = "国际加速";
this.checkBoxAcce.UseVisualStyleBackColor = true;
this.checkBoxAcce.CheckedChanged += new System.EventHandler(this.checkBoxAcce_CheckedChanged);
//
// linkLabel2
//
this.linkLabel2.AutoSize = true;
Expand Down Expand Up @@ -750,7 +725,6 @@ private void InitializeComponent()
this.Controls.Add(this.progressBar3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.labelVer);
this.Controls.Add(this.checkBoxAcce);
this.Controls.Add(this.linkLabel2);
this.Controls.Add(this.labelVersion);
this.Controls.Add(this.buttonCheckForUpdate);
Expand Down
25 changes: 20 additions & 5 deletions ACTDaLaMa/DaLaMaPlugin_Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ public partial class DaLaMaPlugin

private DirectoryInfo addonDirectory => new DirectoryInfo(Path.Combine(rootPath, "addon"));
private DirectoryInfo runtimeDirectory => new DirectoryInfo(Path.Combine(rootPath, "runtime"));
private DirectoryInfo xivlauncherDirectory => new DirectoryInfo(Path.Combine(rootPath, "XIVLauncher"));
private DirectoryInfo assetDirectory => new DirectoryInfo(Path.Combine(rootPath, "XIVLauncher", "dalamudAssets"));
private DirectoryInfo configDirectory => new DirectoryInfo(Path.Combine(rootPath, "XIVLauncher", "pluginConfigs"));
private DirectoryInfo configDirectory => new DirectoryInfo(Path.Combine(rootPath, "XIVLauncher"));

public string CurrentVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();

Expand Down Expand Up @@ -108,23 +109,37 @@ private void InitUpdater()
dalamudUpdater.OnUpdateEvent += DalamudUpdater_OnUpdateEvent;
}

private Version getVersion()
private string getVersion()
{
var rgx = new Regex(@"^\d+\.\d+\.\d+\.\d+$");
var stgRgx = new Regex(@"^[\da-zA-Z]{7}$");
var di = new DirectoryInfo(Path.Combine(rootPath, "addon", "Hooks"));
var version = new Version("0.0.0.0");
if (!di.Exists)
return version;
return version.ToString();
var dirs = di.GetDirectories("*", SearchOption.TopDirectoryOnly).Where(dir => rgx.IsMatch(dir.Name)).ToArray();
bool releaseVersionExists = false;

foreach (var dir in dirs)
{
var newVersion = new Version(dir.Name);
if (newVersion > version)
{
releaseVersionExists = true;
version = newVersion;
}
}
return version;

if (!releaseVersionExists)
{
var stgDirs = di.GetDirectories("*", SearchOption.TopDirectoryOnly).Where(dir => stgRgx.IsMatch(dir.Name)).ToArray();
if (stgDirs.Length > 0)
{
return stgDirs[0].Name;
}
}

return version.ToString();
}

private void InitializePIDCheck()
Expand Down Expand Up @@ -219,7 +234,7 @@ private async Task<bool> InjectAsync(int pid, double delay = 0)
}

var runner = dalamudUpdater.Runner ??
new FileInfo(Path.Combine(addonDirectory.FullName, "Hooks", getVersion().ToString(), "Dalamud.Injector.exe"));
new FileInfo(Path.Combine(addonDirectory.FullName, "Hooks", getVersion(), "Dalamud.Injector.exe"));

var dalamudStartInfo = GeneratingDalamudStartInfo(process, Directory.GetParent(runner.FullName).FullName);
var environment = new Dictionary<string, string>();
Expand Down
5 changes: 1 addition & 4 deletions ACTDaLaMa/Dalamud/DalamudStartInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ public sealed class DalamudStartInfo
{
public string WorkingDirectory;
public string ConfigurationPath;

public string PluginDirectory;
public string RuntimeDirectory;
public string DefaultPluginDirectory;
public string AssetDirectory;
public string Language;
public int DelayInitializeMs;

public string GameVersion;

public bool OptOutMbCollection;

public bool GlobalAccelerate;
}
}
4 changes: 2 additions & 2 deletions ACTDaLaMa/Dalamud/DalamudUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public class DalamudUpdater
private readonly DirectoryInfo configDirectory;
//private readonly IUniqueIdCache? cache;
public const string REMOTE_BASE = "https://aonyx.ffxiv.wang/";
public const string REMOTE_VERSION = REMOTE_BASE + "Dalamud/Release/VersionInfo?track=release";
public const string REMOTE_VERSION = REMOTE_BASE + "Dalamud/Release/VersionInfo?track=";
public const string REMOTE_DOTNET = REMOTE_BASE + "Dalamud/Release/Runtime/DotNet/{0}";
public const string REMOTE_DESKTOP = REMOTE_BASE + "Dalamud/Release/Runtime/WindowsDesktop/{0}";
private readonly TimeSpan defaultTimeout = TimeSpan.FromSeconds(120);
Expand Down Expand Up @@ -172,7 +172,7 @@ private static string GetBetaTrackName(DalamudSettings settings) =>
NoCache = true,
};

var versionInfoJsonRelease = await client.GetStringAsync(REMOTE_VERSION).ConfigureAwait(false);
var versionInfoJsonRelease = await client.GetStringAsync(REMOTE_VERSION + "release").ConfigureAwait(false);

DalamudVersionInfo versionInfoRelease = JsonConvert.DeserializeObject<DalamudVersionInfo>(versionInfoJsonRelease);

Expand Down
3 changes: 2 additions & 1 deletion ACTDaLaMa/Dalamud/WindowsDalamudRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ public static void Inject(FileInfo runner, int gamePid, IDictionary<string, stri

var launchArguments = new List<string>
{
"inject",
"inject -v",
$"{gamePid}",
//$"--all --warn",
//$"--game=\"{gamePath}\"",
$"--dalamud-working-directory=\"{startInfo.WorkingDirectory}\"",
$"--dalamud-configuration-path=\"{startInfo.ConfigurationPath}\"",
$"--dalamud-plugin-directory=\"{startInfo.PluginDirectory}\"",
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MapleRecall")]
[assembly: AssemblyProduct("Dalamud.Updater.ACT")]
[assembly: AssemblyVersion("144.514.1.10")]
[assembly: AssemblyVersion("144.514.1.11")]
6 changes: 5 additions & 1 deletion version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"version": "144.514.1.10",
"version": "144.514.1.11",
"changeLog": [
"[144.514.1.11]",
"支持测试版,具体看方法看QQ频道",
"去掉了已经没有用了的国际加速",
"",
"[144.514.1.10]",
"修复一个GZIP未解压炸游戏的问题",
"",
Expand Down

0 comments on commit 73a75f7

Please sign in to comment.