ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/ext/player-env.ext
(Generate patch)

Comparing deliantra/server/ext/player-env.ext (file contents):
Revision 1.5 by root, Thu Jul 12 18:56:33 2007 UTC vs.
Revision 1.6 by root, Thu Jul 12 19:10:48 2007 UTC

22 22
23our $MUSIC_SCHEDULER = cf::async_ext { 23our $MUSIC_SCHEDULER = cf::async_ext {
24 while () { 24 while () {
25 for (keys %MUSIC_QUEUE) { 25 for (keys %MUSIC_QUEUE) {
26 delete $MUSIC_QUEUE{$_}; 26 delete $MUSIC_QUEUE{$_};
27 my $pl = cf::player::find_active $_
28 or next;
29 27
28 my $pl = cf::player::find_active $_ or next;
29 $pl->ob->active or next;
30 my $ns = $pl->ns 30 my $ns = $pl->ns or next;
31 or next;
32
33 $ns->extcmd 31 $ns->extcmd or next;
34 or next; 32 my $map = $pl->ob->map or next;
35 33
36 my $faces; 34 my $faces;
37
38 my $map = $pl->ob->map
39 or next;
40 35
41 # 1. update map-specific music info 36 # 1. update map-specific music info
42 unless (exists $map->{music_faces}) { 37 unless (exists $map->{music_faces}) {
43 $map->{music_faces} = parse_facelist "music/", $map->{music}; 38 $map->{music_faces} = parse_facelist "music/", $map->{music};
44 } 39 }
69 64
70 my $facestr = join ",", @$faces; 65 my $facestr = join ",", @$faces;
71 $ns->{current_music_faces} ne $facestr 66 $ns->{current_music_faces} ne $facestr
72 or next; 67 or next;
73 68
69 warn "MUSIC CHANGE <$ns->{current_music_faces}> <$facestr>\n";#d#
70
74 $ns->{current_music_faces} = $facestr; 71 $ns->{current_music_faces} = $facestr;
75 72
76 my $msg = { 73 my $msg = {
77 faces => $faces, 74 play => $faces,
78 }; 75 };
79 76
80 $msg->{chksum}{$_} = cf::face::get_chksum $_ 77 my $pri = 0;
78 push @{$msg->{faces}}, [$_, $pri++, cf::face::get_chksum $_]
81 for grep $ns->must_send_face ($_), @$faces; 79 for grep $ns->must_send_face ($_), @$faces;
82 80
83 $ns->ext_event (music => %$msg); 81 $ns->ext_event (music => %$msg);
84 82
85 cf::cede_to_tick; 83 cf::cede_to_tick;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines