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.70 by root, Sun Oct 1 10:55:37 2006 UTC vs.
Revision 1.72 by root, Sun Oct 1 11:41:37 2006 UTC

5use Storable; 5use Storable;
6use Opcode; 6use Opcode;
7use Safe; 7use Safe;
8use Safe::Hole; 8use Safe::Hole;
9 9
10use YAML::Syck ();
10use Time::HiRes; 11use Time::HiRes;
11use Event; 12use Event;
12$Event::Eval = 1; # no idea why this is required, but it is 13$Event::Eval = 1; # no idea why this is required, but it is
14
15# work around bug in YAML::Syck - bad news for perl6, will it be as broken wrt. unicode?
16$YAML::Syck::ImplicitUnicode = 1;
13 17
14use strict; 18use strict;
15 19
16_init_vars; 20_init_vars;
17 21
108 $JSON::Syck::ImplicitUnicode = 0; # work around JSON::Syck bugs 112 $JSON::Syck::ImplicitUnicode = 0; # work around JSON::Syck bugs
109 JSON::Syck::Dump $_[0] 113 JSON::Syck::Dump $_[0]
110} 114}
111 115
112=back 116=back
117
118=cut
113 119
114############################################################################# 120#############################################################################
115 121
116=head2 EVENTS AND OBJECT ATTACHMENTS 122=head2 EVENTS AND OBJECT ATTACHMENTS
117 123
420This API is preliminary (most likely, the EVENT_KLASS_xxx prefix will be 426This API is preliminary (most likely, the EVENT_KLASS_xxx prefix will be
421removed in future versions), and there is no public API to access override 427removed in future versions), and there is no public API to access override
422results (if you must, access C<@cf::invoke_results> directly). 428results (if you must, access C<@cf::invoke_results> directly).
423 429
424=back 430=back
431
432=cut
425 433
426############################################################################# 434#############################################################################
427 435
428=head2 METHODS VALID FOR ALL CORE OBJECTS 436=head2 METHODS VALID FOR ALL CORE OBJECTS
429 437
912 *{"safe::$fun"} = $safe_hole->wrap ($cb); 920 *{"safe::$fun"} = $safe_hole->wrap ($cb);
913} 921}
914 922
915=back 923=back
916 924
925=cut
926
917############################################################################# 927#############################################################################
918 928
919=head2 EXTENSION DATABASE SUPPORT 929=head2 EXTENSION DATABASE SUPPORT
920 930
921Crossfire maintains a very simple database for extension use. It can 931Crossfire maintains a very simple database for extension use. It can
1019} 1029}
1020 1030
1021############################################################################# 1031#############################################################################
1022# the server's main() 1032# the server's main()
1023 1033
1034sub load_cfg {
1035 open my $fh, "<:utf8", cf::confdir . "/config"
1036 or return;
1037
1038 local $/;
1039 *CFG = YAML::Syck::Load <$fh>;
1040
1041 use Data::Dumper; warn Dumper \%CFG;
1042}
1043
1024sub main { 1044sub main {
1045 load_cfg;
1025 db_load; 1046 db_load;
1026 load_extensions; 1047 load_extensions;
1027 Event::loop; 1048 Event::loop;
1028} 1049}
1029 1050

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines