This repository has been archived by the owner on Jan 14, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added network reset and stuff, also more regedit stuff. Won't be making a GUI edition because it is pointless.
- Loading branch information
Showing
9 changed files
with
148 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VRC_Deep_Clean.Utils | ||
{ | ||
internal class NetworkUtils | ||
{ | ||
public static void Reset() | ||
{ | ||
DoCommand("ipconfig /release"); | ||
DoCommand("ipconfig /renew"); | ||
DoCommand("netsh winsock reset"); | ||
DoCommand("netsh int ip reset"); | ||
} | ||
|
||
private static void DoCommand(string command) | ||
{ | ||
CustomLog.Warn("Doing a network reset..."); | ||
CustomLog.Log($"Command: {command}"); | ||
|
||
ProcessStartInfo PSI = new("cmd", "/c " + command) | ||
{ | ||
RedirectStandardOutput = true, | ||
RedirectStandardError = true, | ||
UseShellExecute = false, | ||
CreateNoWindow = true | ||
}; | ||
|
||
using Process process = new(); | ||
process.StartInfo = PSI; | ||
process.Start(); | ||
|
||
string output = process.StandardOutput.ReadToEnd(); | ||
string error = process.StandardError.ReadToEnd(); | ||
|
||
process.WaitForExit(); | ||
|
||
if (process.ExitCode != 0) | ||
{ | ||
CustomLog.Error($"{command} failed!\nError: {error}"); | ||
} | ||
|
||
CustomLog.Log(output); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace VRC_Deep_Clean.Utils | ||
{ | ||
internal class UpdateUtils | ||
{ | ||
public static void Check() | ||
{ | ||
//Manual cuz I'm lowkey lazy | ||
Console.Clear(); | ||
CustomLog.Logo(); | ||
CustomLog.SetWorkingTitle("Redirecting to github..."); | ||
CustomLog.Log("Opening github..."); | ||
try { Process.Start(Batch.OpenGH); } | ||
catch { CustomLog.Error("Failed to redirect to github please visit manually at my website or: https://github.com/scrim-dev/VRC-Deep-Clean/releases"); } | ||
Thread.Sleep(4000); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters