02-16-2017, 08:42 PM
02-19-2017, 10:28 PM
Nope.
02-19-2017, 11:10 PM
I used to think OpenCraft (foundation of CTF) was poorly coded until I saw the MCGalaxy source.
02-24-2017, 06:04 PM
Which parts of the source code are so awful? (I know most of the games code is(
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.
02-25-2017, 07:58 PM
Fair enough. And yeah that updater code is very ugly, I'd completely forgotten about it. Cleaned it up and happy to clean up any other ugly parts of the code.