The Wiki for Tale 5 is in read-only mode and is available for archival and reference purposes only. Please visit the current Tale 11 Wiki in the meantime.
If you have any issues with this Wiki, please post in #wiki-editing on Discord or contact Brad in-game.
Difference between revisions of "User:Numaris/Test Pass History"
(Created page with "The Test Pass History is a mostly-automated collection of all test passes that are announced in-game on the System channel. == Disclaimer == Source code linked below is pro...") |
|||
(One intermediate revision by the same user not shown) | |||
Line 7: | Line 7: | ||
== Description == | == Description == | ||
− | In Tale 4, Oujoule | + | In Tale 4, Oujoule provided a publicly-accessible CGI script that, when run, read the entirety of the System channel and parsed it into a list of test passes. It presented the results as wiki code that could be copied and pasted into a page for simple updating. Late in T4, a few changes happened in the log system, one of which was to limit the time window that can be grabbed from the log to 30 days. This broke the existing system. |
As a result, this implementation is slightly more complex. It consists of two Perl scripts and an SQLite database: | As a result, this implementation is slightly more complex. It consists of two Perl scripts and an SQLite database: | ||
Line 29: | Line 29: | ||
Most of the passes are held in the Passes table. Towers and Demi-Pharaoh have extra tables for holding more data. One table, TotalTowers, has no application in the Test Pass History, but could be interesting for anyone wishing to analyze the Towers history. | Most of the passes are held in the Passes table. Towers and Demi-Pharaoh have extra tables for holding more data. One table, TotalTowers, has no application in the Test Pass History, but could be interesting for anyone wishing to analyze the Towers history. | ||
− | The database file needs to be | + | The database file needs to be readable by the web server. |
[http://www.talescripts.org/atitdpass/dbdump.sql Nightly Database Dump] | [http://www.talescripts.org/atitdpass/dbdump.sql Nightly Database Dump] |
Latest revision as of 16:25, 26 March 2011
The Test Pass History is a mostly-automated collection of all test passes that are announced in-game on the System channel.
Disclaimer
Source code linked below is provided unlicensed and without any guarantee. It is partially documented, but contains a lot of convoluted regex magic. I am not a professional programmer. If you are, the (lack of) structure/naming conventions/etc. may make you cringe.
Description
In Tale 4, Oujoule provided a publicly-accessible CGI script that, when run, read the entirety of the System channel and parsed it into a list of test passes. It presented the results as wiki code that could be copied and pasted into a page for simple updating. Late in T4, a few changes happened in the log system, one of which was to limit the time window that can be grabbed from the log to 30 days. This broke the existing system.
As a result, this implementation is slightly more complex. It consists of two Perl scripts and an SQLite database:
getpasses.pl
This script reads the last few days of the System log, checks with the database to find out which lines are new, and matches them against patterns to figure out if they represent test passes. If so, it grabs the necessary pass data and writes it to the database. I have a cron job set up that runs this script every hour. There is no output.
printwiki.pl
This is the script that reads the pass data from the database and generates the wiki output. It is run whenever someone accesses it (via a link placed in the page itself). It obviously needs to be located where it can be executed and served by a web server.
passes.db
This is the database. My implementation uses SQLite for simplicity. The SQL is very simple; it should be trivial to modify the scripts to use any other database back end that Perl DBI supports.
Most of the passes are held in the Passes table. Towers and Demi-Pharaoh have extra tables for holding more data. One table, TotalTowers, has no application in the Test Pass History, but could be interesting for anyone wishing to analyze the Towers history.
The database file needs to be readable by the web server.