Setting Battle.Net Gateways on Mac OS X

Why do I need to do this?

If you're using Blizzard's Battle.Net servers, you don't. If, however, you use a bnetd or PvPGN server, you will need to configure your Battle.Net games to use that server. I've only tested this for Starcraft, although it should work for other games as well. No guarantees, of course; you fiddle with this at your own risk.

Doing it

Because you'll be fiddling with Starcraft's configuration, you should make a backup of it. In a terminal window, make a backup copy like this:

cp ~/Library/Preferences/Battle.net\ Preferences/rsrc ~/backup.rsrc

Next, you'll need some configuration settings. The best place to get these is from a friend with a Windows machine using the same bnetd server as you. Get them to run the Windows program regedit and export HKEY_CURRENT_USER\Software\Battle.net\Configuration to a .reg file.

Next, copy this to your Mac OS X machine, and run this mildly scary command, being careful to put the name of your file where it says myfile.reg:

perl -00 -pe 's/\\\s*\n\s*//gs' myfile.reg | perl -ne '/"Battle.net gateways"=hex\(7\):(.*)$/ and do { $_=$1; s/,//g; print "$_\n"; }'

This will spit out a few lines of numbers. Keep the terminal window with them in around.

Download ResEdit if you don't have it already. Run it, and open the file Hard Drive/Users/MyUserName/Library/Preferences/Battle.net Preferences. A window should appear with an HKEY resource in it. Double-click on the HKEY resource icon, and a new window will appear.

Double-click on the line that mentions Battle.net gateways, and a window will pop up with lots of hex numbers in it. Don't panic. Using the mouse and Apple-X, delete everything from that window except the initial "00 00 00 07". Now find the terminal window you left around with a big pile of numbers in it, and select all those numbers using the mouse and Apple-C. Click with the mouse after the "07" number in the window you deleted stuff from, and press Apple-V.

Close all the Resedit windows, and agree to save the modified file when it asks you.

That's it!

Test it by running Starcraft (or whatever game you wanted to play). When you select the multiplayer option with Battle.Net, your newly configured gateways should be available.

Help! It didn't work!

Don't panic. Quit Starcraft, and in a Terminal window:

cp ~/backup.rsrc ~/Library/Preferences/Battle.net\ Preferences/rsrc

This should return your settings to the way they were before.


Owen Dunn / owen@greenend.org.uk / Home