comparison Ikariam.pm @ 75:3d1784140009

move hunting rules from building.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Thu, 23 Oct 2008 00:54:32 +0800
parents 6e0d5e781949
children 9d92e8c12f58
comparison
equal deleted inserted replaced
74:27b16506231f 75:3d1784140009
392 392
393 my ($elem) = $html->getElementsByAttribute("id", "value_gold"); 393 my ($elem) = $html->getElementsByAttribute("id", "value_gold");
394 $self->{'cities'}->{$cityId}->{resources}->{gold} = $elem->innerText(); 394 $self->{'cities'}->{$cityId}->{resources}->{gold} = $elem->innerText();
395 $self->{'cities'}->{$cityId}->{resources}->{gold} =~ s/,//g; 395 $self->{'cities'}->{$cityId}->{resources}->{gold} =~ s/,//g;
396 396
397 # XXX
397 my ($elem) = $html->getElementsByAttribute("class", "city"); 398 my ($elem) = $html->getElementsByAttribute("class", "city");
398 $self->{'cities'}->{$cityId}->{name} = $elem->innerText(); 399 $self->{'cities'}->{$cityId}->{name} = $elem->innerText();
399 400
400 my ($elem) = $html->getElementsByAttribute("class", 'constructionSite'); 401 my ($elem) = $html->getElementsByAttribute("class", 'constructionSite');
401 $self->{'cities'}->{$cityId}->{construction} = 0; 402 $self->{'cities'}->{$cityId}->{construction} = 0;
552 die ("password error\n"); 553 die ("password error\n");
553 } else { 554 } else {
554 my $html = HTML::TagParser->new($c); 555 my $html = HTML::TagParser->new($c);
555 my @elems; 556 my @elems;
556 557
558 # XXX
557 @elems = $html->getElementsByAttribute("class", "avatarCities coords"); 559 @elems = $html->getElementsByAttribute("class", "avatarCities coords");
558 foreach my $elem (@elems) { 560 foreach my $elem (@elems) {
559 # my cities 561 # my cities
560 $self->{'cities'}->{$elem->getAttribute('value')} = {}; 562 $self->{'cities'}->{$elem->getAttribute('value')} = {};
561 } 563 }