+sub getFleet {
+ my ($nick,$command) = @_;
+
+ unless (defined $nick){
+ $ND::server->command("notice $ND::nick Usage: $command nick | % can be used as wildcard, e.g. barr%");
+ return;
+ }
+ if (officer() || dc()){
+ my $f = $ND::DBH->prepare(q{SELECT fs.ship, fs.amount, username
+ FROM fleet_ships fs
+ JOIN (SELECT fid,username
+ FROM fleets f
+ JOIN users u USING (planet)
+ WHERE mission = 'Full fleet' AND name <> 'Unit'
+ AND username ILIKE $1
+ ORDER BY planet,tick DESC,fid DESC
+ LIMIT 1
+ ) f USING (fid)
+ ORDER BY num
+ });
+ $f->execute($nick);
+ my $text;
+ my $username;
+ while (my $ship = $f->fetchrow_hashref){
+ unless (defined $username) {
+ $username = $ship->{username};
+ $text = "$ND::B$username$ND::O has: "
+ }
+ $text .= "$ship->{ship} $ship->{amount} ";
+ }
+ if ($text){
+ $ND::server->command("notice $ND::nick $text");
+ }else{
+ $ND::server->command("notice $ND::nick Couldn't find any fleet for $nick");
+ }
+ }
+}
+