Jacob's CTF Server

Full Version: What if CTF used different software
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Like MCGalaxy or D3 for example.

Other softwares have more much capability.

Just imagine...
Nope.
I used to think OpenCraft (foundation of CTF) was poorly coded until I saw the MCGalaxy source.
Which parts of the source code are so awful? (I know most of the games code is(
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.
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.