diff freeland.pl @ 85:f25d13153501

fixed the server name
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 26 Oct 2008 12:26:43 +0800
parents b18369979b58
children 73f0a1cafc23
line wrap: on
line diff
--- a/freeland.pl	Sun Oct 26 01:43:40 2008 +0800
+++ b/freeland.pl	Sun Oct 26 12:26:43 2008 +0800
@@ -4,6 +4,8 @@
 use Data::Dumper;
 
 package main;
+my @tradegoodText = qw/NULL 葡萄酒 大理石 水晶 硫磺/;
+my @wonderText = qw/NULL 赫菲斯拓斯的熔爐 蓋亞的神殿 狄奧尼索斯的花園 雅典娜的神殿 赫秘士的神殿 阿瑞斯的要塞 波賽頓的神殿 克羅瑟斯的神殿/;
 
 if($#ARGV != 1) {
     die("Usage: $0 x y\n");
@@ -23,6 +25,7 @@
     }
 );
 
+# 
 my @islands = Ikariam::Island->retrieve_from_sql(qq{
         tradegood == 2
     AND people < 16
@@ -37,19 +40,25 @@
         foreach my $city (@cities) {
             my $island = Ikariam::Island->retrieve($city->island);
             my $user = Ikariam::User->retrieve($city->user);
-            printf("%s (%d) \"%s\" %d [%d,%d] http://s2.ikariam.tw/index.php?view=island&id=%d&selectCity=%d\n",
+            printf("%s (%d) \"%s\" %d [%d,%d] http://%s/index.php?view=island&id=%d&selectCity=%d\n",
                 $user->name, $user->score,
                 $city->cityname, $city->citylevel, 
                 $island->x, $island->y,
+                $::server,
                 $island->id,
                 $city->cityId
             );
         }
 } else {
+    # 依照距離列表
     foreach my $island (@islands)
     {
-        printf("[%d:%d] http://s2.ikariam.tw/index.php?view=island&id=%d%s\n",
+        printf("%d [%d:%d] %s %s http://%s/index.php?view=island&id=%d%s\n",
+            (abs($x-$island->x) + abs($y-$island->y)),
             $island->x, $island->y,
+            $tradegoodText[$island->tradegood],
+            $wonderText[$island->wonder],
+            $::server,
             $island->id,
         );
     }