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.28 by root, Sun Jul 30 17:42:14 2006 UTC vs.
Revision 1.30 by elmex, Sat Aug 12 11:51:37 2006 UTC

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.
75for my $pkg (qw(cf::object cf::object::map cf::object::player cf::player cf::map cf::party cf::region)) { 75for 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
292use JSON::Syck (); # TODO# replace by JSON::PC once working 292use JSON::Syck (); # TODO# replace by JSON::PC once working
293 293
294$JSON::Syck::ImplicitUnicode = 1;
295
296sub from_json($) { 294sub 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
300sub to_json($) { 299sub 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>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines