X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=lib%2FNDWeb%2FController%2FMembers.pm;h=cd82bd910eb129021040304055fad72639c8a075;hb=6cae25aca687ace4e0b80362fe8bd328aa808e4f;hp=8c7f6cbb4c981fee2cf2edd40ab41aa20181b22b;hpb=5f201b31d1ed259f7eec068794b477f886a77bcb;p=ndwebbie.git diff --git a/lib/NDWeb/Controller/Members.pm b/lib/NDWeb/Controller/Members.pm index 8c7f6cb..cd82bd9 100644 --- a/lib/NDWeb/Controller/Members.pm +++ b/lib/NDWeb/Controller/Members.pm @@ -407,7 +407,7 @@ INSERT INTO irc_requests (uid,channel,message) VALUES($1,'def',$2) }); my $msg = $c->req->param('message'); - while ($msg =~ /(\d+):(\d+):(\d+)\*?\s+(\d+):(\d+):(\d+)\s+([^:]*\S+)\s+(?:Ter|Cat|Xan|Zik|Etd)\s+([\d,]+)\s+Attack\s+(\d+)/gc + while ($msg =~ /expand\s+(\d+):(\d+):(\d+)\*?\s+(\d+):(\d+):(\d+)\s+([^:]*\S+)\s+(?:Ter|Cat|Xan|Zik|Etd)\s+([\d,]+)\s+(\d+)/gc || $msg =~ /(\d+):(\d+):(\d+)\s+(\d+):(\d+):(\d+)\s+\((?:Ter|Cat|Xan|Zik|Etd)\)\s+([^,]*\S+)\s+([\d,]+)\s+(\d+)\s+\(\d+\)/gc){ my $inc = {message => $&}; @@ -561,30 +561,38 @@ sub parseconfirmations { (?.+?) \QTotal Ships in Fleet\E \s?\t (\d+) \s?\t (?\d+) \s?\t (?\d+) \s?\t (?\d+) \W+ Mission: \t (?\w*) \t (?\w*) \t (?\w*) \W+ - Target: \t (?\d+:\d+:\d+)? \t (?\d+:\d+:\d+)? \t (?\d+:\d+:\d+)? \W+ - \QLaunch Tick:\E \t (?\d*) \t (?\d*) \t (?\d*) \W+ - ETA: \t (?[^\t]*) \t (?[^\t]*) \t (?[^\t]*) + Target: \t (?((\d+:\d+:\d+)?\t)*) \W+ + \QLaunch Tick:\E \t (?(\d*\t)*) \W+ + ETA: \t? (?([^\t]+\t?)*) /sx){ my %match = %-; + my @etas = split /\t/, $+{etas}; + my @targets = split /\t/, $+{targets}; + my @lts = split /\t/, $+{lts}; for my $i (0..2){ my %mission = ( name => $match{name}->[$i], mission => $match{mission}->[$i], - target => $match{target}->[$i], amount => $match{amount}->[$i], - lt => $match{lt}->[$i], num => $i, ships => [] ); - given($match{eta}->[$i]){ - when(/(\d+) (\s+ \(\+\d+\))? \W+ + if ($mission{amount} == 0){ + push @missions,\%mission; + next; + } + + $mission{target} = shift @targets; + $mission{lt} = shift @lts; + given(shift @etas){ + when(/^(\d+) (\s+ \(\+\d+\))? \W+ Arrival:\ (\d+) \W+ \QReturn ETA: \E(Instant|\d+)/sx){ $mission{tick} = $3; $mission{eta} = $1 + $4; $mission{back} = $3 + $mission{eta} - 1; } - when(/(\d+) \W+ + when(/^(\d+) \W+ Arrival:\ (\d+)/sx){ $mission{tick} = $2; $mission{eta} = $1;