Expanded scope of updates to allow greater modding capacity. Auto-updating CRF2 manager.

This commit is contained in:
Ace73 2025-02-18 16:36:23 -08:00
parent 4993725ef2
commit d9a6709d4c
31 changed files with 44 additions and 14 deletions

View file

@ -31,7 +31,6 @@ namespace Bobocraft_2_Launcher_Update_Assistant
private string versionFile;
private string launcherVersionFile;
private string tempZip;
private string modZip;
private string launcherExe;
private string launcherPath;
private string configFile;
@ -88,7 +87,7 @@ namespace Bobocraft_2_Launcher_Update_Assistant
try
{
WebClient webClient = new WebClient();
Version onlineLauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=16YSzW2p-mWDyS4249HdsNivMHvPU6uOu"));
Version onlineLauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1MnPRLYIwUUQ_QBPMol8TQmQkaISoTldD"));
if (onlineLauncherVersion.IsDifferentThan(localLauncherVersion))
{
@ -119,7 +118,7 @@ namespace Bobocraft_2_Launcher_Update_Assistant
{
WebClient webClient = new WebClient();
Status = LauncherStatus.downloadingUpdate;
_onlinelauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=16YSzW2p-mWDyS4249HdsNivMHvPU6uOu"));
_onlinelauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1MnPRLYIwUUQ_QBPMol8TQmQkaISoTldD"));
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadLauncherCompletedCallback);
webClient.DownloadFileAsync(new Uri("https://cloud.norbipeti.eu/s/YWYN2mQL4p7ptWn/download/asd.zip"), tempZip, _onlinelauncherVersion);
}

View file

@ -32,7 +32,7 @@ namespace GameLauncher
private string versionFile;
private string launcherVersionFile;
private string tempZip;
private string modZip;
private string pluginPath;
private string gameExe;
private string launcherAssistantExe;
private string launcherPath;
@ -42,6 +42,7 @@ namespace GameLauncher
private string assistantPath;
private string botDirectory;
private string CRF2ManagerExe;
private string CRF2ManagerVersionFile;
private LauncherStatus _status;
internal LauncherStatus Status
@ -99,9 +100,10 @@ namespace GameLauncher
versionFile = Path.Combine(rootPath, "version.txt");
launcherVersionFile = Path.Combine(assistantPath, "launcherversion.txt");
tempZip = Path.Combine(rootPath, "temp");
modZip = Path.Combine(rootPath, "BepInEx", "plugins");
pluginPath = Path.Combine(rootPath, "BepInEx", "plugins");
configFile = Path.Combine(rootPath, "BepInEx", "config", "RC2MPWE.cfg");
CRF2ManagerExe = Path.Combine(launcherPath, "BOBOBloodhound.exe");
CRF2ManagerVersionFile = Path.Combine(launcherPath, "crfmanagerversion.txt");
botDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "AppData", "LocalLow", "Freejam", "Robocraft 2", "Modded", "Machines");
FAQFullText.Text = "Frequently Asked Questions:\r\n\tWhat is this? Is this the new Robocraft?\r\nThis game was originally under development by Freejam under the title Robocraft 2 until development was cancelled in early 2024. Freejam decided to change directions with their project, which is now under development as Robocraft 2 (often referred to as The Robocraft 2 Rebuild by the community). When the original was cancelled, the community decided to preserve it and set up dedicated community servers so we could still play together. This launcher exists to help you play that original version of Robocraft 2, plus some community bug fixes and balance changes. If you are interested in the new version being currently developed by Freejam you can request access to the playtest on the Robocraft steam store page or visit Robocraft2.com for more information. \r\n\r\n\tHow do I use this thing?\r\nJust put it inside your main installation folder, “\\Robocraft 2” and run it, ask the discord if you are running into any problems and someone will help you. It will modify your vanilla Robocraft 2 install to a modded one and check for updates so youll have the latest community patch and will be able to connect to the community server. This launcher only works for windows users, check the discord for mac/linux information.\r\n\r\n\tHow do I install bots/precons/maps?\r\nThese are all stored inside your application data folder. To access it, follow these steps:\r\nPress the windows key, type appdata and press enter\r\nNavigate to \\AppData\\LocalLow\\Freejam\\Robocraft 2\r\nBots are located in: Modded\\Machines\r\nMaps are located in: Mock\\Worlds\r\nPrecons are located in: Modded\\Precons\r\n\r\n\tCan I share this game on social media?\r\nYes, but you must make it clear that this is not an official Freejam project or endorsed by or affiliated with Freejam. This can be with a text disclaimer in the description, for example. Freejam has asked us to do this and we think it is quite reasonable and understandable, given that their new project is also called Robocraft 2 and they probably want to avoid confusion.\r\n\r\n\tCredits\r\nOriginal Game: Freejam\r\nMod/Server Build: NorbiPeti\r\nMain Server Host: shadowcrafter01\r\nBalance Changes: OXxzyDoOM\r\nDiscord Operator: Loading_._._.\r\nCRF2 Manager: Robocrafter Art (ARTGUK)\r\nLauncher: Ace73Streaming";
}
@ -125,15 +127,15 @@ namespace GameLauncher
}
private void UpdateCRF2Manager(Version _onlinelauncherVersion)
private void UpdateCRF2Manager(Version _onlineCRF2ManagerVersion)
{
try
{
WebClient webClient = new WebClient();
Status = LauncherStatus.downloadingCRF2Manager;
_onlinelauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=16YSzW2p-mWDyS4249HdsNivMHvPU6uOu"));
_onlineCRF2ManagerVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1jQhH6nynSlrCCFw5STjc-evuNCSV7xsZ"));
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadCRF2ManagerCompletedCallback);
webClient.DownloadFileAsync(new Uri("https://drive.usercontent.google.com/u/0/uc?id=18mbNZXPfkHxUcLJFEvvbhZNi5ohWQome&export=download"), tempZip, _onlinelauncherVersion);
webClient.DownloadFileAsync(new Uri("https://drive.usercontent.google.com/u/0/uc?id=18mbNZXPfkHxUcLJFEvvbhZNi5ohWQome&export=download"), tempZip, _onlineCRF2ManagerVersion);
}
catch (Exception ex)
{
@ -146,8 +148,9 @@ namespace GameLauncher
{
try
{
string onlineLauncherVersion = ((Version)e.UserState).ToString();
string onlineCRF2ManagerVersion = ((Version)e.UserState).ToString();
ZipFile.ExtractToDirectory(tempZip, assistantPath, true);
File.WriteAllText(CRF2ManagerVersionFile, onlineCRF2ManagerVersion);
ProcessStartInfo CRF2ManagerProcess = new ProcessStartInfo(CRF2ManagerExe);
CRF2ManagerProcess.WorkingDirectory = rootPath;
Process.Start(CRF2ManagerProcess);
@ -162,8 +165,36 @@ namespace GameLauncher
private void CheckForCRFManagerUpdates()
{
if (File.Exists(CRF2ManagerVersionFile))
{
Version localCRF2ManagerVersion = new Version(File.ReadAllText(CRF2ManagerVersionFile));
try
{
WebClient webClient = new WebClient();
Version onlineCRF2ManagerVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1jQhH6nynSlrCCFw5STjc-evuNCSV7xsZ"));
if (onlineCRF2ManagerVersion.IsDifferentThan(localCRF2ManagerVersion))
{
UpdateCRF2Manager(onlineCRF2ManagerVersion);
}
else
{
OpenCRF2Manager();
}
}
catch (Exception ex)
{
Status = LauncherStatus.failed;
MessageBox.Show($"Error checking for CRF2Manager updates: {ex}");
}
}
else
{
UpdateCRF2Manager(Version.zero);
}
}
@ -176,7 +207,7 @@ namespace GameLauncher
try
{
WebClient webClient = new WebClient();
Version onlineLauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=16YSzW2p-mWDyS4249HdsNivMHvPU6uOu"));
Version onlineLauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1MnPRLYIwUUQ_QBPMol8TQmQkaISoTldD"));
if (onlineLauncherVersion.IsDifferentThan(localLauncherVersion))
{
@ -209,7 +240,7 @@ namespace GameLauncher
{
WebClient webClient = new WebClient();
Status = LauncherStatus.downloadingUpdate;
_onlinelauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=16YSzW2p-mWDyS4249HdsNivMHvPU6uOu"));
_onlinelauncherVersion = new Version(webClient.DownloadString("https://drive.google.com/uc?export=download&id=1MnPRLYIwUUQ_QBPMol8TQmQkaISoTldD"));
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadLauncherAssistantCompletedCallback);
webClient.DownloadFileAsync(new Uri("https://cloud.norbipeti.eu/s/ZwRmsKb3gLNKKNH/download/assist.zip"), tempZip, _onlinelauncherVersion);
}
@ -350,7 +381,7 @@ namespace GameLauncher
}
else
{
ZipFile.ExtractToDirectory(tempZip, modZip, true);
ZipFile.ExtractToDirectory(tempZip, rootPath, true);
File.Delete(tempZip);
File.WriteAllText(versionFile, onlineVersion);
VersionText.Text = "Mod Version: " + onlineVersion;
@ -389,7 +420,7 @@ namespace GameLauncher
}
private void CRF2ManagerButton_Click(object sender, RoutedEventArgs e)
{
OpenCRF2Manager();
CheckForCRFManagerUpdates();
}
private void DiscordButton_Click(object sender, RoutedEventArgs e)