diff Ikariam.pm @ 8:e4b3168d0319

implemented sheep and enemy scripts.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Wed, 08 Oct 2008 04:23:01 +0800
parents 2040ccc95670
children ae412d1f7761
line wrap: on
line diff
--- a/Ikariam.pm	Wed Oct 08 02:50:19 2008 +0800
+++ b/Ikariam.pm	Wed Oct 08 04:23:01 2008 +0800
@@ -3,7 +3,7 @@
 use Class::DBI::AutoLoader (
     dsn       => 'dbi:SQLite:dbname=ikariam.sqlite',
     options   => { RaiseError => 1 },
-    tables    => ['cities', 'island', 'users'],
+    tables    => ['cities', 'island', 'user'],
     use_base  => 'Class::DBI::SQLite',
     namespace => 'Ikariam',
 );
@@ -68,7 +68,7 @@
         $e = getElementsByAttribute($elem, "class", "action");
         $e = getElementsByTagName($e, "a");
 
-        if($e->getAttribute('href') =~ /index\.php\?view=sendMessage&with=(\d+)&oldView=highscore/)
+        if(defined ($e) && $e->getAttribute('href') =~ /index\.php\?view=sendMessage&with=(\d+)&oldView=highscore/)
         {
             $user{'id'} = $1;
 
@@ -200,7 +200,7 @@
         @e = getElementsByAttribute($elem, "class", "messageSend");
         if ( $e[0]->getAttribute("href") =~ /with=(\d+)&destinationCityId=(\d+)/)
         {
-            $info{'ownerId'} = $1;
+            $info{'user'} = $1;
             $info{'cityId'} = $2;
         }
         push @cities, \%info;