1 | =head1 NAME |
1 | =head1 NAME |
2 | |
2 | |
3 | DC::DB - async. database and filesystem access for cfplus |
3 | DC::DB - async. database and filesystem access for deliantra |
4 | |
4 | |
5 | =head1 SYNOPSIS |
5 | =head1 SYNOPSIS |
6 | |
6 | |
7 | use DC::DB; |
7 | use DC::DB; |
8 | |
8 | |
… | |
… | |
22 | use Config; |
22 | use Config; |
23 | use BDB; |
23 | use BDB; |
24 | |
24 | |
25 | use DC; |
25 | use DC; |
26 | |
26 | |
27 | our $DBDIR = "cfplus-" . BDB::VERSION . "-$Config{archname}"; |
27 | our $ODBDIR = "cfplus-" . BDB::VERSION . "-$Config{archname}"; |
|
|
28 | our $DBDIR = "client-" . BDB::VERSION . "-$Config{archname}"; |
28 | our $DB_HOME = "$Deliantra::VARDIR/$DBDIR"; |
29 | our $DB_HOME = "$Deliantra::VARDIR/$DBDIR"; |
29 | |
30 | |
|
|
31 | if (!-e $DB_HOME and -e "$Deliantra::VARDIR/$ODBDIR") { |
|
|
32 | rename "$Deliantra::VARDIR/$ODBDIR", $DB_HOME; |
|
|
33 | print STDERR "INFO: moved old database from $Deliantra::VARDIR/$ODBDIR to $DB_HOME\n"; |
|
|
34 | } |
|
|
35 | |
30 | if (!-e $DB_HOME and -e "$Deliantra::OLDDIR/$DBDIR") { |
36 | if (!-e $DB_HOME and -e "$Deliantra::OLDDIR/$ODBDIR") { |
31 | rename "$Deliantra::OLDDIR/$DBDIR", $DB_HOME; |
37 | rename "$Deliantra::OLDDIR/$DBDIR", $DB_HOME; |
32 | print STDERR "INFO: moved old database from $Deliantra::OLDDIR/$DBDIR to $DB_HOME\n"; |
38 | print STDERR "INFO: moved old database from $Deliantra::OLDDIR/$ODBDIR to $DB_HOME\n"; |
33 | } |
39 | } |
34 | |
40 | |
35 | BDB::max_poll_time 0.03; |
41 | BDB::max_poll_time 0.03; |
36 | |
42 | |
37 | our $DB_ENV; |
43 | our $DB_ENV; |