ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/map-tags.ext
(Generate patch)

Comparing deliantra/server/ext/map-tags.ext (file contents):
Revision 1.19 by root, Sat Oct 24 00:25:26 2009 UTC vs.
Revision 1.24 by root, Thu Apr 29 08:13:50 2010 UTC

2 2
3our $SCHEDULE_INTERVAL = $cf::CFG{extractor_schedule_interval} || 3600; 3our $SCHEDULE_INTERVAL = $cf::CFG{extractor_schedule_interval} || 3600;
4 4
5use JSON::XS; 5use JSON::XS;
6 6
7our $db_mapinfo = cf::sync_job { cf::db_table "tag-mapinfo" }; # info/cache for maps 7our $db_mapinfo = cf::db_table "tag-mapinfo"; # info/cache for maps
8our $db_target = cf::sync_job { cf::db_table "tag-target" }; # tag => maps 8our $db_target = cf::db_table "tag-target"; # tag => maps
9 9
10sub remove_tag_target { 10sub remove_tag_target {
11 my ($txn, $tag, $target) = @_; 11 my ($txn, $tag, $target) = @_;
12 # - U O 12 # - U O
13 13
84} 84}
85 85
86sub reload { 86sub reload {
87 my $guard = cf::lock_acquire "map-tags::reload"; 87 my $guard = cf::lock_acquire "map-tags::reload";
88 88
89 my $start = EV::time; 89 my $start = AE::time;
90 90
91 # 1. check for maps no longer existing 91 # 1. check for maps no longer existing
92 { 92 {
93 my @delkeys; 93 my @delkeys;
94 94
149# delete $map->{deny_reset}; 149# delete $map->{deny_reset};
150# } 150# }
151# } 151# }
152# } 152# }
153 153
154 warn sprintf "map-tag scan (%fs)", EV::time - $start; 154 warn sprintf "map-tag scan finished (%fs)\n", AE::time - $start;
155} 155}
156 156
157our $RELOAD_SCHEDULER = cf::periodic $SCHEDULE_INTERVAL, Coro::unblock_sub { 157our $RELOAD_SCHEDULER = cf::periodic $SCHEDULE_INTERVAL, Coro::unblock_sub {
158 $Coro::current->prio (Coro::PRIO_MIN); 158 $Coro::current->prio (Coro::PRIO_MIN);
159 $Coro::current->desc ("map-tag scanner"); 159 $Coro::current->desc ("map-tag scanner");
176 grep $_, 176 grep $_,
177 map { cf::map::find $_ } 177 map { cf::map::find $_ }
178 grep s/^s//, 178 grep s/^s//,
179 split /\x00/, $data 179 split /\x00/, $data
180} 180}
181
182sub unload {
183 my $guard = cf::lock_acquire "map-tags::reload";
184
185 BDB::db_close $db_target;
186 BDB::db_close $db_mapinfo;
187}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines