I actually did something cool and custom for my GMod server. It involves some CGI on my webserver, some learning of the lack of standard Lua modules in Garry’s Mod, some pointless screaming, plenty of time in a text editor, some “What about this number?”, and installing a program that was apparently missing.
I also fixed the Player Titles, but that was just a capitalization error.
So, what I did was develop a way to get a fortune. As in, the *nix command “fortune”, which I usually find in /usr/games.
First, the Lua end of the spectrum, which is the command in the server to get this fortune. All this does is listen for a ULX command (“f” in chat, or “ulx fortune” in console), get the data from a web page (in this case, a CGI script on my site), strip the headers, and echo it back, one line at a time.
The CGI script on my webserver does the background work (since my GMod server is hosted on a Windows box, which lacks fortune). First I run fortune -s, and get it’s stdout (the fortune). Then I print it onto the webpage. Hardly any work there either. Coded it in ~30 seconds, since I knew exactly how that worked. All that was left to do is flip on a CGI switch and make sure it worked. And one installing of fortune later, it did.
There is probably no security vulnerability here (unless you’re capable of screwing the system and uploading files to either half of the equation), which is why I’m blogging in-depth on it as I am.