-sub sendScan {
- my ($msg, $command) = @_;
- my ($target,$mess);
- if (defined $msg && $msg =~ /^(\S+) (.*)$/){
- $target = $1;
- $mess = $2;
- }else{
- $ND::server->command("notice $ND::nick syntax: $command nick message");
- return;
- }
- if (scanner()){
- $ND::server->command("msg $target ".chr(2).$mess.chr(3)."4 (reply with /msg $ND::scanchan)");
- $ND::server->command("msg $ND::target ${ND::C}3$target << $mess");
- }
-}
-
-our %scanid = (p => 1, l => 2, d => 3, u => 4, n => 5, j => 7, a => 8);
-
-our @scantypes = ('Planet','Landing', 'Development'
- ,'Unit', 'News', 'Incoming', 'Jumpgate', 'Advanced Unit');
-
-sub reqScan {
- my ($msg, $command) = @_;
-
- my ($x, $y, $z, $type, $typeid);
- if (defined $msg && $msg =~ /^([pdunja]) (\d+)\D+(\d+)\D+(\d+) (\S.*)/){
- $typeid = $scanid{$1};
- $type = $scantypes[$typeid-1];
- ($x,$y,$z) = ($2,$3,$4);
- $msg = $5;
- }else{
- $ND::server->command("notice $ND::nick syntax: $command type X:Y:Z message"
- . " | type is the first character in the scan name, like p for planet scan, message is a message to scanners, like plz or thanks like plz or thanks");
- return;
- }
-
- if (my $user = member){
-
- my $planet = $ND::DBH->selectrow_array(q{SELECT planetid($1,$2,$3,$4)}
- ,undef,$x,$y,$z,$ND::tick);
-
- my $query = $ND::DBH->prepare(q{SELECT scan_id
- FROM scans
- WHERE planet = $1 AND type = $2 AND tick >= $3});
- $query->execute($planet,$type,$ND::tick);