ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/lib/cf.pm
(Generate patch)

Comparing deliantra/server/lib/cf.pm (file contents):
Revision 1.20 by root, Sun Jul 16 17:29:02 2006 UTC vs.
Revision 1.22 by root, Wed Jul 19 08:50:42 2006 UTC

169 169
170sub unload_extension { 170sub unload_extension {
171 my ($pkg) = @_; 171 my ($pkg) = @_;
172 172
173 warn "removing extension $pkg\n"; 173 warn "removing extension $pkg\n";
174
175 if (my $cb = $pkg->can ("on_unload")) {
176 $cb->($pkg);
177 }
174 178
175 # remove hooks 179 # remove hooks
176 for my $idx (0 .. $#EVENT) { 180 for my $idx (0 .. $#EVENT) {
177 delete $hook[$idx]{$pkg}; 181 delete $hook[$idx]{$pkg};
178 } 182 }
222 226
223 unload_extension $_ for @exts; 227 unload_extension $_ for @exts;
224 delete $INC{"cf.pm"}; 228 delete $INC{"cf.pm"};
225 229
226 # don't, removes xs symbols, too 230 # don't, removes xs symbols, too
227 #Symbol::delete_package $pkg; 231 #Symbol::delete_package __PACKAGE__;
228 232
229 require cf; 233 require cf;
230 }; 234 };
231 warn $@ if $@; 235 warn $@ if $@;
232 $who->message ($@) if $@; 236 $who->message ($@) if $@;
343 for grep %$_, $ob, $ob->inv; 347 for grep %$_, $ob, $ob->inv;
344 348
345 unlink "$path.cfperl";#d##TODO#remove 349 unlink "$path.cfperl";#d##TODO#remove
346}; 350};
347 351
352#############################################################################
353# core extensions - in perl
354
355# rough implementation of a future "reply" method that works
356# with dialog boxes.
357sub cf::object::player::reply($$;$) {
358 my ($self, $msg, $flags) = @_;
359
360 $flags = cf::NDI_WHITE unless @_ >= 3;
361
362 $self->message ($msg, $flags);
363}
364
365#############################################################################
366# initialisation
367
348register "<global>", __PACKAGE__; 368register "<global>", __PACKAGE__;
349 369
350unshift @INC, maps_directory "perl"; 370unshift @INC, maps_directory "perl";
351 371
352load_extensions; 372load_extensions;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines