diff enemy_scores.pl @ 374:e551351b18de

updated for timestamp of scores information
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 14 Apr 2009 17:01:17 +0800
parents cea21f99e56f
children
line wrap: on
line diff
--- a/enemy_scores.pl	Tue Apr 14 17:00:40 2009 +0800
+++ b/enemy_scores.pl	Tue Apr 14 17:01:17 2009 +0800
@@ -19,7 +19,11 @@
 if(defined($u)) {
     foreach my $i (qw/name time score trader_score_secondary army_score_main ally/) {
         if($i eq "time") {
-            printf("time: %s, ",  strftime ("%Y-%m-%d %H:%M", localtime($u->get('time'))));
+            if(defined($u->get('time'))) {
+                printf("time: %s, ",  strftime ("%Y-%m-%d %H:%M", localtime($u->get('time'))));
+            } else {
+                printf("time: %s, ",  strftime ("%Y-%m-%d %H:%M", localtime()));
+            }
         } else {
             printf("%s: %s, ", $i, $u->get($i));
         }