Collecting log data

BlitzMax Forums/BlitzMax Programming/Collecting log data

Grey Alien(Posted 2011) [#1]
Hi all, I'm adding a log to my latest game so that beta testers can send back log info. They could send it back several ways:

1) Manually find the log file (not easy due to proper save file locations in Vista/Win7) and email it to me.
2) I launch the default email program and either a) paste the log into it in a format that I can copy/paste into Excel or b) auto-attach the file (not sure if that's even possible). A potential problem with this is that the default mail program might not actually be the one they are using, but that won't be too common.
3) Send it via the Internet somehow (store online?), but I'm a total noob at this and think it might take too long to figure out.
4) Use an Internet database and send the records off to that.

Any other ideas?

Also does anyone have any BlitzMax code to do no.2 the email thing? I really don't have long to implement this so I'm looking for something quick and dirty.

Thanks!


GfK(Posted 2011) [#2]
There's some code to send e-mail in the code archives (I think BlitzSupport wrote it). You could use that so all the tester has to do is click a button, it attaches the logfile and sends it automatically. Like, witchcraft.

[edit] http://www.blitzbasic.com/codearcs/codearcs.php?cat=4

Plenty of examples in there. Turns out James' one is 9 years old!

Last edited 2011


Gabriel(Posted 2011) [#3]
They grow up so fast.


Grey Alien(Posted 2011) [#4]
Thanks! I shoulda looked there. I don't see any that attach a file, but I should be able to paste the file into the email body which is OK, just not as neat.


Grey Alien(Posted 2011) [#5]
OK so I tried out MaxMail ( http://www.blitzbasic.com/codearcs/codearcs.php?code=2165 )

But I'm still noobish. What do I enter for MailHost? I guess that's my ISP if it's on my PC, but what about on beta testers' PCs? Can I auto-detect their mailhost somehow?


Grey Alien(Posted 2011) [#6]
I discovered this command line function: start mailto:xxx@...

and I figure I must be able to call a command line function from Blitzmax somehow (need to research).

The problem is I can't get it to accept a body with:

mailto:xxx@...

or

mailto:xxx@...

Anyone know what I'm doing wrong? Thanks!


xlsior(Posted 2011) [#7]
Whether or not the start mailto: thing works is entirely dependend on which client is registered as teh default mail handler under windows...

whether the 'subject' part works also depends on the mailclient...

I used Eurora for a mailclient for years, and it always puked on those 'subject' parameters.

Currently I'm using vista's Windows Mail under Windows 7, and the 'mailto' doesn't work at all on my machine...

Bottom line: while using the mailto: may work on many systems, you're bound to have issues with it on some.


Grey Alien(Posted 2011) [#8]
OK thanks, well worth knowing.


col(Posted 2011) [#9]
is it not possible to spew the log into an 'output' window of some kind, or even into a hidden 'buffer', maybe have a button or a keypress to display the log, then have them copy and paste the info themselves into their own email client of choice and give them an email address to send it to?

if they dont know how to 'copy and paste'.....then i dont know :0)


BlitzSupport(Posted 2011) [#10]
The email option is really tricky because your users WILL have to enter their own ISP's email server details, plus many SMTP servers now require authentication (which my code doesn't do... things were so different 9 years ago!) and many also require you to first log into your POP3 server first.

I'd say the best option would be to have some kind of PHP script on your web server that acts like an upload form (you know, the kind where you'd normally select a file from a dialog box, except in this case you'd send the filename programmatically).

Alternatively, if you have a machine that's always on, or a web server you can run Blitz executables on, why not run a server that your client program can connect to and send its data?


Yan(Posted 2011) [#11]
There's still the odd open relay out there you could use*. Alternatively, setting up a webmail account that offers an SMTP server is an option and adding SMTP AUTH is easy.

However, as you obviously have hosting, I'm in agreement with Mr Boyd. Simply knock up a SS script to suck up the data and 'sendmail' it to yourself.

[edit]
*Do ISPs still blacklist open relays?
[/edit]

Last edited 2011


Grey Alien(Posted 2011) [#12]
Thanks for the info everyone. Yeah webmail is an option I guess, that would get me going quickly. Doing something server side sounds best but alas I don't have any of the required skills.


Corum(Posted 2011) [#13]
I vote for method #4.
It's actually the simplest one, considering the big amount of working examples around the web.
With Brucey's Libcurl porting you can simulate an http POST to a simple php script, or even to a basic html page containing a form for file upload.
You could even consider a straight upload to an ftp account.


Grey Alien(Posted 2011) [#14]
yay, with the help of a friend (cough...Indiepath...cough) and some googling I ended up with a php script that sends the xml log file to me as an email attachment. This rocks.


Grey Alien(Posted 2011) [#15]
Uh, except I found out there's an approx 2K limit on what I can send via a URL. So I guess I'll need to FTP it first and then call the PHP to email it to myself. Scanning archives for FTP examples...


Grey Alien(Posted 2011) [#16]
OK found this FTP Client and had to make some changes for it to work on my server (posted them in the comments). Anyway, it's all working now! Game makes XML, Blitmaz FTPs it to my site, the BlitsMax uses OpenURL() to call a php script that emails it to me as an attachment. Then I open it in Excel and it formats it really nice with filters. It's soooo good. Now all I need is to find some match-3 beta testers...


Mr. Write Errors Man(Posted 2011) [#17]
2K URL limit? =//

If you use POST, the only limit is the setting on server. Probably the setting is closer to 2 gigs than kilos.


Corum(Posted 2011) [#18]
@Mr. Write Errors Man: Exactly! That's the reason why I suggested a POST request. :)

@GreyAlien: isn't easier to POST a file to a simple php page which, after receiving it, operates an auto-forward to your e-mail? Having a db on your web host, you could manage a simple user authentication by checking a table with your testers emails before file storage and delivery, to avoid eventual boredom from the usual internet donkeys.

Libcurl is there for this kind of stuff. After finishing my first Monkey little game, I'll embrace this task for a little fun. ;)

Anyway, if you're operational this way, let it go. :)


Grey Alien(Posted 2011) [#19]
I am tempted to convert to using POST and I can always shut down the receiving code after the beta test to avoid abuse. There's just no real time for me to spend doing this as I have about 100 hours of work to do this week.


xlsior(Posted 2011) [#20]
Another potential problem with sending out email, is that many servers nowadays refuse messages originating at known dynamic IP's (dialup/dsl/cable IP addresses) in an attempt to prevent spam bots from getting through.


TartanTangerine (was Indiepath)(Posted 2011) [#21]
(cough...Indiepath...cough)


My "Being a tosser" days stopped on 26th Jan 2010 - Really glad to help out and please let me know if you need more "Server side" help :)

www.indiepath.com - Solutions for Startups...


Grey Alien(Posted 2011) [#22]
@Indiepath: I certainly will thanks Tim, you are a goldmine of such information.