lardbucket: pvpgn for a private lan


PvPGN for a Private LAN

Filed under: Hacks, Programming, Technology — Andy @ 10:43 pm

A few notes on setting up PvPGN (the continuation of bnetd) for a private LAN. (The reason I’m setting it up is that I don’t expect to have an Internet connection for connecting to proper, and would like to have the capabilities it provides, especially ladder games.) This post is generally much more technical than most of my previous posts, so you may want to skip it if you’re not really sure what’s going on. You won’t miss much.

So, my setup involves a router with DD-WRT, and an OLPC XO. The XO is set up using Ubuntu Intrepid on an SD card.

XO: Installed packages “build-essential”, “libz-dev”, and “cmake”. Grabbed the latest development snapshot of PvPGN (1.99 r521), and compiled it using cmake, make, sudo make install. Configuration gets installed in /usr/local/etc, other files in /usr/local/var. The PvPGN support files (also available from their download website) need to be extracted into /usr/local/var/files. Also from /usr/local/var/files, use bnftp to grab the relevant update files for the latest version. Edit /usr/local/etc/bnetd.conf to satisfaction. I also ran “chmod -R a+w /usr/local/var” and “chmod -R a+w /usr/local/etc”, though it’s likely that only the former is necessary, and not even that if you tune users properly. This was more of a quick hack than something I’d use for a long-term server. I grabbed the newest autoupdate.conf and versioncheck.conf files from the PvPGN CVS server, and uncommented the links to the files I’d downloaded in autoupdate.conf. I also found that for the StarCraft entries, I needed to create one without the version number extension, to allow earlier versions of StarCraft to update (for some reason, it wasn’t being caught by versioncheck.conf, even after I uncommented the right sections). That meant adding a line like “IX86    STAR    STAR        STAR_IX86_1xx_1161.mpq” to autoupdate.conf. Watch out for duplicate instructions for the same version but different updates though, I’m not sure what that could do. (This last portion was only useful because I am redirecting the pre-patch server to PvPGN, and wouldn’t help most people.)

Router: Set up fairly trivial wireless encryption, mainly to make it clear that the AP isn’t useful to most people. Added a static lease to dhcpd under DD-WRT’s Services menu, giving the XO a fixed IP address outside the standard DHCP address range (by MAC address). Enabled dnsmasq to let me redirect domains, adding the lines “address=/” and “address=/” to the dnsmasq configuration options, redirecting the Europe server to my XO, as well as pointing the default pre-patching server (for StarCraft, anyway) to the same location. (The other subdomains are uswest, useast, and asia.) For some reason, “Apply Settings” didn’t work for me, but “Reboot Router” after applying the settings did work.

Clients: Nothing here was necessary, but I did perform a few tests. Things worked almost immediately. Automatic updates worked fine, even from unpatched installs (of StarCraft 1.05), after adding the lines above to autoupdate.conf.

So, it should work reasonably well. I don’t feel bad about redirecting the domains, because nobody would be using the router without knowing that was the case. It’s also not really allowing illegal copies of the games, because I can make sure there’s a legitimate copy of the game for everyone connecting to the router when I give out the encryption keys. Overall, it should work out reasonably well. The one thing I’m not thrilled about is the fact that the Marvell Wi-Fi  drivers on the XO don’t seem to support Master (AP) mode. If that were the case, I could have the PvPGN server and router on one laptop, and not even need power at all, but unfortunately, that doesn’t seem like it will work at the moment.


No Comments »

No comments yet.

RSS feed for comments on this post.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

My Stuff
Blog Stuff