--- deliantra/server/lib/cf.pm 2007/03/23 18:32:48 1.227 +++ deliantra/server/lib/cf.pm 2007/04/04 00:02:06 1.231 @@ -375,6 +375,17 @@ 1 } +=item cf::datalog type => key => value, ... + +Log a datalog packet of the given type with the given key-value pairs. + +=cut + +sub datalog($@) { + my ($type, %kv) = @_; + warn "DATALOG ", JSON::XS->new->ascii->encode ({ %kv, type => $type }); +} + =back =cut @@ -1115,13 +1126,13 @@ \@paths } -=item $player->ext_reply ($msgid, $msgtype, %msg) +=item $player->ext_reply ($msgid, %msg) Sends an ext reply to the player. =cut -sub ext_reply($$$%) { +sub ext_reply($$%) { my ($self, $id, %msg) = @_; $msg{msgid} = $id; @@ -1129,6 +1140,22 @@ $self->send ("ext " . cf::to_json \%msg); } +=item $player->ext_event ($type, %msg) + +Sends an ext event to the client. + +=cut + +sub ext_event($$%) { + my ($self, $type, %msg) = @_; + + delete $msg{msgid}; + $msg{msgtype} = "event"; + $msg{eventtype} = $type; + + $self->send ("ext " . cf::to_json \%msg); +} + package cf; =back @@ -2095,7 +2122,7 @@ =pod -The following fucntions and emthods are available within a safe environment: +The following functions and methods are available within a safe environment: cf::object contr pay_amount pay_player map cf::object::player player @@ -2260,10 +2287,10 @@ ############################################################################# # the server's init and main functions -sub load_faces { - my $path = sprintf "%s/faces", cf::datadir; +sub load_facedata { + my $path = sprintf "%s/facedata", cf::datadir; - warn "loading faces from $path\n"; + warn "loading facedata from $path\n"; my $faces; 0 < aio_load $path, $faces @@ -2281,6 +2308,7 @@ my $idx = (cf::face::find $face) || cf::face::alloc $face; cf::face::set $idx, $info->{visibility}, $info->{magicmap}; cf::face::set_data $idx, 0, $info->{data32}, $info->{chksum32}; + cf::face::set_data $idx, 1, $info->{data64}, $info->{chksum64}; Coro::cede; } @@ -2302,8 +2330,8 @@ sub reload_resources { load_resource_file sprintf "%s/%s/regions", cf::datadir, cf::mapdir or die "unable to load regions file\n";#d# - load_faces - or die "unable to load faces\n";#d# + load_facedata + or die "unable to load facedata\n";#d# } sub init {