Admin Control Panel 4!
This is a feature that most of our players don’t get to see or interact with. It’s built solely for our staff which consists of only about 14-20 people at any one time.
And yet a lot of work over the years has gone into it. On the 5th of January 2017 I set out to modernise our ACP. The previous versions (ACP 2 and 3) were based off the same code I wrote in 2012 and since then the complexity of the ACP has increased so much that it was suffering from spaghetti code.
That’s where as a programmer you try to add some new features to something that was never designed to be able to do it so you shoe-horn it in instead of rewriting things and doing it properly. It’s a very bad way to do things but it’s quick in the short term.
So I took five days away over the past week and I was able to rewrite the ACP, it does share a little bit of code (some of the interface code which weren’t problem causers) but the entire backend and I do mean everything there has been rewritten.
ACP 3 was 5,050 lines of code. Which is just insanity for the features it has, there was so much code re-use causing bloat and just .. it was terrible and it was becoming impossible to add new features because just finding insertion points was taking hours for even basic new features.
ACP 4 keeps all the same functionality as the previous ACP 3 but with the rewrite is able to reintroduce them in just 1097 lines of code. a 5x decrease. And now it’s fully modular, no spaghetti code and designed for whatever happens in our future. The time I took to do this was an investment and it was necessary.
Code refactoring isn’t fun, it’s pretty boring so I did add a few new features here and there to keep it interesting and I’m going to detail them below.
- The new ACP now does everything in-page using AJAX. That means the page doesn’t refresh to do anything.
- All of the data that loads into the ACP is loaded using jquery so the page itself loads in just a few milliseconds and then populates with the data it has to show.
- It only loads things you actually interact with, for example the game chat log, ACP action log etc only load when expanded.
- Unified code base with our in-game commands /kick /ban /mute /note and so on now all share the exact same code (literally the same files get accessed) as what the ACP website uses. This saves time when introducing new actions and keeps things consistent.
- The online player view has been remade, the old one was a bit buggy and looked bad, the new one is bug free and shows the data much nicer.
Right now it looks mostly the same as ACP 3 but that’s mostly due to ACP 3 being upgraded over time from its debut in 2013 and partly due to me working on fixing all the code behind the scenes, over time ACP 4 will gain a new look all to itself and the foundation we have now will enable me to do that without needing me spending a great deal of time on it.
Now I thought some of you may find it interesting to see how the ACP looked in 2012, 2013-2015 and the new 2016 v4. Check out the pics below!
Click to open the images in a new tab and view them full sized.
I don’t have any pictures of ACP 1 but it wasn’t much to look at, just a basic HTML form and a dropdown box and that was it, it had no styling of any kind and its features were beyond basic.
One of the key differentials between our control panel and commercially available ones is the tight integration with our sites, servers, services and custom plugins.
Most control panels do not allow you to manage all of your servers on a single web page, we have total integration there with combined online player information (highlighted by colour to indicate which server the person is chatting from or connected to.)
We can also perform singular rank changes from the Set Rank button and have it apply to all four servers just like with Mutes, Kicks and Bans. And in-fact our ACP fully integrates with the command versions of these actions in-game so when a staff member bans, kicks or mutes a player it logs it on that staff members action log, our main ACP log and the players log.
This history allows us to see what happened at any time. We also can view the items you purchase on our shop or from auctions, honeypots that get broken and more. All of this added integration makes it very powerful and a great tool for our staff which is why it’s important we keep investing in making it better for them.
One of the big problems with our previous ACP was load times. When you loaded it sometimes it could take up to 2-3 seconds to load initially and any action you performed (kicks, bans, notes, player lookups etc) made the entire ACP reload to perform your action. This made it feel very sluggish and in-fact it was very CPU intensive to idle on the page.
The new v4 platform solves these issues and less frustrated staff members makes for a happier server overall.
I hope you enjoyed this look into the new Admin Control Panel, I know most of you will never actually get to use it but I think it’s important for you to see that we’re fully committed to our community, tools like this don’t get made for fly-by-night operations, they get made by people who can see the value they will bring in the future.