Skip to content

Commit

Permalink
Fixed an issue with could lead to mac address not getting populated a…
Browse files Browse the repository at this point in the history
…nd accounts getting banned
  • Loading branch information
Dean2k committed Mar 25, 2024
1 parent a416ee2 commit 6c27495
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 38 deletions.
2 changes: 1 addition & 1 deletion SARS/AvatarSystem.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 15 additions & 11 deletions SARS/AvatarSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void CheckFolders()
CreateDirectoryIfNotExist(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ARC"));
CreateDirectoryIfNotExist(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ARC", "AssetRipper"));
CreateDirectoryIfNotExist(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ARC", "VRCA"));
CreateDirectoryIfNotExist(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ARC", "Images"));
CreateDirectoryIfNotExist(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "ARC", "Images"));
}

private void AvatarSystem_Load(object sender, EventArgs e)
Expand All @@ -87,6 +87,11 @@ private void CheckRipped()
StaticValues.RippedList.Save();
}

private void CheckUnity()
{

}

private void LoadSettings()
{
cbThemeColour.Text = StaticValues.Config.Config.ThemeColor;
Expand All @@ -113,6 +118,7 @@ private void LoadSettings()
StaticValues.Config.Config.MacAddress = EasyHash.GetSHA1String(new byte[] { (byte)rnd.Next(254), (byte)rnd.Next(254), (byte)rnd.Next(254), (byte)rnd.Next(254), (byte)rnd.Next(254) });
StaticValues.Config.Save();
}

if (!string.IsNullOrEmpty(StaticValues.Config.Config.PreSelectedAvatarLocation))
{
txtAvatarOutput.Text = StaticValues.Config.Config.PreSelectedAvatarLocation;
Expand Down Expand Up @@ -161,7 +167,7 @@ private void btnSearch_Click(object sender, EventArgs e)
{
limit = "500";
}
if (_cookies==null)
if (_cookies == null)
{
MessageBox.Show("Please enter your login with discord first.");
return;
Expand Down Expand Up @@ -2605,7 +2611,7 @@ private void btnTranslateApp_Click(object sender, EventArgs e)
private void btnAddPublic_Click(object sender, EventArgs e)
{
if (StaticValues.Config.Config.AuthKey == null) { MessageBox.Show("login with an alt first"); }
if(!txtSearchTerm.Text.Contains("avtr_")) { MessageBox.Show("please enter an avatar id first"); }
if (!txtSearchTerm.Text.Contains("avtr_")) { MessageBox.Show("please enter an avatar id first"); }
VRChatCacheResult vRChatCacheResult = GetDetails(txtSearchTerm.Text);

if (vRChatCacheResult != null)
Expand All @@ -2627,7 +2633,7 @@ private void CookieChecker_Tick(object sender, EventArgs e)
StaticValues.Config.Save();
if (StaticValues.Config.Config.CookieAuth != null && StaticValues.Config.Config.ApiKey != null)
{
if(_cookies == null)
if (_cookies == null)
{
_cookies = new CookieContainer();
}
Expand All @@ -2639,7 +2645,7 @@ private void CookieChecker_Tick(object sender, EventArgs e)

private void AvatarSystem_Shown(object sender, EventArgs e)
{


typeof(DataGridView).InvokeMember("DoubleBuffered", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.SetProperty, null, avatarGrid, new object[] { true });
string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
Expand All @@ -2663,7 +2669,7 @@ private void AvatarSystem_Shown(object sender, EventArgs e)
{
StaticValues.Config = new ConfigSave<Config>(StaticValues.ConfigLocation);
}
catch (Exception ex)
catch
{
MessageBox.Show("Error with config file, settings reset");
if (File.Exists(StaticValues.ConfigLocation))
Expand Down Expand Up @@ -2713,11 +2719,9 @@ private void AvatarSystem_Shown(object sender, EventArgs e)
}

tabControl.SelectedIndex = 0;
try
{
LoadSettings();
}
catch { Console.WriteLine("Error loading settings"); }

LoadSettings();

if (string.IsNullOrEmpty(StaticValues.Config.Config.HotSwapName2022))
{
int randomAmount = RandomFunctions.random.Next(8);
Expand Down
44 changes: 22 additions & 22 deletions SARS/AvatarSystem.resx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="btnToggleFavorite.Location" type="System.Drawing.Point, System.Drawing">
<value>251, 460</value>
<value>251, 457</value>
</data>
<data name="btnToggleFavorite.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 35</value>
Expand Down Expand Up @@ -151,7 +151,7 @@
<value>Bottom, Left</value>
</data>
<data name="btnSearchFavorites.Location" type="System.Drawing.Point, System.Drawing">
<value>125, 460</value>
<value>125, 457</value>
</data>
<data name="btnSearchFavorites.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 35</value>
Expand Down Expand Up @@ -274,7 +274,7 @@
<value>Bottom, Left</value>
</data>
<data name="btnRipped.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 460</value>
<value>0, 457</value>
</data>
<data name="btnRipped.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 35</value>
Expand Down Expand Up @@ -724,7 +724,7 @@
<value>Bottom, Left</value>
</data>
<data name="btnBrowserView.Location" type="System.Drawing.Point, System.Drawing">
<value>377, 460</value>
<value>377, 457</value>
</data>
<data name="btnBrowserView.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 35</value>
Expand Down Expand Up @@ -1150,7 +1150,7 @@
<value>Vertical</value>
</data>
<data name="avatarGrid.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 454</value>
<value>840, 451</value>
</data>
<data name="avatarGrid.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand Down Expand Up @@ -1189,7 +1189,7 @@
<value>False</value>
</data>
<data name="txtAvatarSizeQuest.Location" type="System.Drawing.Point, System.Drawing">
<value>710, 469</value>
<value>710, 466</value>
</data>
<data name="txtAvatarSizeQuest.Size" type="System.Drawing.Size, System.Drawing">
<value>129, 29</value>
Expand All @@ -1216,7 +1216,7 @@
<value>True</value>
</data>
<data name="metroLabel9.Location" type="System.Drawing.Point, System.Drawing">
<value>710, 451</value>
<value>710, 448</value>
</data>
<data name="metroLabel9.Size" type="System.Drawing.Size, System.Drawing">
<value>127, 19</value>
Expand Down Expand Up @@ -1246,7 +1246,7 @@
<value>True</value>
</data>
<data name="metroLabel8.Location" type="System.Drawing.Point, System.Drawing">
<value>573, 450</value>
<value>573, 447</value>
</data>
<data name="metroLabel8.Size" type="System.Drawing.Size, System.Drawing">
<value>107, 19</value>
Expand Down Expand Up @@ -1291,7 +1291,7 @@
<value>False</value>
</data>
<data name="txtAvatarSizePc.Location" type="System.Drawing.Point, System.Drawing">
<value>563, 469</value>
<value>563, 466</value>
</data>
<data name="txtAvatarSizePc.Size" type="System.Drawing.Size, System.Drawing">
<value>129, 29</value>
Expand Down Expand Up @@ -2020,10 +2020,10 @@
<value>17</value>
</data>
<data name="metroTabPage2.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 36</value>
<value>4, 35</value>
</data>
<data name="metroTabPage2.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 512</value>
<value>840, 513</value>
</data>
<data name="metroTabPage2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
Expand Down Expand Up @@ -2356,10 +2356,10 @@
<value>12</value>
</data>
<data name="metroTabPage3.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 36</value>
<value>4, 35</value>
</data>
<data name="metroTabPage3.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 512</value>
<value>840, 513</value>
</data>
<data name="metroTabPage3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand Down Expand Up @@ -2389,7 +2389,7 @@
<value>20, 20</value>
</data>
<data name="faq.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 512</value>
<value>840, 513</value>
</data>
<data name="faq.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
Expand All @@ -2407,10 +2407,10 @@
<value>2</value>
</data>
<data name="metroTabPage5.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 36</value>
<value>4, 35</value>
</data>
<data name="metroTabPage5.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 512</value>
<value>840, 513</value>
</data>
<data name="metroTabPage5.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
Expand Down Expand Up @@ -2593,10 +2593,10 @@
<value>6</value>
</data>
<data name="btnScanCache.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
<value>4, 35</value>
</data>
<data name="btnScanCache.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 510</value>
<value>840, 513</value>
</data>
<data name="btnScanCache.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
Expand Down Expand Up @@ -3136,10 +3136,10 @@ you don't risk your account)
<value>7</value>
</data>
<data name="metroTabPage7.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
<value>4, 35</value>
</data>
<data name="metroTabPage7.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 510</value>
<value>840, 513</value>
</data>
<data name="metroTabPage7.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
Expand Down Expand Up @@ -3547,10 +3547,10 @@ you don't risk your account)
<value>15</value>
</data>
<data name="metroTabPage8.Location" type="System.Drawing.Point, System.Drawing">
<value>4, 38</value>
<value>4, 35</value>
</data>
<data name="metroTabPage8.Size" type="System.Drawing.Size, System.Drawing">
<value>840, 510</value>
<value>840, 513</value>
</data>
<data name="metroTabPage8.TabIndex" type="System.Int32, mscorlib">
<value>8</value>
Expand Down
10 changes: 8 additions & 2 deletions SARS/Modules/ArcClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ public static void SelectFile2022(ConfigSave<Config> configSave)
//Get the path of specified file
filePath = openFileDialog.FileName;
}

if (string.IsNullOrEmpty(filePath))
{
return;
}
var versionInfo = FileVersionInfo.GetVersionInfo(filePath);

if (!versionInfo.FileVersion.Contains("2022.3.6"))
Expand Down Expand Up @@ -211,7 +214,10 @@ public static void SelectFile2019(ConfigSave<Config> configSave)
//Get the path of specified file
filePath = openFileDialog.FileName;
}

if (string.IsNullOrEmpty(filePath))
{
return;
}
var versionInfo = FileVersionInfo.GetVersionInfo(filePath);

if(!versionInfo.FileVersion.Contains("2019.4.31"))
Expand Down
4 changes: 2 additions & 2 deletions SARS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.19.7.69")]
[assembly: AssemblyFileVersion("1.19.7.69")]
[assembly: AssemblyVersion("1.19.8.70")]
[assembly: AssemblyFileVersion("1.19.8.70")]
6 changes: 6 additions & 0 deletions VRChatAPI-New/Modules/Game/VRCA.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,13 @@ private static WebClient SetupWebClient(bool bypass)
webClient.Headers.Add("user-agent", "VRC.Core.BestHTTP");
webClient.Headers.Add("X-Unity-Version", StaticGameValues.UnityVersion);
webClient.Headers.Add("X-Store", StaticGameValues.Store);
if(string.IsNullOrEmpty(StaticGameValues.MacAddress) || string.IsNullOrEmpty(StaticGameValues.GameVersion) || string.IsNullOrEmpty(StaticGameValues.ServerVersion) || string.IsNullOrEmpty(StaticGameValues.UnityVersion) || string.IsNullOrEmpty(StaticGameValues.Store))
{
MessageBox.Show("A needed value is blank, please restart ARC");
return null;
}
}

return webClient;
}
}
Expand Down
5 changes: 5 additions & 0 deletions VRChatAPI-New/StaticGameValues.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ internal static void CheckSetup()
{
throw new NotSetup("Please ensure you run the SetupDownloader function first.");
}

if(StaticGameValues.MacAddress == null)
{
throw new NotSetup("Mac address is null, this will lead to client bans, please populate");
}
}
}
}

0 comments on commit 6c27495

Please sign in to comment.