X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2FCommods.pm;h=7a29edca970601d3aada7f6c234d1c277ca649f9;hb=0173112cd5872d7138cb8bc03faa4f3118c059bf;hp=860510e33835e5e1e574ab429862f0563ecf7c2a;hpb=1478fddc005bdaa1fa3ab731a0bd59613502e90d;p=ypp-sc-tools.db-live.git diff --git a/yarrg/Commods.pm b/yarrg/Commods.pm index 860510e..7a29edc 100644 --- a/yarrg/Commods.pm +++ b/yarrg/Commods.pm @@ -36,6 +36,7 @@ BEGIN { @EXPORT = qw(&parse_info_clientside &fetch_with_rsync &parse_info_serverside &parse_info_serverside_ocean %oceans %commods %clients %routes %route_mysteries + %vessels %shotname2damage &parse_pctb_commodmap %pctb_commodmap @pctb_commodmap &get_our_version &check_tsv_line &pipethrough_prep &pipethrough_run @@ -54,6 +55,10 @@ our %oceans; # eg $oceans{'Midnight'}{'Ruby'}{'Eta Island'}= $sources; our %clients; # eg $clients{'ypp-sc-tools'}= [ qw(last-page) ]; our %routes; # eg $routes{'Midnight'}{'Orca'}{'Tinga'}= $sources NB abbrevs! our %route_mysteries; # eg $route_mysteries{'Midnight'}{'Norse'}= 3 +our %vessels; # eg $vessels{'War Brig'}{Shot}='medium' + # $vessels{'War Brig'}{Volume}= 81000 + # $vessels{'War Brig'}{Mass}= 54000 +our %shotname2damage; # eg $shotname2damage{'medium'}= 3; # $sources = 's[l]b'; # 's' = Special Circumstances; 'l' = local ; B = with Bleach @@ -98,6 +103,25 @@ sub parse_info1 ($$) { $oceans{$ocean}{$arch}{$_} .= $src; }; }); + } elsif (m/^vessels$/) { + @ctx= (sub { + return if m/^[-+|]+$/; + m/^ \| \s* ([A-Z][a-z\ ]+[a-z]) \s* + \| \s* (small|medium|large) \s* + \| \s* ([1-9][0-9,]+) \s* + \| \s* ([1-9][0-9,]+) \s* + \| $/x + or die; + my $name= $1; + my $v= { Shot => $2, Volume => $3, Mass => $4 }; + foreach my $vm (qw(Volume Mass)) { $v->{$vm} =~ s/,//g; } + $vessels{$name}= $v; + }); + } elsif (m/^shot$/) { + @ctx= (sub { + m/^ ([a-z]+) \s+ (\d+) $/x or die; + $shotname2damage{$1}= $2; + }); } elsif (m/^routes (\w+)$/) { my $ocean= $1; @ctx= (sub {