--- deliantra/server/ext/player-env.ext 2007/07/12 08:40:13 1.4 +++ deliantra/server/ext/player-env.ext 2007/07/23 16:53:15 1.8 @@ -13,7 +13,7 @@ [ sort { (cf::face::get_data_size $a) <=> (cf::face::get_data_size $b) } grep $_, - map +(cf::face::find "$prefix$_"), + map +(cf::face::find "$prefix$_" or ((warn "unable to find music file $_"), undef)), split /\s*,\s*/, $list ] } @@ -24,20 +24,17 @@ while () { for (keys %MUSIC_QUEUE) { delete $MUSIC_QUEUE{$_}; - my $pl = cf::player::find_active $_ - or next; - my $ns = $pl->ns - or next; + cf::get_slot 0.01, -10; - $ns->extcmd - or next; + my $pl = cf::player::find_active $_ or next; + $pl->ob->active or next; + my $ns = $pl->ns or next; + $ns->extcmd or next; + my $map = $pl->ob->map or next; my $faces; - my $map = $pl->ob->map - or next; - # 1. update map-specific music info unless (exists $map->{music_faces}) { $map->{music_faces} = parse_facelist "music/", $map->{music}; @@ -74,15 +71,14 @@ $ns->{current_music_faces} = $facestr; my $msg = { - faces => $faces, + play => $faces, }; - $msg->{chksum}{$_} = cf::face::get_chksum $_ + my $pri = 0; + push @{$msg->{faces}}, [$_, $pri++, cf::face::get_chksum $_] for grep $ns->must_send_face ($_), @$faces; $ns->ext_event (music => %$msg); - - cf::cede_to_tick; } Coro::schedule unless %MUSIC_QUEUE; }