Teg_Navanis
Feb 11, 2007, 12:12 PM
New thread: http://forums.civfanatics.com/showthread.php?p=5742185#post5742185
|
View Full Version : CivPop3 - A simple Pop3 Client for Civilization Teg_Navanis Feb 11, 2007, 12:12 PM New thread: http://forums.civfanatics.com/showthread.php?p=5742185#post5742185 Teg_Navanis Feb 11, 2007, 12:25 PM Feedback welcome, especially on how to encrypt the password and fetch new mails automatically. So far, it's only possible to see the subject and the sender of messages in your inbox. Should I make them readable from withing Civ4? Dom Pedro II Feb 11, 2007, 08:39 PM Could you make a way to be able to send messages from inside the game? I think it would be a good way for mod makers to provide quick and easy bug-reporting ability to users without them having to clutter up forums threads with their issues... I've been hoping for something like that for some time. Talkie_Toaster Feb 12, 2007, 04:19 AM I realise I sound like a complete and total newb saying this, but what's Pop3? Teg_Navanis Feb 12, 2007, 06:21 AM Using the POP3 protocol, you can access most mail servers and check your mails from inside the game. @Pedro: I'll see if I can add SMTP-functionality, even though I should be working on other stuff... ;) kristopherb Feb 14, 2007, 07:34 AM I realise I sound like a complete and total newb saying this, but what's Pop3? thank god you said it not me. Ploeperpengel Apr 07, 2007, 07:31 AM Cool, finally businessmen can play civ and manage their hedgefonds at the same time!(ok maybe needs encryption first):lol: Teg_Navanis Apr 09, 2007, 07:11 AM I have quite much to do over the next month, but I might think about enhancing the mod afterwards. I could imagine implementing SMTP and encryption. Bastian-Bux Apr 10, 2007, 02:42 AM Is it possible to send mails as well? Like sending your next civ4 pbem turn? ^^ Teg_Navanis Apr 10, 2007, 04:54 AM Sending mails is what SMTP is for. I haven't implemented it yet. Caesium Apr 10, 2007, 05:16 AM Just looking forward to your next release :) Teg_Navanis May 26, 2007, 01:29 PM A quick update: I have to lay the project on ice again. I tried several approaches to loop the code in a separate thread, but on a python level, this causes serious issues with Civ4. The game hangs up when you minimize or end it. It might be possible with some C++ tweaks (or by programming the whole thing in C++), but that's way over my head. I wasn't any more successful at sending mails via python. Since I'm behind a pretty restrictive firewall at my university, I can't connect to external SMTP servers, and without the ability to test the code I write, I can't work on this feature. There might be a new version in the future, but don't count on it. If anyone else is willing/able to include the features that have been requested, he's welcome to using the code. Jeckel May 26, 2007, 09:01 PM This is a very interesting project from a python point of view and I've run into some of the same problems you mention. As for the threading thing, I've noticed that Civ seems to run pretty well in windowed mode and doesn't seem to hang much at all when I'm working in other windows. Maybe that functionality can be hijacked somehow.. don't know, just a theory.. On a more practical note, maybe using python threading is the wrong approch. Civ is already looping why not place the loop's code in the onUpdate event? Should give you the same result. Just some ideas, I liked this project from the moment I saw it and I will try to put in my build que and see what I can do. :) Teg_Navanis May 27, 2007, 08:03 AM Threading the code that checks for new mails is necessary in case there is a connection error. If you run the code in the main thread, the game would stall for ~30 seconds until the connection attempt times out. You are right, however, in saying that one could use the main loop to trigger the new thread (which then runs only once and stops until it's triggered again). I tried using a threading.Timer class to do this, but had the same problems as with an indefinitely looping thread. I could imagine some ugly hack that checks for the current time in every frame and triggers the CivPop code every 300 seconds. Or even better, the updateScreen() function seems to have this functionality already (g_szTimeText and g_iTimeTextCounter). I guess this would solve the looping problem. Teg_Navanis May 27, 2007, 02:37 PM Alright, a working loop is up and running. I'm using the time.clock() function to trigger the POP3 code. The game now only hangs when you end it while it is trying to connect to a POP3 server that doesn't exist. As soon as it times out (which is after about 30 secs), you can quit. Unsuccessful connection attempts don't affect a running game. Is is a pretty small update, but it makes using the mod more comfortable. And since I can't work on SMTP functionality any time soon, I'd better upload it than let it rot on my drive. Primax Jun 21, 2007, 03:15 AM This is some of the most interesting python modding I've seen. I have had alot of fun playing around with your code. I've been using it to send and fetch http from the civ4players site and show the results (players stats) inside civ. Just bumped the thread to let you know and to remind you of this so maybe you start playing around with it again :) Teg_Navanis Jun 22, 2007, 01:29 PM Well, I do have some good news. I escaped the clutches of a restrictive firewall and was able to successfully send an e-mail via python (using GMX). This means that I can now start working on the interface and will be able to provide a send-mail functionality sometime soon. Dom Pedro II Jun 23, 2007, 12:08 AM Well, I do have some good news. I escaped the clutches of a restrictive firewall and was able to successfully send an e-mail via python (using GMX). This means that I can now start working on the interface and will be able to provide a send-mail functionality sometime soon. :wow: :drool: I can't wait! Teg_Navanis Jun 25, 2007, 05:43 PM I replaced the PopUp with 'real' screens over the weekend and the inbox works pretty well so far (see screenshot; texts are still missing and there are some references to the unit statistics screens, which I used as base). This was the easy part. Now, can anyone point me to a good example of an edit box implementation? The necessary functions are in the API (CyGInterfaceScreen.addEditBox or .addEditBoxGFC and so on), but they are neither used in the vanilla code nor did I find them in any mods. And I'd rather understand the code from an example than using a trial-and-error approach. Teg_Navanis Jul 28, 2007, 07:03 AM I released a new version in a new thread, since the mod is now called CivMail (http://forums.civfanatics.com/showthread.php?p=5742185). The original name was apparently confusing and is no longer accurate for a mod that has both POP3 and SMTP functionality. Sadly, you still can't send mails with the newest version. While the code to send a mail is implemented, I haven't managed to actually make messages editable in-game. The new version thus only includes a (much) better Inbox and BtS compatibility. |
vBulletin® v3.6.8, Copyright ©2000-2009, Jelsoft Enterprises Ltd.