Page 1 of 1

How to use player_dl.pl ?

Posted: Sat Nov 03, 2012 1:46 am
by karl
It seems that

Code: Select all

player_dl.pl >player_dl.html
might do it .. ??

Posted: Mon Nov 05, 2012 9:53 pm
by Leaf
Not sure about the setup of this script, last time I used it (6+ years ago) someone else set it up for me.

Keep in mind the script downloads and then deletes the player file from the server.

Posted: Tue Nov 06, 2012 4:08 pm
by karl
So does have the metalforge website a page that i can go to with my browser(firefox) to download the player configuration file(s)/directory ? I think i have 2 minor characters there that i seldom use. I would like to test it at least with one of them.

Posted: Tue Nov 06, 2012 8:57 pm
by Leaf
This script is not in use on Metalforge.

It was used many years (6+) ago before the server moved to new hardware and a code base changed that resulted in the decision to *NOT* move over character files.

Posted: Wed Nov 07, 2012 6:27 pm
by karl
Short update : the script has
# Whether to delete the player's file after they download it.
$delete_player = 0;
by default
and comparing it with
# Default to not validated, until the password is checked.
$valid = 0;
it seem to mean
# Print warnings if $delete_player is enabled.
if ($delete_player) {
print <<'(END)';
<pre><font color="#FF0000">WARNING:</font>
Downloading your file will remove it from the server. If the
download fails, contact the system administrator, and they may
be able to retrieve the file.
</pre>
(END)
}
isn't enabled by default, so it is just a copy of the files, which are not up to date as there are appartment files also in the playername directory . As a cli script it should ask for username and password AND the server address to download it from. I tried with
$playername = 'karl';
$password = '6.6EQ48jC4yoA'; from the karl.pl file
AND
$password = 'MY_PASSWORD'
but the code seems to choke
if ( /^password (.*)$/ ) {
here already. I have only hacked a perl script once and that line looks like a /bin/grep OR /bin/sed syntax to me . Further research on the net seems to say that there are syntax changes from perl-5.8 to perl-5.10 and since it is really old, may not work anymore today as is.

The html page that the script spits out when
# If no file was sent, send a form and any error messages.
if (!$valid) {
as

Code: Select all

Content-Type: text/html; charset=ISO-8859-1

<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
<head>
<title>Download your player file</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>



<h3>ERROR: Invalid username or password</h3><br /><br /><h2>Download your player file:</h2><form method="post" action="http://localhost" enctype="multipart/form-data">
Character name: <input type="text" name="playername"  /><br />Character password: <input type="password" name="password"  /><br /><input type="submit" name="Download" value="Download" /><input type="reset"  name="Clear Entries" value="Clear Entries" /></form>
</body>
</html>
seems to be of no use at all ( my thttpd -V 2.25b says Error 501 POST not implemented though POST is implemented since 1.90a )