--- deliantra/server/ext/map-tags.ext 2007/09/10 18:30:30 1.1 +++ deliantra/server/ext/map-tags.ext 2007/09/11 15:33:34 1.3 @@ -1,6 +1,6 @@ #! perl # mandatory -our $SCHEDULE_INTERVAL = $cf::CFG{extractor_schedule_interval} || 3600; +our $SCHEDULE_INTERVAL = $cf::CFG{extractor_schedule_interval} || 3600; use JSON::XS; @@ -151,4 +151,28 @@ } }; +sub find($) { + my ($tag) = @_; + my @res; + + utf8::encode (my $key = $tag); + BDB::db_get $db_target, undef, $key, my $data; + utf8::decode $data; + + for my $map ( + grep $_, + map { cf::map::find $_ } + grep s/^s//, + split /\x00/, $data + ) { + warn "map $map,$tag\n";#d# + $map->load; + + push @res, $map->find_tagged_objects ($tag); + + warn "tag<$tag>map<$map>res<@res>\n";#d# + } + + @res +}