ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra/Deliantra.pm
(Generate patch)

Comparing deliantra/Deliantra/Deliantra.pm (file contents):
Revision 1.117 by root, Wed Dec 5 11:03:08 2007 UTC vs.
Revision 1.118 by root, Wed Dec 5 11:39:26 2007 UTC

4 4
5=cut 5=cut
6 6
7package Crossfire; 7package Crossfire;
8 8
9our $VERSION = '1.12'; 9our $VERSION = '1.13';
10 10
11use strict; 11use strict;
12 12
13use base 'Exporter'; 13use base 'Exporter';
14 14
22 *ARCH $TILE *FACE *FACEDATA 22 *ARCH $TILE *FACE *FACEDATA
23 TILESIZE CACHESTRIDE 23 TILESIZE CACHESTRIDE
24 editor_archs arch_extents 24 editor_archs arch_extents
25); 25);
26 26
27use JSON::XS qw(from_json to_json); 27use JSON::XS qw(decode_json encode_json);
28 28
29our $LIB = $ENV{CROSSFIRE_LIBDIR}; 29our $LIB = $ENV{CROSSFIRE_LIBDIR};
30 30
31our $VARDIR = $ENV{HOME} ? "$ENV{HOME}/.crossfire" 31our $VARDIR = $ENV{HOME} ? "$ENV{HOME}/.crossfire"
32 : $ENV{AppData} ? "$ENV{APPDATA}/crossfire" 32 : $ENV{AppData} ? "$ENV{APPDATA}/crossfire"
475} 475}
476 476
477sub attr_thaw($) { 477sub attr_thaw($) {
478 my ($ob) = @_; 478 my ($ob) = @_;
479 479
480 $ob->{attach} = from_json $ob->{attach} 480 $ob->{attach} = decode_json $ob->{attach}
481 if exists $ob->{attach}; 481 if exists $ob->{attach};
482 482
483 $ob 483 $ob
484} 484}
485 485
486sub attr_freeze($) { 486sub attr_freeze($) {
487 my ($ob) = @_; 487 my ($ob) = @_;
488 488
489 $ob->{attach} = Crossfire::to_json $ob->{attach} 489 $ob->{attach} = Crossfire::encode_json $ob->{attach}
490 if exists $ob->{attach}; 490 if exists $ob->{attach};
491 491
492 $ob 492 $ob
493} 493}
494 494

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines