I should mention here for anybody who might be looking through these forums... This is from a very old old code-base version of Hacker's Edge, when it was still going to be a web-based online hacking game, and not a terminal one, which is seen today. In fact, none of the code you see in that source code is in use any more on this website.
I may open source the first iteration of the terminal based Hacker's Edge one day, as it is no longer being used, and I doubt anybody will use it to create their own version of this game... That version used both a full Telnet and SSH server, and thus each player had a user account on the server which was ulimited for security. This meant, that every player that was connected, took a good chunk of both CPU and memory usage.
After noticing how much traction of a terminal-based Hacker's Edge was getting, I knew that building out the game in this manner wouldn't scale very well... Which lead me to develop the current iteration of Hacker's Edge, still terminal-based, but functions much differently and is more CPU and memory conservative. On top of that, multi-user components are easier to implement, as are server-side in-game events. Also, unlike the previous terminal version, there is more persistence. In the last iteration, there was no perpetual game server running 24/7, so when a player disconnected, nothing could still run in the background. This was a big deal breaker, especially if I wanted to keep the virtual world running even if nobody was connected.
So, there you have it, yet another history lesson on how Hacker's Edge has progressed over the many years since 2012. Now it being 2016, hopefully with the new code release going out today, the cogs can really start moving.