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.477 by root, Wed Sep 2 22:52:36 2009 UTC vs.
Revision 1.480 by root, Thu Oct 8 05:09:43 2009 UTC

88our %EXT_CORO = (); # coroutines bound to extensions 88our %EXT_CORO = (); # coroutines bound to extensions
89our %EXT_MAP = (); # pluggable maps 89our %EXT_MAP = (); # pluggable maps
90 90
91our $RELOAD; # number of reloads so far, non-zero while in reload 91our $RELOAD; # number of reloads so far, non-zero while in reload
92our @EVENT; 92our @EVENT;
93our @REFLECT; # set by XS
94our %REFLECT; # set by us
93 95
94our $CONFDIR = confdir; 96our $CONFDIR = confdir;
95our $DATADIR = datadir; 97our $DATADIR = datadir;
96our $LIBDIR = "$DATADIR/ext"; 98our $LIBDIR = "$DATADIR/ext";
97our $PODDIR = "$DATADIR/pod"; 99our $PODDIR = "$DATADIR/pod";
161 163
162sub cf::map::normalise; 164sub cf::map::normalise;
163 165
164############################################################################# 166#############################################################################
165 167
168%REFLECT = ();
169for (@REFLECT) {
170 my $reflect = JSON::XS::decode_json $_;
171 $REFLECT{$reflect->{class}} = $reflect;
172}
173
174# this is decidedly evil
175$REFLECT{object}{flags} = [grep $_, map /^FLAG_([A-Z0-9_]+)$/ && lc $1, keys %{"cf::"}];
176
177#############################################################################
178
166=head2 GLOBAL VARIABLES 179=head2 GLOBAL VARIABLES
167 180
168=over 4 181=over 4
169 182
170=item $cf::UPTIME 183=item $cf::UPTIME
217=item @cf::INVOKE_RESULTS 230=item @cf::INVOKE_RESULTS
218 231
219This array contains the results of the last C<invoke ()> call. When 232This array contains the results of the last C<invoke ()> call. When
220C<cf::override> is called C<@cf::INVOKE_RESULTS> is set to the parameters of 233C<cf::override> is called C<@cf::INVOKE_RESULTS> is set to the parameters of
221that call. 234that call.
235
236=item %cf::REFLECT
237
238Contains, for each (C++) class name, a hash reference with information
239about object members (methods, scalars, arrays and flags) and other
240metadata, which is useful for introspection.
222 241
223=back 242=back
224 243
225=cut 244=cut
226 245
2220 2239
2221 my $lock = cf::lock_acquire "map_data:$self->{path}"; 2240 my $lock = cf::lock_acquire "map_data:$self->{path}";
2222 2241
2223 return if $self->players; 2242 return if $self->players;
2224 2243
2225 warn "resetting map ", $self->path; 2244 warn "resetting map ", $self->path, "\n";
2226 2245
2227 $self->in_memory (cf::MAP_SWAPPED); 2246 $self->in_memory (cf::MAP_SWAPPED);
2228 2247
2229 # need to save uniques path 2248 # need to save uniques path
2230 unless ($self->{deny_save}) { 2249 unless ($self->{deny_save}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines