… | |
… | |
187 | @safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable'; |
187 | @safe::cf::global::ISA = @cf::global::ISA = 'cf::attachable'; |
188 | @safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable'; |
188 | @safe::cf::object::ISA = @cf::object::ISA = 'cf::attachable'; |
189 | @safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable'; |
189 | @safe::cf::player::ISA = @cf::player::ISA = 'cf::attachable'; |
190 | @safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable'; |
190 | @safe::cf::client::ISA = @cf::client::ISA = 'cf::attachable'; |
191 | @safe::cf::map::ISA = @cf::map::ISA = 'cf::attachable'; |
191 | @safe::cf::map::ISA = @cf::map::ISA = 'cf::attachable'; |
|
|
192 | @safe::cf::arch::ISA = @cf::arch::ISA = 'cf::object'; |
192 | @safe::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; |
193 | @safe::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; # not really true (yet) |
193 | |
194 | |
194 | # we bless all objects into (empty) derived classes to force a method lookup |
195 | # we bless all objects into (empty) derived classes to force a method lookup |
195 | # within the Safe compartment. |
196 | # within the Safe compartment. |
196 | for my $pkg (qw( |
197 | for my $pkg (qw( |
197 | cf::global cf::attachable |
198 | cf::global cf::attachable |
… | |
… | |
422 | or return; |
423 | or return; |
423 | |
424 | |
424 | aio_rename "$runtime~", $runtime |
425 | aio_rename "$runtime~", $runtime |
425 | and return; |
426 | and return; |
426 | |
427 | |
427 | warn "runtime file written.\n";#d# |
428 | warn "runtime file written.\n"; |
428 | |
429 | |
429 | 1 |
430 | 1 |
430 | } |
431 | } |
431 | |
432 | |
432 | =item cf::datalog type => key => value, ... |
433 | =item cf::datalog type => key => value, ... |
… | |
… | |
872 | or return; |
873 | or return; |
873 | $av = eval { (Storable::thaw $av)->{objs} }; |
874 | $av = eval { (Storable::thaw $av)->{objs} }; |
874 | } |
875 | } |
875 | |
876 | |
876 | warn sprintf "loading %s (%d)\n", |
877 | warn sprintf "loading %s (%d)\n", |
877 | $filename, length $data, scalar @{$av || []};#d# |
878 | $filename, length $data, scalar @{$av || []}; |
878 | return ($data, $av); |
879 | return ($data, $av); |
879 | } |
880 | } |
880 | |
881 | |
881 | ############################################################################# |
882 | ############################################################################# |
882 | # command handling &c |
883 | # command handling &c |
… | |
… | |
1723 | my $lock = cf::lock_acquire "map_data:$self->{path}"; |
1724 | my $lock = cf::lock_acquire "map_data:$self->{path}"; |
1724 | |
1725 | |
1725 | return if $self->players; |
1726 | return if $self->players; |
1726 | return if $self->isa ("ext::map_per_player");#d# |
1727 | return if $self->isa ("ext::map_per_player");#d# |
1727 | |
1728 | |
1728 | warn "resetting map ", $self->path;#d# |
1729 | warn "resetting map ", $self->path; |
1729 | |
1730 | |
1730 | $self->in_memory (cf::MAP_SWAPPED); |
1731 | $self->in_memory (cf::MAP_SWAPPED); |
1731 | |
1732 | |
1732 | # need to save uniques path |
1733 | # need to save uniques path |
1733 | unless ($self->{deny_save}) { |
1734 | unless ($self->{deny_save}) { |
… | |
… | |
2501 | { |
2502 | { |
2502 | my $faces = $facedata->{faceinfo}; |
2503 | my $faces = $facedata->{faceinfo}; |
2503 | |
2504 | |
2504 | while (my ($face, $info) = each %$faces) { |
2505 | while (my ($face, $info) = each %$faces) { |
2505 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
2506 | my $idx = (cf::face::find $face) || cf::face::alloc $face; |
2506 | warn "$face $info->{magicmap}\n" if $face =~ /obol/;#d# |
|
|
2507 | cf::face::set $idx, $info->{visibility}, $info->{magicmap}; |
2507 | cf::face::set $idx, $info->{visibility}, $info->{magicmap}; |
2508 | cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; |
2508 | cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; |
2509 | cf::face::set_data $idx, 1, $info->{data64}, $info->{chksum64}; |
2509 | cf::face::set_data $idx, 1, $info->{data64}, $info->{chksum64}; |
2510 | Coro::cede; |
2510 | Coro::cede; |
2511 | } |
2511 | } |
… | |
… | |
2560 | sub reload_resources { |
2560 | sub reload_resources { |
2561 | warn "reloading resource files...\n"; |
2561 | warn "reloading resource files...\n"; |
2562 | |
2562 | |
2563 | reload_regions; |
2563 | reload_regions; |
2564 | reload_facedata; |
2564 | reload_facedata; |
|
|
2565 | #reload_archetypes;#d# |
2565 | reload_archetypes; |
2566 | reload_archetypes; |
2566 | reload_treasures; |
2567 | reload_treasures; |
2567 | |
2568 | |
2568 | warn "finished reloading resource files\n"; |
2569 | warn "finished reloading resource files\n"; |
2569 | } |
2570 | } |