Thread: LlamaServer FAQ
View Single Post
  #6  
Old June 22nd, 2007, 12:17 PM

llamabeast llamabeast is offline
National Security Advisor
 
Join Date: Nov 2006
Location: Oxford, UK
Posts: 5,921
Thanks: 194
Thanked 855 Times in 291 Posts
llamabeast will become famous soon enoughllamabeast will become famous soon enough
Default General FAQ

In this section:

- How does the LlamaServer work?
- What's the capacity of the LlamaServer?
- Can you tell me how to make my own AnimalServer?
- Is there anything I can do?
- Are there any known issues?

- How does the LlamasServer work?

Ooh, lots to say here! But this is for the interested only, and could be quite dull. So, the LlamaServer actually consists of 3 computers:
- A computer actually called the LlamaServer which lives in my cupboard, and in fact has no other purpose (clearly I have difficulties in prioritising my expenditures!).
- The Cambridge Student-Run Computing Facility (SCRF) machine, which is an amazing service provided by student volunteers, and hosts the website.
- A mail server, owned by my brother.
plus obviously a load of DNS servers to point at the website. You wouldn't believe how long the DNS took to sort out (various evil "free" companies inserted pop-ups, and many other such problems).

Amyway, the LlamaServer itself is a linux box (running Ubuntu), and it runs a perl program ('goLlamaServer'!) every five minutes. The program first connects to the mail server to check if there's any new e-mail and download it all (using the Perl Email Project's libraries, slightly hacked by me). Then for each e-mail it checks if there are any attachments. If there are any archives (zips etc) it unzips them. After all that it sees if it has a 2h file on its hands (it can only cope with one per e-mail).

If it does have a 2h it sticks it in a folder called savedgames/test in the dominions directory, and then runs 'dom3 --verify test', which verifies the 2h file. If the 2h file is fine (it almost always is), Dominions gives a game number and a turn number. The game numbers are all kept in a file containing details for each game, so if the game is known the 2h file is stuck in the right directory. Whatever happens it writes an e-mail back to the sender (using an excellent perl script called sendEmail which I highly recommend).

Next it contacts (ssh) the SRCF computer to see if any new admin commands have been given, and if they have it does them.

After that it sees if any games need hosting, and if they do it hosts them and sends the new files. Finally it sends updated files to the SRCF computer.

The website itself was a whole extra task. I don't think there's much point describing it though, because I probably know less than a good proportion of people here about web programming - I know exactly what was required to do the LlamaServer website and nothing more, since I looked it all up as I went.

- What's the capacity of the LlamaServer?

I don't know. It's big - maybe 100 games? PBEM has the advantage of not having much in the way of overheads.

- Can you tell me how to make my own AnimalServer?

Well, not easily. The code for the LlamaServer is several thousand lines long. In principle I'm probably happy to distribute the code if people are interested, though I'd rather just make any suggested improvements myself - it's hardly going to run out of capacity so there should be no need for any more AnimalServers for Dominions.

If you're interested in creating an equivalent for another PBEM game though, I'd be very interested in helping. It would still be a biggish job, since quite a few bits are Dominions specific. But it would probably be doable.

- Is there anything I can do?

You could organise and admin games. And you could make suggestions for improvements. That's all I can think of really. Organising games is good though.

- Are there any known issues?

Yes, unfortunately. Two I can think of.

- Very occasionally e-mails from a particular player just won't get through, or will be delayed. I don't know what's going on here - since they never actually get to my end I'm a bit stuck. Maybe it's an internet thing, or maybe the mail server is slightly dodgy. Solution: retry. If that doesn't work, ask the game admin for an extension and try again later. This is obviously potentially serious as it could cause staling, but it's only happened a few times ever.

- Very weirdly, a problem's happened twice where a particular turn file arrives in a player's inbox corrupt. On requesting a resend, the turn arrives corrupt again. But the file's fine on the LlamaServer, and if I change the e-mail address to my own and get it to resend it works fine. Solution: ask the admin to get the file sent to him (by temporarily changing the nation's e-mail address) and have him forward the file to you. The next turn the problem should have gone. This is super super weird, but fortunately also super rare.
__________________
www.llamaserver.net
LlamaServer FAQ
My mod nations: Tomb Kings and Vampire Counts
A compilation of high quality mod nations: Expanded Nations Packs
Reply With Quote
The Following 2 Users Say Thank You to llamabeast For This Useful Post: