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.323 by root, Sat Jul 28 12:02:58 2007 UTC vs.
Revision 1.329 by root, Fri Aug 10 05:38:16 2007 UTC

1370 $self->{deny_save} = 1; 1370 $self->{deny_save} = 1;
1371 1371
1372 $cf::PLAYER{$login} = $self; 1372 $cf::PLAYER{$login} = $self;
1373 1373
1374 $self 1374 $self
1375}
1376
1377=item $player->send_msg ($channel, $msg, $color, [extra...])
1378
1379=cut
1380
1381sub send_msg {
1382 my $ns = shift->ns
1383 or return;
1384 $ns->send_msg (@_);
1375} 1385}
1376 1386
1377=item $pl->quit_character 1387=item $pl->quit_character
1378 1388
1379Nukes the player without looking back. If logged in, the connection will 1389Nukes the player without looking back. If logged in, the connection will
1921 $self->set_darkness_map; 1931 $self->set_darkness_map;
1922 Coro::cede; 1932 Coro::cede;
1923 $self->activate; 1933 $self->activate;
1924 } 1934 }
1925 1935
1936 $self->{last_save} = $cf::RUNTIME;
1937 $self->last_access ($cf::RUNTIME);
1938
1926 $self->in_memory (cf::MAP_IN_MEMORY); 1939 $self->in_memory (cf::MAP_IN_MEMORY);
1927 } 1940 }
1928 1941
1929 $self->post_load; 1942 $self->post_load;
1930} 1943}
2238 } else { 2251 } else {
2239 $msg = $npc->name . " says: $msg" if $npc; 2252 $msg = $npc->name . " says: $msg" if $npc;
2240 $self->message ($msg, $flags); 2253 $self->message ($msg, $flags);
2241 } 2254 }
2242 } 2255 }
2256}
2257
2258=item $object->send_msg ($channel, $msg, $color, [extra...])
2259
2260=cut
2261
2262sub cf::object::send_msg {
2263 my $pl = shift->contr
2264 or return;
2265 $pl->send_msg (@_);
2243} 2266}
2244 2267
2245=item $player_object->may ("access") 2268=item $player_object->may ("access")
2246 2269
2247Returns wether the given player is authorized to access resource "access" 2270Returns wether the given player is authorized to access resource "access"
2547 || s/<fg name=\"([^"]+)\">([^<]*)<\/fg>/[color=$1]${2}[\/color]/; 2570 || s/<fg name=\"([^"]+)\">([^<]*)<\/fg>/[color=$1]${2}[\/color]/;
2548 } 2571 }
2549 2572
2550 $color &= cf::NDI_COLOR_MASK; 2573 $color &= cf::NDI_COLOR_MASK;
2551 2574
2575 utf8::encode $msg;
2576
2552 if (0 && $msg =~ /\[/) { 2577 if (0 && $msg =~ /\[/) {
2553 $self->send_packet ("drawextinfo $color 4 0 $msg") 2578 $self->send_packet ("drawextinfo $color 4 0 $msg")
2554 } else { 2579 } else {
2555 $msg =~ s/\[\/?(?:b|i|u|fixed|color)[^\]]*\]//g; 2580 $msg =~ s/\[\/?(?:b|i|u|fixed|color)[^\]]*\]//g;
2556 $self->send_packet ("drawinfo $color $msg") 2581 $self->send_packet ("drawinfo $color $msg")
2705our $safe = new Safe "safe"; 2730our $safe = new Safe "safe";
2706our $safe_hole = new Safe::Hole; 2731our $safe_hole = new Safe::Hole;
2707 2732
2708$SIG{FPE} = 'IGNORE'; 2733$SIG{FPE} = 'IGNORE';
2709 2734
2710$safe->permit_only (Opcode::opset qw(:base_core :base_mem :base_orig :base_math sort time)); 2735$safe->permit_only (Opcode::opset qw(
2736 :base_core :base_mem :base_orig :base_math
2737 grepstart grepwhile mapstart mapwhile
2738 sort time
2739));
2711 2740
2712# here we export the classes and methods available to script code 2741# here we export the classes and methods available to script code
2713 2742
2714=pod 2743=pod
2715 2744
2730 2759
2731=cut 2760=cut
2732 2761
2733for ( 2762for (
2734 ["cf::object" => qw(contr pay_amount pay_player map force_find force_add x y 2763 ["cf::object" => qw(contr pay_amount pay_player map force_find force_add x y
2735 insert remove)], 2764 insert remove inv)],
2736 ["cf::object::player" => qw(player)], 2765 ["cf::object::player" => qw(player)],
2737 ["cf::player" => qw(peaceful)], 2766 ["cf::player" => qw(peaceful)],
2738 ["cf::map" => qw(trigger)], 2767 ["cf::map" => qw(trigger)],
2739) { 2768) {
2740 no strict 'refs'; 2769 no strict 'refs';
2906 for (0 .. SOUND_CAST_SPELL_0 - 1) { 2935 for (0 .. SOUND_CAST_SPELL_0 - 1) {
2907 my $sound = $soundconf->{compat}[$_] 2936 my $sound = $soundconf->{compat}[$_]
2908 or next; 2937 or next;
2909 2938
2910 my $face = cf::face::find "sound/$sound->[1]"; 2939 my $face = cf::face::find "sound/$sound->[1]";
2911
2912 cf::sound::set $sound->[0] => $face; 2940 cf::sound::set $sound->[0] => $face;
2913 cf::sound::old_sound_index $_, $face; # gcfclient-compat 2941 cf::sound::old_sound_index $_, $face; # gcfclient-compat
2914 } 2942 }
2915 2943
2944 while (my ($k, $v) = each %{$soundconf->{event}}) {
2945 my $face = cf::face::find "sound/$v";
2946 cf::sound::set $k => $face;
2916 #TODO 2947 }
2917 } 2948 }
2918 } 2949 }
2919 2950
2920 1 2951 1
2921} 2952}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines