Whitespace formatting, move Integrations folder

This commit is contained in:
pizzaboxer 2023-03-08 21:25:40 +00:00
parent 92c420d888
commit cc22ee1591
4 changed files with 44 additions and 41 deletions

View File

@ -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
{ {

View File

@ -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
{ {
@ -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);

View File

@ -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
{ {

View File

@ -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
{ {
@ -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);