summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/adler32.c1
-rw-r--r--tools/tmxcopy/main.cpp2
-rw-r--r--tools/tmxcopy/map.cpp1
-rw-r--r--tools/tmxcopy/map.hpp9
-rw-r--r--tools/upalyzer/analyze.php35
5 files changed, 32 insertions, 16 deletions
diff --git a/tools/adler32.c b/tools/adler32.c
index cd85d58e..5dd7e4c1 100644
--- a/tools/adler32.c
+++ b/tools/adler32.c
@@ -10,6 +10,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <zlib.h>
+
/**
* Calculates the Adler-32 checksum for the given file.
*/
diff --git a/tools/tmxcopy/main.cpp b/tools/tmxcopy/main.cpp
index ab67afe6..ac18ce04 100644
--- a/tools/tmxcopy/main.cpp
+++ b/tools/tmxcopy/main.cpp
@@ -27,7 +27,7 @@ int main(int argc, char * argv[] )
// parsing command line options
if (argc < 9 || argc > 10)
{
- std::cerr<<"Usage: srcFile x y width height tgtFile x y [outfile]";
+ std::cerr<<"Usage: srcFile x y width height tgtFile x y [outfile]\n";
return -1;
}
diff --git a/tools/tmxcopy/map.cpp b/tools/tmxcopy/map.cpp
index 92e661fd..d9fc8ada 100644
--- a/tools/tmxcopy/map.cpp
+++ b/tools/tmxcopy/map.cpp
@@ -22,6 +22,7 @@
#include <map>
#include <list>
+#include <string.h>
#include <zlib.h>
#include "xmlutils.h"
diff --git a/tools/tmxcopy/map.hpp b/tools/tmxcopy/map.hpp
index 89ae1405..2ca9061a 100644
--- a/tools/tmxcopy/map.hpp
+++ b/tools/tmxcopy/map.hpp
@@ -1,20 +1,19 @@
/*
* TMXCopy
- * Copyright 2007 Philipp Sehmisch
+ * Copyright (C) 2007 Philipp Sehmisch
*
- *
- * TMXCopy is free software; you can redistribute it and/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* any later version.
*
- * TMXCopy is distributed in the hope that it will be useful,
+ * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with TMXCopy; if not, write to the Free Software
+ * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
diff --git a/tools/upalyzer/analyze.php b/tools/upalyzer/analyze.php
index 106fcbb5..43057af1 100644
--- a/tools/upalyzer/analyze.php
+++ b/tools/upalyzer/analyze.php
@@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
header("Content-type: text/html");
-header("Cache-Control: no-store, no-cache, must-revalidate");
+header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
@@ -31,6 +31,8 @@ header("Pragma: no-cache");
List of current updates:
<?php
+$download_url_base = 'http://updates.themanaworld.org/tmwdata/';
+$checkout_path = '/home/eathena/public_html/updates/tmwdata/';
$update_file = array_filter(array_reverse(file('resources2.txt')));
$updates = array();
$update_file_maxlen = 0;
@@ -62,16 +64,20 @@ foreach ($update_file as $update_line)
$update['uncompressed_size'] += zip_entry_filesize($zip_entry);
$entry_name = zip_entry_name($zip_entry);
$entry_size = zip_entry_compressedsize($zip_entry);
+ $entry_exists = file_exists($checkout_path . $entry_name);
$entry_used = !array_key_exists($entry_name, $update_entries);
$entries[$entry_name] = array(
'name' => $entry_name,
'size' => $entry_size,
- 'used' => $entry_used);
+ 'used' => $entry_used,
+ 'obsolete' => !$entry_exists);
$update['size'] += $entry_size;
if ($entry_used) {
- $update['used_entry_count']++;
- $update['used_size'] += $entry_size;
+ if ($entry_exists) {
+ $update['used_entry_count']++;
+ $update['used_size'] += $entry_size;
+ }
$update_entries[$entry_name] = $update;
}
@@ -107,7 +113,7 @@ function print_update_name($update, $pad = true)
foreach (array_reverse($updates) as $update)
{
print_update_name($update);
- echo ' '. $update['adler32'];
+ printf(" %8s", $update['adler32']);
printf(" %4d kb", $update['filesize'] / 1024);
if (!$update['zip_error']) {
printf(" %4d kb", $update['uncompressed_size'] / 1024);
@@ -140,8 +146,14 @@ ksort($update_entries);
foreach ($update_entries as $entry => $update)
{
- printf("%-{$update_entry_maxlen}s ", $entry);
- print_update_name($update, false);
+ $exists = file_exists($checkout_path . $entry);
+ printf("<span style=\"color: %s;\">%-{$update_entry_maxlen}s</span> ",
+ $exists ? "black" : "rgb(100,100,100)",
+ $entry);
+ print_update_name($update, true);
+
+ if ($exists && substr($entry, strlen($entry) - 1) != '/')
+ printf(' <a href="%s%s">download</a>', $download_url_base, $entry);
echo "\n";
}
@@ -153,10 +165,13 @@ foreach (array_reverse($updates) as $update)
print "\n<a name=\"".$update['file']."\"/><b>".$update['file']."</b>\n";
foreach ($update['entries'] as $entry_name => $entry) {
- printf("%-{$update_entry_maxlen}s", $entry_name);
- if ($entry['used']) {
+ printf("%s%-{$update_entry_maxlen}s%s",
+ $entry['obsolete'] ? "<span style=\"color: rgb(100,100,100);\">" : "",
+ $entry_name,
+ $entry['obsolete'] ? "</span>" : "");
+ if ($entry['used'] && !$entry['obsolete']) {
echo ' *';
- } else {
+ } elseif (!$entry['obsolete']) {
echo ' ';
print_update_name($update_entries[$entry_name], false);
}