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.74 by root, Sun Oct 1 15:59:29 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 cfg_load {
1035 open my $fh, "<:utf8", cf::confdir . "/config"
1036 or return;
1037
1038 local $/;
1039 *CFG = YAML::Syck::Load <$fh>;
1040}
1041
1024sub main { 1042sub main {
1043 cfg_load;
1025 db_load; 1044 db_load;
1026 load_extensions; 1045 load_extensions;
1027 Event::loop; 1046 Event::loop;
1028} 1047}
1029 1048
1081 1100
1082 # reload cf.pm 1101 # reload cf.pm
1083 $msg->("reloading cf.pm"); 1102 $msg->("reloading cf.pm");
1084 require cf; 1103 require cf;
1085 1104
1086 # load database again 1105 # load config and database again
1106 cf::cfg_load;
1087 cf::db_load; 1107 cf::db_load;
1088 1108
1089 # load extensions 1109 # load extensions
1090 $msg->("load extensions"); 1110 $msg->("load extensions");
1091 cf::load_extensions; 1111 cf::load_extensions;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines