--- deliantra/Deliantra-Client/DC/DB.pm 2007/12/26 20:46:39 1.28 +++ deliantra/Deliantra-Client/DC/DB.pm 2007/12/26 21:03:21 1.29 @@ -1,10 +1,10 @@ =head1 NAME -dc::DB - async. database and filesystem access for cfplus +DC::DB - async. database and filesystem access for cfplus =head1 SYNOPSIS - use dc::DB; + use DC::DB; =head1 DESCRIPTION @@ -12,7 +12,7 @@ =cut -package dc::DB; +package DC::DB; use strict; use utf8; @@ -22,7 +22,7 @@ use Config; use BDB; -use dc; +use DC; our $DBDIR = "cfplus-" . BDB::VERSION . "-$Config{archname}"; our $DB_HOME = "$Deliantra::VARDIR/$DBDIR"; @@ -177,7 +177,7 @@ my %maptile = reverse %$tilemap;#d# if ((scalar keys %$tilemap) != (scalar keys %maptile)) {#d# $tilemap = { };#d# - dc::error "FATAL: facemap is not a 1:1 mapping, please report this and delete your $DB_HOME directory!\n";#d# + DC::error "FATAL: facemap is not a 1:1 mapping, please report this and delete your $DB_HOME directory!\n";#d# }#d# }; BDB::flush; @@ -202,31 +202,31 @@ sub sync { # for debugging - #dc::DB::Server::req (sync => sub { }); - dc::DB::Server::sync (); + #DC::DB::Server::req (sync => sub { }); + DC::DB::Server::sync (); } sub unlink($$) { - dc::DB::Server::req (unlink => @_); + DC::DB::Server::req (unlink => @_); } sub read_file($$) { - dc::DB::Server::req (read_file => @_); + DC::DB::Server::req (read_file => @_); } sub write_file($$$) { - dc::DB::Server::req (write_file => @_); + DC::DB::Server::req (write_file => @_); } sub prefetch_file($$$) { - dc::DB::Server::req (prefetch_file => @_); + DC::DB::Server::req (prefetch_file => @_); } sub logprint($$$) { - dc::DB::Server::req (logprint => @_); + DC::DB::Server::req (logprint => @_); } -package dc::DB::Server; +package DC::DB::Server; use strict; @@ -357,7 +357,7 @@ } sub run { - ($FH, my $fh) = dc::socketpipe; + ($FH, my $fh) = DC::socketpipe; my $oldfh = select $FH; $| = 1; select $oldfh; my $oldfh = select $fh; $| = 1; select $oldfh; @@ -381,7 +381,7 @@ $req = Storable::thaw $req; my ($id, $type, @args) = @$req; - my $cb = dc::DB::Server->can ("do_$type") + my $cb = DC::DB::Server->can ("do_$type") or die "$type: unknown database request type\n"; my $res = pack "N/a*", Storable::freeze [$id, $cb->(@args)]; (syswrite $fh, $res) == length $res @@ -398,11 +398,11 @@ warn $error if $error; - dc::_exit 0; + DC::_exit 0; } close $fh; - dc::fh_nonblocking $FH, 1; + DC::fh_nonblocking $FH, 1; $CB{die} = sub { die shift };