Mondays, who’d have ’em?

I need to get a life. I took a 15 minute lunch break to dabble with a replacement patcher I've been slowly working away at. It actually patches files now, but I need to make it cope with the situation where the .exe file is being patched. The other exception is when the "manifest" is when files get renamed. I've got a system for handling that but I need to make it so that if the .exe or the manifest get updated then only those files get downloaded.

Codewise I've been plodding through fine-tuning and minutiae of the days issues. Achievements include: Removing server's interference with the life of smoke grenades, fixing a bug whereby a Rat's MSP waypoints wouldn't go away, and fixing a problem whereby the side imbalance went to 100% when two players were on the server.

And then I found myself trying to argue paralellism with someone who seemed to think that having a network server loop on "Are there packets? No, ok Sleep(0);" was applicable to "doing anything in networking". In the particular environment, all the networking happens asyncrhonously and you simply get messaged when a packet arrives. But, the message is just an entry on a queue, and you have to poll the queue to see if its gotten a message in it yet.

That's fine on something like a client which has a lot of non-networking work to do and only needs to check on the network periodically. But its not so good if you have a server which doesn't do much more than exchange packets. You wind up spending a lot of time looking at the queue, or if you're using Sleep(0) you spend a lot of time context-switching..

Praise before bedtime

I used to have my own little library of socket code, including a framework for building single-threaded, multi-connection polling servers (e.g. mini httpds). Sadly I seem to have lost all of that in one or more of my system moves in the last 8 or so years.

So when I sat down to start writing the simple socket manager for my little visualisation project, I was hit by a huge glut of "been there, sick of doing that". I've done that stuff so often that I felt like I was demoting myself to sous-chef. And the GUI stuff already took up way too much of my time. I actually wanted to be playing with some mapping ideas today not still trying to find an IDE/GUI to work with :)