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.39 by root, Tue Sep 2 04:38:23 2008 UTC vs.
Revision 1.40 by root, Wed Nov 26 23:08:34 2008 UTC

26use DC; 26use DC;
27 27
28our $ODBDIR = "cfplus-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}"; 28our $ODBDIR = "cfplus-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}";
29our $DBDIR = "client-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}"; 29our $DBDIR = "client-" . BDB::VERSION_MAJOR . "." . BDB::VERSION_MINOR . "-$Config{archname}";
30our $DB_HOME = "$Deliantra::VARDIR/$DBDIR"; 30our $DB_HOME = "$Deliantra::VARDIR/$DBDIR";
31
32sub FIRST_TILE_ID () { 64 }
31 33
32unless (-d $DB_HOME) { 34unless (-d $DB_HOME) {
33 if (-d "$Deliantra::VARDIR/$ODBDIR") { 35 if (-d "$Deliantra::VARDIR/$ODBDIR") {
34 rename "$Deliantra::VARDIR/$ODBDIR", $DB_HOME; 36 rename "$Deliantra::VARDIR/$ODBDIR", $DB_HOME;
35 print STDERR "INFO: moved old database from $Deliantra::VARDIR/$ODBDIR to $DB_HOME\n"; 37 print STDERR "INFO: moved old database from $Deliantra::VARDIR/$ODBDIR to $DB_HOME\n";
156 db_get $table, undef, $name => $id, 0; 158 db_get $table, undef, $name => $id, 0;
157 $! or return $cb->($id); 159 $! or return $cb->($id);
158 160
159 unless ($TILE_SEQ) { 161 unless ($TILE_SEQ) {
160 $TILE_SEQ = $table->sequence; 162 $TILE_SEQ = $table->sequence;
161 $TILE_SEQ->initial_value (64); 163 $TILE_SEQ->initial_value (FIRST_TILE_ID);
162 $TILE_SEQ->set_cachesize (0); 164 $TILE_SEQ->set_cachesize (0);
163 db_sequence_open $TILE_SEQ, undef, "id", BDB::CREATE; 165 db_sequence_open $TILE_SEQ, undef, "id", BDB::CREATE;
164 } 166 }
165 167
166 db_sequence_get $TILE_SEQ, undef, 1, my $id; 168 db_sequence_get $TILE_SEQ, undef, 1, my $id;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines