… | |
… | |
70 | @ext::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; |
70 | @ext::cf::object::player::ISA = @cf::object::player::ISA = 'cf::object'; |
71 | @ext::cf::object::map::ISA = @cf::object::map::ISA = 'cf::object'; |
71 | @ext::cf::object::map::ISA = @cf::object::map::ISA = 'cf::object'; |
72 | |
72 | |
73 | # we bless all objects into derived classes to force a method lookup |
73 | # we bless all objects into derived classes to force a method lookup |
74 | # within the Safe compartment. |
74 | # within the Safe compartment. |
75 | for my $pkg (qw(cf::object cf::object::map cf::object::player cf::player cf::map cf::party cf::region)) { |
75 | for my $pkg (qw(cf::object cf::object::map cf::object::player cf::player cf::map cf::party cf::region cf::arch)) { |
76 | no strict 'refs'; |
76 | no strict 'refs'; |
77 | @{"ext::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; |
77 | @{"ext::$pkg\::wrap::ISA"} = @{"$pkg\::wrap::ISA"} = $pkg; |
78 | } |
78 | } |
79 | |
79 | |
80 | $Event::DIED = sub { |
80 | $Event::DIED = sub { |
… | |
… | |
289 | ############################################################################# |
289 | ############################################################################# |
290 | # utility functions |
290 | # utility functions |
291 | |
291 | |
292 | use JSON::Syck (); # TODO# replace by JSON::PC once working |
292 | use JSON::Syck (); # TODO# replace by JSON::PC once working |
293 | |
293 | |
294 | $JSON::Syck::ImplicitUnicode = 1; |
|
|
295 | |
|
|
296 | sub from_json($) { |
294 | sub from_json($) { |
|
|
295 | $JSON::Syck::ImplicitUnicode = 1; # work around JSON::Syck bugs |
297 | JSON::Syck::Load $_[0] |
296 | JSON::Syck::Load $_[0] |
298 | } |
297 | } |
299 | |
298 | |
300 | sub to_json($) { |
299 | sub to_json($) { |
|
|
300 | $JSON::Syck::ImplicitUnicode = 0; # work around JSON::Syck bugs |
301 | JSON::Syck::Dump $_[0] |
301 | JSON::Syck::Dump $_[0] |
302 | } |
302 | } |
303 | |
303 | |
304 | ############################################################################# |
304 | ############################################################################# |
305 | # extcmd framework, basically convert ext <msg> |
305 | # extcmd framework, basically convert ext <msg> |