mirror of
https://github.com/bloxstraplabs/bloxstrap.git
synced 2025-04-21 01:51:29 -07:00
Whitespace formatting, move Integrations folder
This commit is contained in:
parent
92c420d888
commit
cc22ee1591
@ -14,9 +14,9 @@ using Microsoft.Win32;
|
|||||||
|
|
||||||
using Bloxstrap.Dialogs;
|
using Bloxstrap.Dialogs;
|
||||||
using Bloxstrap.Helpers;
|
using Bloxstrap.Helpers;
|
||||||
using Bloxstrap.Helpers.Integrations;
|
|
||||||
using Bloxstrap.Helpers.RSMM;
|
using Bloxstrap.Helpers.RSMM;
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
using Bloxstrap.Integrations;
|
||||||
|
|
||||||
namespace Bloxstrap
|
namespace Bloxstrap
|
||||||
{
|
{
|
||||||
|
@ -6,12 +6,13 @@ using System.Linq;
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Bloxstrap.Helpers;
|
||||||
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
|
||||||
using DiscordRPC;
|
using DiscordRPC;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
{
|
{
|
||||||
class DiscordRichPresence : IDisposable
|
class DiscordRichPresence : IDisposable
|
||||||
{
|
{
|
||||||
@ -36,10 +37,10 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
|
|
||||||
public DiscordRichPresence()
|
public DiscordRichPresence()
|
||||||
{
|
{
|
||||||
_rpcClient.OnReady += (_, e) =>
|
_rpcClient.OnReady += (_, e) =>
|
||||||
App.Logger.WriteLine($"[DiscordRichPresence::DiscordRichPresence] Received ready from user {e.User.Username} ({e.User.ID})");
|
App.Logger.WriteLine($"[DiscordRichPresence::DiscordRichPresence] Received ready from user {e.User.Username} ({e.User.ID})");
|
||||||
|
|
||||||
_rpcClient.OnPresenceUpdate += (_, e) =>
|
_rpcClient.OnPresenceUpdate += (_, e) =>
|
||||||
App.Logger.WriteLine("[DiscordRichPresence::DiscordRichPresence] Updated presence");
|
App.Logger.WriteLine("[DiscordRichPresence::DiscordRichPresence] Updated presence");
|
||||||
|
|
||||||
_rpcClient.OnConnectionEstablished += (_, e) =>
|
_rpcClient.OnConnectionEstablished += (_, e) =>
|
||||||
@ -62,7 +63,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
|
|
||||||
// debug stats to ensure that the log reader is working correctly
|
// debug stats to ensure that the log reader is working correctly
|
||||||
// if more than 5000 log entries have been read, only log per 100 to save on spam
|
// if more than 5000 log entries have been read, only log per 100 to save on spam
|
||||||
if (_logEntriesRead <= 5000 && _logEntriesRead % 50 == 0)
|
if (_logEntriesRead <= 5000 && _logEntriesRead % 50 == 0)
|
||||||
App.Logger.WriteLine($"[DiscordRichPresence::ExamineLogEntry] Read {_logEntriesRead} log entries");
|
App.Logger.WriteLine($"[DiscordRichPresence::ExamineLogEntry] Read {_logEntriesRead} log entries");
|
||||||
else if (_logEntriesRead % 100 == 0)
|
else if (_logEntriesRead % 100 == 0)
|
||||||
App.Logger.WriteLine($"[DiscordRichPresence::ExamineLogEntry] Read {_logEntriesRead} log entries");
|
App.Logger.WriteLine($"[DiscordRichPresence::ExamineLogEntry] Read {_logEntriesRead} log entries");
|
||||||
@ -75,7 +76,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
_activityInGame = false;
|
_activityInGame = false;
|
||||||
_activityPlaceId = Int64.Parse(match.Groups[2].Value);
|
_activityPlaceId = long.Parse(match.Groups[2].Value);
|
||||||
_activityJobId = match.Groups[1].Value;
|
_activityJobId = match.Groups[1].Value;
|
||||||
_activityMachineAddress = match.Groups[3].Value;
|
_activityMachineAddress = match.Groups[3].Value;
|
||||||
|
|
||||||
@ -160,7 +161,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
{
|
{
|
||||||
string? log = await sr.ReadLineAsync();
|
string? log = await sr.ReadLineAsync();
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(log))
|
if (string.IsNullOrEmpty(log))
|
||||||
logUpdatedEvent.WaitOne(1000);
|
logUpdatedEvent.WaitOne(1000);
|
||||||
else
|
else
|
||||||
await ExamineLogEntry(log);
|
await ExamineLogEntry(log);
|
@ -3,10 +3,11 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Bloxstrap.Helpers;
|
||||||
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
{
|
{
|
||||||
internal class RbxFpsUnlocker
|
internal class RbxFpsUnlocker
|
||||||
{
|
{
|
||||||
@ -14,7 +15,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
public const string ProjectRepository = "axstin/rbxfpsunlocker";
|
public const string ProjectRepository = "axstin/rbxfpsunlocker";
|
||||||
|
|
||||||
// default settings but with QuickStart set to true and CheckForUpdates set to false
|
// default settings but with QuickStart set to true and CheckForUpdates set to false
|
||||||
private static readonly string Settings =
|
private static readonly string Settings =
|
||||||
"UnlockClient=true\n" +
|
"UnlockClient=true\n" +
|
||||||
"UnlockStudio=false\n" +
|
"UnlockStudio=false\n" +
|
||||||
"FPSCapValues=[30.000000, 60.000000, 75.000000, 120.000000, 144.000000, 165.000000, 240.000000, 360.000000]\n" +
|
"FPSCapValues=[30.000000, 60.000000, 75.000000, 120.000000, 144.000000, 165.000000, 240.000000, 360.000000]\n" +
|
||||||
@ -33,7 +34,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
App.Logger.WriteLine("[RbxFpsUnlocker::CheckIfRunning] Closing currently running rbxfpsunlocker processes...");
|
App.Logger.WriteLine("[RbxFpsUnlocker::CheckIfRunning] Closing currently running rbxfpsunlocker processes...");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
foreach (Process process in processes)
|
foreach (Process process in processes)
|
@ -7,13 +7,14 @@ using System.IO;
|
|||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Bloxstrap.Helpers;
|
||||||
|
|
||||||
using Bloxstrap.Models;
|
using Bloxstrap.Models;
|
||||||
|
|
||||||
using IniParser;
|
using IniParser;
|
||||||
using IniParser.Model;
|
using IniParser.Model;
|
||||||
|
|
||||||
namespace Bloxstrap.Helpers.Integrations
|
namespace Bloxstrap.Integrations
|
||||||
{
|
{
|
||||||
internal class ReShade
|
internal class ReShade
|
||||||
{
|
{
|
||||||
@ -64,9 +65,9 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
new ReShadeShaderConfig
|
new ReShadeShaderConfig
|
||||||
{
|
{
|
||||||
Name = "AlucardDH",
|
Name = "AlucardDH",
|
||||||
DownloadLocation = "https://github.com/AlucardDH/dh-reshade-shaders/archive/refs/heads/master.zip",
|
DownloadLocation = "https://github.com/AlucardDH/dh-reshade-shaders/archive/refs/heads/master.zip",
|
||||||
ExcludedFiles = new List<string>()
|
ExcludedFiles = new List<string>()
|
||||||
{
|
{
|
||||||
@ -77,10 +78,10 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
new ReShadeShaderConfig
|
new ReShadeShaderConfig
|
||||||
{
|
{
|
||||||
Name = "Stormshade",
|
Name = "Stormshade",
|
||||||
DownloadLocation = "https://github.com/cyrie/Stormshade/archive/refs/heads/master.zip",
|
DownloadLocation = "https://github.com/cyrie/Stormshade/archive/refs/heads/master.zip",
|
||||||
BaseFolder = "reshade-shaders/",
|
BaseFolder = "reshade-shaders/",
|
||||||
ExcludedFiles = new List<string>()
|
ExcludedFiles = new List<string>()
|
||||||
{
|
{
|
||||||
@ -114,8 +115,8 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
"prod80",
|
"prod80",
|
||||||
"qUINT",
|
"qUINT",
|
||||||
"StockLegacy",
|
"StockLegacy",
|
||||||
"Stormshade",
|
"Stormshade",
|
||||||
"SweetFX",
|
"SweetFX",
|
||||||
};
|
};
|
||||||
|
|
||||||
private static string GetSearchPath(string type, string name)
|
private static string GetSearchPath(string type, string name)
|
||||||
@ -378,7 +379,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
|
|
||||||
string injectorLocation = Path.Combine(Directories.Modifications, "dxgi.dll");
|
string injectorLocation = Path.Combine(Directories.Modifications, "dxgi.dll");
|
||||||
|
|
||||||
if (!App.Settings.Prop.UseReShadeExtraviPresets && !String.IsNullOrEmpty(App.State.Prop.ExtraviReShadePresetsVersion))
|
if (!App.Settings.Prop.UseReShadeExtraviPresets && !string.IsNullOrEmpty(App.State.Prop.ExtraviReShadePresetsVersion))
|
||||||
{
|
{
|
||||||
if (Utilities.GetProcessCount("RobloxPlayerBeta") > 0)
|
if (Utilities.GetProcessCount("RobloxPlayerBeta") > 0)
|
||||||
return;
|
return;
|
||||||
@ -398,7 +399,7 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
|
|
||||||
// we should already be uninstalled
|
// we should already be uninstalled
|
||||||
// we want to ensure this is done one-time only as this could possibly interfere with other rendering hooks using dxgi.dll
|
// we want to ensure this is done one-time only as this could possibly interfere with other rendering hooks using dxgi.dll
|
||||||
if (String.IsNullOrEmpty(App.State.Prop.ReShadeConfigVersion))
|
if (string.IsNullOrEmpty(App.State.Prop.ReShadeConfigVersion))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
App.Logger.WriteLine("[ReShade::CheckModifications] Uninstalling ReShade...");
|
App.Logger.WriteLine("[ReShade::CheckModifications] Uninstalling ReShade...");
|
||||||
@ -433,43 +434,43 @@ namespace Bloxstrap.Helpers.Integrations
|
|||||||
if (injectorVersionInfo.ProductVersion != versionManifest.ReShade)
|
if (injectorVersionInfo.ProductVersion != versionManifest.ReShade)
|
||||||
shouldFetchReShade = true;
|
shouldFetchReShade = true;
|
||||||
|
|
||||||
// UPDATE CHECK - if we're upgrading to reshade 5.7.0, or we have extravi's presets
|
// UPDATE CHECK - if we're upgrading to reshade 5.7.0, or we have extravi's presets
|
||||||
// enabled with a known shader downloaded (like AlucardDH) but without stormshade downloaded (5.7.0+ specific),
|
// enabled with a known shader downloaded (like AlucardDH) but without stormshade downloaded (5.7.0+ specific),
|
||||||
// we need to redownload all our shaders fresh
|
// we need to redownload all our shaders fresh
|
||||||
if (
|
if (
|
||||||
injectorVersionInfo.ProductVersion != versionManifest.ReShade && versionManifest.ReShade == "5.7.0" ||
|
injectorVersionInfo.ProductVersion != versionManifest.ReShade && versionManifest.ReShade == "5.7.0" ||
|
||||||
App.Settings.Prop.UseReShadeExtraviPresets && Directory.Exists(Path.Combine(ShadersFolder, "AlucardDH")) && !Directory.Exists(Path.Combine(ShadersFolder, "Stormshade"))
|
App.Settings.Prop.UseReShadeExtraviPresets && Directory.Exists(Path.Combine(ShadersFolder, "AlucardDH")) && !Directory.Exists(Path.Combine(ShadersFolder, "Stormshade"))
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Directory.Delete(ShadersFolder, true);
|
Directory.Delete(ShadersFolder, true);
|
||||||
Directory.Delete(TexturesFolder, true);
|
Directory.Delete(TexturesFolder, true);
|
||||||
App.State.Prop.ExtraviReShadePresetsVersion = "";
|
App.State.Prop.ExtraviReShadePresetsVersion = "";
|
||||||
App.Logger.WriteLine("[ReShade::CheckModifications] Upgrading to ReShade 5.7.0 - redownloading all shaders!");
|
App.Logger.WriteLine("[ReShade::CheckModifications] Upgrading to ReShade 5.7.0 - redownloading all shaders!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
App.Logger.WriteLine("[ReShade::CheckModifications] versionManifest is null!");
|
App.Logger.WriteLine("[ReShade::CheckModifications] versionManifest is null!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// we're about to download - initialize directories
|
// we're about to download - initialize directories
|
||||||
Directory.CreateDirectory(BaseDirectory);
|
Directory.CreateDirectory(BaseDirectory);
|
||||||
Directory.CreateDirectory(FontsFolder);
|
Directory.CreateDirectory(FontsFolder);
|
||||||
Directory.CreateDirectory(ShadersFolder);
|
Directory.CreateDirectory(ShadersFolder);
|
||||||
Directory.CreateDirectory(TexturesFolder);
|
Directory.CreateDirectory(TexturesFolder);
|
||||||
Directory.CreateDirectory(PresetsFolder);
|
Directory.CreateDirectory(PresetsFolder);
|
||||||
|
|
||||||
// check if we should download a fresh copy of the config
|
// check if we should download a fresh copy of the config
|
||||||
// extravi may need to update the config ota, in which case we'll redownload it
|
// extravi may need to update the config ota, in which case we'll redownload it
|
||||||
if (!File.Exists(ConfigLocation) || versionManifest is not null && App.State.Prop.ReShadeConfigVersion != versionManifest.ConfigFile)
|
if (!File.Exists(ConfigLocation) || versionManifest is not null && App.State.Prop.ReShadeConfigVersion != versionManifest.ConfigFile)
|
||||||
shouldFetchConfig = true;
|
shouldFetchConfig = true;
|
||||||
|
|
||||||
if (shouldFetchReShade)
|
if (shouldFetchReShade)
|
||||||
{
|
{
|
||||||
App.Logger.WriteLine("[ReShade::CheckModifications] Installing/Upgrading ReShade...");
|
App.Logger.WriteLine("[ReShade::CheckModifications] Installing/Upgrading ReShade...");
|
||||||
|
|
||||||
{
|
{
|
||||||
byte[] bytes = await App.HttpClient.GetByteArrayAsync($"{BaseUrl}/dxgi.zip");
|
byte[] bytes = await App.HttpClient.GetByteArrayAsync($"{BaseUrl}/dxgi.zip");
|
||||||
using MemoryStream zipStream = new(bytes);
|
using MemoryStream zipStream = new(bytes);
|
||||||
using ZipArchive archive = new(zipStream);
|
using ZipArchive archive = new(zipStream);
|
||||||
archive.ExtractToDirectory(Directories.Modifications, true);
|
archive.ExtractToDirectory(Directories.Modifications, true);
|
Loading…
Reference in New Issue
Block a user