02-25-2017, 03:40 PM
Code:
if (File.Exists("MCGalaxy.update") || File.Exists("MCGalaxy_.update"))
{
try
{
if (File.Exists("MCGalaxy.update"))
{
if (File.Exists(args[0]))
{
if (File.Exists("MCGalaxy.backup"))
File.Delete("MCGalaxy.backup");
File.Move(args[0], "MCGalaxy.backup");
}
File.Move("MCGalaxy.update", args[0]);
}
}
catch (Exception e)
{
if (tries > 4)
{
UpdateFailure(e);
}
else
{
Console.WriteLine("\n\nAn error occured while updating. Retrying...\n\n");
Thread.Sleep(100);
Update(args);
}
}
Code:
if (args[0].Contains("securitycheck10934579068013978427893755755270374"))
{
args[0] = args[0].Replace("securitycheck10934579068013978427893755755270374", "");
if (args[0] == ".exe")
args[0] = "securitycheck10934579068013978427893755755270374.exe";
Console.WriteLine("Waiting for " + args[0] + " to exit...");
while (Process.GetProcessesByName(args[0]).Length > 0)
{
//Sit here and do nothing
}
}
It's mostly just the fact that so many different people have worked on it (MCSharp, MCZall, MCLawl, MCForge, MCDerp and however many I forgot) so there's a lot of variety in coding styles. That's true for every large project though unless you have strict style rules and code reviews.