Avatar

Ace of Spades server work

gamedevpythonlinux

throughout my tenure as an system administrator for aloha.pk i did a lot of work on the servers.

exploit and bug fixes

"spadenade"

in the original aos client there was this bug where you could hold right click with the spade and then switch to the grenade, and through some mysterious spaghetti logic, the timer value for the spade got transferred over to the fuse time of the grenade, resulting in grenades that exploded instantly. it was unfair and clearly unintentional, so i patched it and angered a chunk of the community.

novel speedhack

the server accepts packets from clients telling it which way those clients are facing, same as most games. a slightly funky part is that it's 3 floats, the actual x/y/z of the player's view direction on the unit sphere, instead of 2 floats for pitch/yaw. the funkiest part though is that it wasn't normalized by the server after getting received, and it's used in player physics calculations. so it used to be that you could send unnormalized values from the client and zoom around the map.

teledestruction

that's what i'm gonna choose to call it for this section anyways. in another case of a lack of serverside validation and netcode that leaves something to be desired, the server would blindly repeat grenade-block destruction events that came from clients... when those events are only ever supposed to come from the server. we had players destroying hills and towers from the other side of the map.

other stuff

probably a dozen other fixes i've simply forgotten by now.

host work

restructuring

aloha.pk used to have a pretty awful setup. every single server was an entirely distinct directory with its own separate codebase, and back then we hosted like 20 servers. so any time you made a change to one, you had to go and make the same change to all the others. what a nightmare.

then at some point, a project called piqueserver came around. it was based off of the server software we already used, but alongside some much needed fixes and improvements, it also brought major architectural changes that broke everything. it became a good excuse for us to upgrade not just the version of python we were using, but everything. so i got to work, adding:

  • virtual environments (can you believe we didn't use that before?)
  • system monitoring, including custom monitoring that kept track of the bandwidth of every player individually, and told us who it all came from
  • a multi-tier git system, allowing for more collaboration from non-sysadmins. admittedly it's kind of jank, because git doesn't have a permission system so i had to make multiple repos and stuff. works though.
  • a proper login service, tightly integrated into the server as an alternative to the server software's default system, as opposed to how it was in pyspades, which was some hacky script that conducted brain surgery and hijacked the /login command.