It is currently Sun Oct 20, 2019 12:38 pm


Parsing log to database

Discussion related to Turbo Sliders and beta version feedback.

Moderator: Forum Moderators

  • Author
  • Message
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

Parsing log to database

PostSun Dec 02, 2007 8:20 pm

I really wish that I could parse the information in the log.txt to my database, så that I was possible for some longterm statistic-calculations.

Well It is possible but I am not able to make it, has any of the hardcore programmers in the TS-community a solution so that f.instance the final table after each racing day can be transformed to a mysql or similar database?
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 10:29 am
  • Location: Milan (Italy)

PostSun Dec 02, 2007 8:31 pm

Yes, that's possible. You can parse logs easily with a script (any language).
If you need something without programming anything, you can download y4nn1ck's statistics script (preview- download)
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

nice

PostSun Dec 02, 2007 9:47 pm

Thanks, looks interesting :)
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

PostTue Dec 04, 2007 2:01 pm

I have some trouble now.

I want to run the server locally, and want to use my webhotel as the serverdatabase.

Therefore I need to open a local file C:\games\turbosliders18\racestats.log in autostats.php

Autostats.php is placed on the web http://..//..//autostats.php, but I seems like it does not want to open the local c:\... file. How to procede?

The http://..//autostats.php is trying to open (but apparantly not succeding)
$file = "C:/Games/turboslider18/racestats.log";

Is there anyway I can succes in this procedure, as I dont want to have local php installations, when I have a giant webhotel.
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1514
  • Joined: Sat Nov 06, 2004 7:59 pm
  • Location: Netherlands

PostTue Dec 04, 2007 2:46 pm

andershede wrote:Is there anyway I can succes in this procedure, (...)
As far as I know, nope. You will need to have at least some sort of scripting language installed on the server machine, in order to run a script.
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

PostTue Dec 04, 2007 2:57 pm

Both PHP and Mysql is installet on the web. (and all the sql-tabels created)

it is only when it comes to reading the local file, it seems to fail, as nothing happens.

When I install php on my local computer, it wont connect to the web-database, so thats not functionable either.
(and I think it would be much nicer, if all you had to have in your raceend.cmd was "http:/../.../autostats.php" but as I mentioned it seems like online autostats.phpfile wont read the local racestats.log file.)
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

.

PostTue Dec 04, 2007 3:33 pm

Got a little further, I have to use the "file":
$file = file("c:\\games\\turboslider18\\racestats.log");

But then I get an Unable to access c:\games\turboslider18\racestats.log but at least now it tries :l
Offline
User avatar

dede

Community User Level: 5

Community User Level: 5

  • Posts: 3314
  • Joined: Mon Apr 10, 2006 10:29 am
  • Location: Milan (Italy)

PostTue Dec 04, 2007 5:04 pm

I didn't understand how it's working now. Both HTTP and TS servers are running on the same machine or not? In case they are, try to put the autoserver's folder inside the WWW folder of your websever, and to use default path to link files.
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

.

PostTue Dec 04, 2007 7:48 pm

the HTTP is far away - it is something that I pay an amount for each month.

The TS is on my own Harddisk. I am not particulary interested in running a webserver on my computer each time we race TS - it seems so much more logical to use the webspace I pay for, as it has both php and mysql support.

I have received the answer from experts, that it does not seem possible to make an online script look for files on a local drive. so I must find another solution.
Offline

andershede

  • Posts: 9
  • Joined: Fri May 26, 2006 10:49 am

finally

PostWed Dec 05, 2007 1:22 am

I finally got it to work.

A remote webserver cant read a local file. That was my problem; Therefore I had to do the following. Raceend.cmd is now running a script.ftp file (a batch file for the "ftp"-dos syntax) in order to move the local file up.

In this I use the Dos-command "ftp" to connect to my remote webserver and I use "send" to upload racestats.log

After this the ftp-script ends and I call autostats.php to put the information into the database.

It is quite complicated, but I gives some pleasure in succeding.

Finally Wget.exe (a little program)takes care of running the http://..//autostats.php

So now it is possible for local games to have stats on remote servers. :)
Offline
User avatar

Wokinger

Community User Level: 3

Community User Level: 3

  • Posts: 310
  • Joined: Sat Aug 15, 2009 5:00 pm
  • Location: Chrzanów (Poland)

PostWed Sep 07, 2011 3:26 pm

What file/script/cmd create racestats.log?
Offline
User avatar

Tijny

Community User Level: 5

Community User Level: 5

  • Posts: 1514
  • Joined: Sat Nov 06, 2004 7:59 pm
  • Location: Netherlands

PostWed Sep 07, 2011 3:35 pm

Wokinger wrote:What file/script/cmd create racestats.log?
The game itself, but only if ScriptsOn is set to 1 in sliders.ini.

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron