… | |
… | |
88 | our %EXT_CORO = (); # coroutines bound to extensions |
88 | our %EXT_CORO = (); # coroutines bound to extensions |
89 | our %EXT_MAP = (); # pluggable maps |
89 | our %EXT_MAP = (); # pluggable maps |
90 | |
90 | |
91 | our $RELOAD; # number of reloads so far, non-zero while in reload |
91 | our $RELOAD; # number of reloads so far, non-zero while in reload |
92 | our @EVENT; |
92 | our @EVENT; |
|
|
93 | our @REFLECT; # set by XS |
|
|
94 | our %REFLECT; # set by us |
93 | |
95 | |
94 | our $CONFDIR = confdir; |
96 | our $CONFDIR = confdir; |
95 | our $DATADIR = datadir; |
97 | our $DATADIR = datadir; |
96 | our $LIBDIR = "$DATADIR/ext"; |
98 | our $LIBDIR = "$DATADIR/ext"; |
97 | our $PODDIR = "$DATADIR/pod"; |
99 | our $PODDIR = "$DATADIR/pod"; |
… | |
… | |
161 | |
163 | |
162 | sub cf::map::normalise; |
164 | sub cf::map::normalise; |
163 | |
165 | |
164 | ############################################################################# |
166 | ############################################################################# |
165 | |
167 | |
|
|
168 | %REFLECT = (); |
|
|
169 | for (@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 | |
219 | This array contains the results of the last C<invoke ()> call. When |
232 | This array contains the results of the last C<invoke ()> call. When |
220 | C<cf::override> is called C<@cf::INVOKE_RESULTS> is set to the parameters of |
233 | C<cf::override> is called C<@cf::INVOKE_RESULTS> is set to the parameters of |
221 | that call. |
234 | that call. |
|
|
235 | |
|
|
236 | =item %cf::REFLECT |
|
|
237 | |
|
|
238 | Contains, for each (C++) class name, a hash reference with information |
|
|
239 | about object members (methods, scalars, arrays and flags) and other |
|
|
240 | metadata, 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}) { |