ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/DB.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/DB.pm (file contents):
Revision 1.5 by root, Mon Apr 16 20:35:29 2007 UTC vs.
Revision 1.8 by root, Thu Jul 5 10:15:17 2007 UTC

60 60
61use strict; 61use strict;
62 62
63use Fcntl; 63use Fcntl;
64use BerkeleyDB; 64use BerkeleyDB;
65use Config;
65 66
66our $DB_HOME = "$Crossfire::VARDIR/cfplus"; 67our $DB_HOME = "$Crossfire::VARDIR/cfplus-$BerkeleyDB::db_version-$Config{archname}";
67our $DB_ENV; 68our $DB_ENV;
68our $DB_STATE; 69our $DB_STATE;
69our %DB_TABLE; 70our %DB_TABLE;
70 71
71sub open_db { 72sub open_db {
248 local $SIG{__DIE__}; 249 local $SIG{__DIE__};
249 eval { 250 eval {
250 close $FH; 251 close $FH;
251 252
252 unless (eval { open_db }) { 253 unless (eval { open_db }) {
253 File::Path::rmtree $DB_HOME; 254 eval { File::Path::rmtree $DB_HOME };
254 open_db; 255 open_db;
255 } 256 }
256 257
257 while () { 258 while () {
258 4 == read $fh, my $len, 4 259 4 == read $fh, my $len, 4
292 $fh_r_watcher = AnyEvent->io (fh => $FH, poll => 'r', cb => \&fh_read); 293 $fh_r_watcher = AnyEvent->io (fh => $FH, poll => 'r', cb => \&fh_read);
293 294
294 sync_tick; 295 sync_tick;
295} 296}
296 297
298sub stop {
299 close $FH;
300}
301
2971; 3021;
298 303
299=back 304=back
300 305
301=head1 AUTHOR 306=head1 AUTHOR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines