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.2 by root, Fri Feb 3 21:22:53 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;
163 eval { 164 eval {
164 load_extension $ext; 165 load_extension $ext;
165 1 166 1
166 } or warn "$ext not loaded: $@"; 167 } or warn "$ext not loaded: $@";
167 } 168 }
169 170
170register_command "perl-reload", 0, sub { 171register_command "perl-reload", 0, sub {
171 my ($who, $arg) = @_; 172 my ($who, $arg) = @_;
172 173
173 if ($who->flag (FLAG_WIZ)) { 174 if ($who->flag (FLAG_WIZ)) {
175 $who->message ("reloading...");
176
174 warn "reloading...\n"; 177 warn "reloading...\n";
175 unload_extension $_ for @exts; 178 unload_extension $_ for @exts;
176 @exts = 0; 179 @exts = 0;
177 load_extensions; 180 load_extensions;
178 warn "reloaded\n"; 181 warn "reloaded\n";
182
183 $who->message ("reloaded");
184 } else {
185 $who->message ("Intruder Alert!");
179 } 186 }
180}; 187};
181 188
182load_extensions; 189load_extensions;
183 190

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines