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

Comparing deliantra/Deliantra-Client/DC.pm (file contents):
Revision 1.114 by elmex, Mon Aug 14 04:34:40 2006 UTC vs.
Revision 1.116 by root, Fri Aug 18 01:01:00 2006 UTC

69my %DB_SYNC; 69my %DB_SYNC;
70 70
71sub put($$$) { 71sub put($$$) {
72 my ($db, $key, $data) = @_; 72 my ($db, $key, $data) = @_;
73 73
74 my $key = $db + 0;
75 Scalar::Util::weaken $db;
74 $DB_SYNC{$db} = AnyEvent->timer (after => 5, cb => sub { $db->db_sync }); 76 $DB_SYNC{$key} ||= AnyEvent->timer (after => 5, cb => sub {
77 delete $DB_SYNC{$key};
78 $db->db_sync if $db;
79 });
75 80
76 $db->db_put ($key => $data) 81 $db->db_put ($key => $data)
77} 82}
78 83
79package CFPlus; 84package CFPlus;
289 sub { 294 sub {
290 &::open_string_query ("Rename item to:", sub { 295 &::open_string_query ("Rename item to:", sub {
291 my ($entry, $txt) = @_; 296 my ($entry, $txt) = @_;
292 $::CONN->send ("mark ". pack "N", $self->{tag}); 297 $::CONN->send ("mark ". pack "N", $self->{tag});
293 $::CONN->send ("command rename to <$txt>"); 298 $::CONN->send ("command rename to <$txt>");
294 }); 299 }, $self->{name},
300 "If you input no name or erase the current custom name, the custom name will be unset");
295 } 301 }
296 ], 302 ],
297 ["apply", sub { $::CONN->send ("apply $self->{tag}") }], 303 ["apply", sub { $::CONN->send ("apply $self->{tag}") }],
298 ( 304 (
299 $self->{flags} & F_LOCKED 305 $self->{flags} & F_LOCKED

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines