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.1 by root, Fri Feb 3 19:49:32 2006 UTC vs.
Revision 1.3 by root, Sat Feb 4 20:38:29 2006 UTC

158 158
159sub load_extensions { 159sub load_extensions {
160 my $LIBDIR = maps_directory "perl"; 160 my $LIBDIR = maps_directory "perl";
161 161
162 for my $ext (<$LIBDIR/*.ext>) { 162 for my $ext (<$LIBDIR/*.ext>) {
163 next unless -r $ext;
164 eval {
163 load_extension $ext; 165 load_extension $ext;
166 1
167 } or warn "$ext not loaded: $@";
164 } 168 }
165} 169}
166 170
167register_command "perl-reload", 0, sub { 171register_command "perl-reload", 0, sub {
168 my ($who, $arg) = @_; 172 my ($who, $arg) = @_;
169 173
170 if ($who->flag (FLAG_WIZ)) { 174 if ($who->flag (FLAG_WIZ)) {
175 $who->message ("reloading...");
176
171 warn "reloading...\n"; 177 warn "reloading...\n";
172 unload_extension $_ for @exts; 178 unload_extension $_ for @exts;
173 @exts = 0; 179 @exts = 0;
174 load_extensions; 180 load_extensions;
175 warn "reloaded\n"; 181 warn "reloaded\n";
182
183 $who->message ("reloaded");
184 } else {
185 $who->message ("Intruder Alert!");
176 } 186 }
177}; 187};
178 188
179load_extensions; 189load_extensions;
180 190

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines