![]() |
Community challenge: Automated PBEM e-mailing
Zeldor was just commenting to me by PM that it would be really good to have a program to make playing PBEM games easier. A fair few players have commented that they find the faff of PBEM a bit annoying, with a few even refusing to play PBEM games because of it. I have to say I don't find it much of an issue myself - it takes maybe 5 seconds - but depending on e-mail client etc (webmail, eek!) it could be much worse than that.
Now there is a limit to what I can do in this area, not least because I'm currently channelling all my free coding time into LlamaServer improvements (hopefully should have some exciting new features soon). So, I thought I would throw it out to the community and see what ideas people can come up with. For linux: It seems to me that it should be quite easy to come up with a nice script to automate e-mail sending. I have a perl script which does the actual sending bit, so someone would just need to create a little interface. The first time it's run it should ask for e-mail account details, the location of your dominions folder (or find it itself), and the games you're playing. Then when you run it you would just give it the name of the game whose turn you want to send off and it would do the rest. If a GUI could be added that would be excellent. Er, how do you go about making a GUI in Linux? For Windows: I know nothing about programming in Windows. But a little program with a GUI and similar operation to the one above would be awesome. For Mac: I know nothing. Receiving e-mails: A considerable improvement to the above programs would be if it also was able to check your e-mail, filter for LlamaServer (or other PBEM) e-mails, download attachments from them and put them in the right place. And then if there are any new ones, open Dominions - how cool would that be? I reckon these would be pretty quick projects for someone who knew what they were doing, and very useful. Does anyone have any thoughts about the above? Ideas as to better ways of doing it? |
Re: Community challenge: Automated PBEM e-mailing
The part I waste the most time on with llamaserver games, and BTW I wouldn't play PBEM at all if you hadn't setup the awesomeness that is llamaserver, is the amount of time it takes me to download the attachment to the right folder, open up dominions, and then reattach it when I'm ready to go.
What would give me the most time savings is if there was a single program I could run that would... 1. Download the e-mail, or fetch it from a particular place. The second part is important, I don't want to have to run the program each time just to see if the turn has hosted. Part of the fun of PBEM or Velusion's IP servers is getting the notice in the mail letting you know it has. If the program could both log into a POP account as well as check your regular e-mail client's directory, that would be best. 2. Then open up dom 3 to that game. 3. When I close down dom 3, prompt if you want to send game. That's pretty much it. That would make me a very happy camper. Llamaserver is great already though, so anything you add is just icing on the cake. Jazzepi |
Re: Community challenge: Automated PBEM e-mailing
Jazzepi, can you just explain point 1 again for me? I understand (and agree with) the bit that getting an e-mail telling you the new turn is out is fun. But I don't understand the "or fetch it from a particular place. The second part is important." bit.
I like the idea that when you close down dom3 it prompts you to ask whether you want to send the 2h file. I could almost do this myself (for Linux), if it weren't for my complete ignorance of GUI stuff, and the fact that I'm focussing on the server itself. I expect it would be easy for someone though. |
Re: Community challenge: Automated PBEM e-mailing
Coincidentally enough I was just putting the finishing touches on my own scripts that work close to what Jazz just outlined. Windows only but Linux should be easy enough. Already planned on releasing it to the community this weekend, just gotta finish testing it tomorrow. FWIW I set up a new gmail account just for this which the turns are sent from so you won't even need to configure any of that for the llamaserver if you're not too technical.
I've been using this script for a couple months and it just occurred to me to make it generic and available for all. Basically you manually download your tun to the same place every time, launch the script, it launches your Dom game, you take your turn and exit Dom, the script mails your turn to llamaserver (unless you close that window before exitting Dom). No GUI, but easy to use and it works... |
Re: Community challenge: Automated PBEM e-mailing
WOW!!
Now that is a coincidence. Can't wait to give it a try. Good work Baalz! What did you write it in? I am seriously ignorant of Windows programming, cos I've learnt most of my programming during my PhD, and the department computers use Linux. |
Re: Community challenge: Automated PBEM e-mailing
Well I've made a similar tool for domII (and later adopted it for domIII), but it has fallen into disrepair, mainly because of how neatly llamaserver handles PBEM.
Just to get an idea what the tool is about, Its a python CLI that works for Linux and Windows and requires that the host have a gmail account. I've already used it in the past to host dom-II PBEMs. The game management options look like: 1. Retreive game turns. [into dominions game folder] 2. Send new turns to players. [Distribute new turns] 3. Broadcast a message. [Send a message to all players in active game] 4. Send status notification. [send a notification of which turns are missing to players] 5. Verify that all turns are valid. [print a list of all missing or invalid turns] 6. Backup current turns. [create a backup of the turn files] 7. Reload turns from archive. [reload specific turn from backup] 8. Host game. [verify that all turns are valid, backup and then host the game] . Here is the orginal post (at the bottom of the thread) I could repair this tool and also add missing features to it and a GUI, actually it would have been nice to do but currently I'm on a tight schedule at work meaning long overtime hours so no time for this. However maybe I could be of some help to this project. |
Re: Community challenge: Automated PBEM e-mailing
I love this community. http://forum.shrapnelgames.com/images/smilies/smile.gif
Just to check I understand you Wraithlord: The way you've described your script, it sounds like it essentially performs the same tasks as the LlamaServer, i.e. kind of the opposite of what we want to make. So is the idea that your tool contains all the essential elements (especially e-mail checking and sending) that could be cannibalised into a new tool? Also, one difficulty I was anticipating with Windows is that it doesn't have a perl interpreter by default (and all my LlamaServer code is in perl). Would the same issue apply to Python? Oh, another thing - am I right in understanding that CLI means it's a command line program? Is there any way to make it easy for Windows users to use without opening a DOS window? i.e. could they just double click on it? |
Re: Community challenge: Automated PBEM e-mailing
Quote:
This would remove the need to even save the file from the attachment itself. Actually, I guess you could avoid all of this if the program was able to reach out over the internet and grab its own new copy of the turn file when you ran it and you just used the e-mail alter/turn file as only an alert. The whole idea was to remove the process of saving the attachment off the e-mail into the individual game folder. Jazzepi |
Re: Community challenge: Automated PBEM e-mailing
Jazzepi:
I think that Thunderbird has whole inbox, messages and attachments in one big file. It would be quite dangerous for it to just save attachments in any place. |
Re: Community challenge: Automated PBEM e-mailing
Quote:
Would be easier if the program just fetched a new copy of the turn when you ran it, or looked in one place. Also, it would be nice if it gave you a selection to pick from, since I'm in multiple PBEM games. Jazzepi |
Re: Community challenge: Automated PBEM e-mailing
my script is a batch file (for copying files around, launching dom, etc.) and an accompanying sendmail.exe which the bat invookes. How I have it set up is I just make a windows shortcut on my desktop for each game I'm playing and the shortcut is set to invoke the script passing in the args in for that game (game name, nation, etc). Get a turn notification, download the turn to my defauld download dir, click on the shortcut for that game and I'm good to go. I'm writing this from my phone, but when I attatch it tomorrow I'll post no brainer instructions so anybody can use it without needing a command prompt.
|
Re: Community challenge: Automated PBEM e-mailing
oh yeah, you don't have to dl it to the game folder, just the same folder ( ie c:/downloads) every time.
|
Re: Community challenge: Automated PBEM e-mailing
You're writing from a phone? Wow, I'm impressed. I hadn't quite internalised that that was really feasible yet. I sometimes feel like technology sneakily keeps on advancing when I turn my back.
|
Re: Community challenge: Automated PBEM e-mailing
The tool contains all the elements that make up the work flow of hosting a PBEM game, that's right.
The tool can be and was indeed compiled into a windows exe file. Yes, windows users can just click on it. The most important issue the tool suffers from is the dependency on gmail. Which I wanted at the time to get rid off but didn't get to. Also since gmail has changed their protocol a few months ago the tool can't perform the actual mail d/l and u/l operations. The bright side of this is that gmail protocol was changed to standard IMAP which python supports easy enough so it shouldn't be difficult to fix. |
Re: Community challenge: Automated PBEM e-mailing
Quote:
|
Re: Community challenge: Automated PBEM e-mailing
Another option is to have all turns on llamaserver, every user would have a password. The small program would download it from there, put in the right place. And after you are done it would also upload turn file there. They are really small so it should be easy. |
Re: Community challenge: Automated PBEM e-mailing
1 Attachment(s)
Ok, here’s the script I was talking about. It includes a free lightweight sendemail.exe that I downloaded from here:
http://caspian.dotconf.net/menu/Software/SendEmail/ It’s set up to send your turns to the llamaserver, though that’s easy enough to change if you want to use it for a different PBEM game. It uses a free gmail account I set up for sending the mail, so no need to configure anything. New turns will still be sent to the email address you used to join the game (you won’t get confirmation emails though, those are sent to the gmail account which sends the turns). The script assumes you download your turns into the same place every time, my example below is c:\downloads, but feel free to put it wherever you like and change that path as necessary. Unzip the zip into wherever you like, my example assumes it’s put in c:\utils, but again put it wherever you want. Now, you need to collect the following information for the game you’re playing: (1) location of your download directory (ie c:\downloads) (2) location of your dominions 3 directory (ie “c:\program files\dominion3”) (3) the game name of your nation. This will be of the form <era>_<name>, so for example late_arcoscephale. If you’re unsure what this name should be, just look at the .trn file you received. (4) The game name. If you’re unsure, just launch dominions and see what the game name is from the in-game list (it’s possible this is different than what the llamaserver game name is) (5) The location sendEmail.exe is (ie c:\utils) *note: if any of the directories in (1), (2), or (5) contain spaces you need to enclose them in quotes (ie “c:\program files\dominion3”) Next, right click on your desktop and choose new -> shortcut. In the box, type in “c:\utils\domturn.bat” (or whatever place you extracted the zip) followed by (1), (2), (3), (4) and (5). For example, my shortcut for the sloth game I’m in looks like this: C:\utils\domturn.bat c:\downloads "c:\program files\dominions" late_arcoscephale sloth c:\utils Name your shortcut to the game name to make it easy to keep track of, and if you feel like it you can even change the icon to be the dominions one through the properties menu. Now all you need to do to take your turn is download your turn into your default download directory, doubleclick on the shortcut you created, take the turn and close dominions. Note – the script does launch a DOS window, you can ignore it unless you don’t want the turn you’re taking to be emailed in which case just close it (hit the x in the top right) before you exit dominions (if you’re running in full screen mode, just hit alt-tab to bring up the DOS window so you can close it). Now that you’ve got it set up, it’s super easy to configure another game. Just copy the shortcut, right click, properties, and change the nation (ie late_arcoscephale) and game name (ie sloth). That’s it. Notes: The script moves your trn file from your downloads directory so that you won’t have to overwrite it the next time you download your turn (this also helps if you happen to be playing the same nation in more than one game). It works fine if you rerun it without downloading a new turn, it simply uses your old turn file so you can update your orders, it’ll resend when you’re done the same way as if it was a new turn. To anyone looking into the script and wondering why I do an excessive amount of cd’ing, it’s to resolve potential spaces in the path names, cd resolves things like ""c:\program files\dominions3"\savedgames\sloth" for you when you don’t know how many quotes to expect. Feel free to modify and/or repost this however you like. |
Re: Community challenge: Automated PBEM e-mailing
Not to curb the enthusiasm, but here is another worthwhile suggestion: Why not just have a web interface which offers a file upload? This is what I'd offer players on my servers, if for some inexplicable reason (firewall) they wouldn't be able to use the game network interface anymore.
Pro's: - regardless of operating system, everybody has a web browser - no binary needs to get executed by the players (security concern) - instead of complicated POP/SMTP code, all it takes is overwriting the game files on the server (after checking) - clients don't need to update their software, as all the code is on the server Con's: - no persistant storage of configuration (savegames location), although one could use cookies for that - hmmm... - makes the need to use email as transport medium for those PBEM games unnecessary? http://forum.shrapnelgames.com/image...ies/tongue.gif |
Re: Community challenge: Automated PBEM e-mailing
The thought had crossed my mind. But basically that would be about as hard as using a webmail interface, and significantly more annoying than using something like Thunderbird or Outlook, so I don't really see that it would be an advantage.
Zeldor's idea of an app which simply directly connects to the server is reasonable, but how to do it (and do it securely) is completely out of my area of knowledge, and frankly isn't something I'm especially likely to do. Also I foresee firewall problems if I end up inside a university network again (the same issue applies to a web interface as well). The ultimate thing I could do would make the LlamaServer pretend to be a dominions network server. But also very unlikely - the amount of work required would definitely not be justified by the return on time saved by users. I'm really excited by Baalz's script - thanks Baalz! It sounds quite excellent - quite a significant timesaver. I'll take a look at it as soon as I get round to booting in Windows, and maybe it will inspire me to knock up something similar for Linux. We should also post in the MP forum so people actually find it. |
Re: Community challenge: Automated PBEM e-mailing
Feel free to put it with the llamaserver instructions as it's set up as is to mail there.
|
All times are GMT -4. The time now is 12:46 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.