View Single Post
  #939  
Old April 14th, 2006, 02:47 AM
Ygorl's Avatar

Ygorl Ygorl is offline
Captain
 
Join Date: Jun 2004
Location: Rhode Island
Posts: 822
Thanks: 0
Thanked 0 Times in 0 Posts
Ygorl is on a distinguished road
Default Re: Turn 66

The PBEM stuff is all AppleScript (though it does make some calls to bash). The code that maintains the TCP/IP server is a bash script:

Code:

#!/bin/bash
dom2up=$(ps -xc | grep dominions2)
if [ ${#dom2up} = 0 ]; then
cd ~/Desktop/Dominions\ II/dominions2.app/Contents/Resources/
../MacOS/dominions2 -T -S --port 2247 -q --hours 120 -M conceptbalance_pretenders_5_2.dm (no linebreak)
-M heroes1_2.dm --postexec ~/dominions2/RAND2posthost.app RAND2
fi



that is run every minute by cron. If the server dies, it pops right back up (Weeble-like). There's probably a simple elegant way to account for more than one instance of dom2 (which I am presently not doing) but since I'm only running one game I didn't bother.

The PBEM scripts are, not surprisingly, much more involved.
Reply With Quote