ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/Main.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/Main.pm (file contents):
Revision 1.28 by root, Wed Dec 24 06:12:21 2014 UTC vs.
Revision 1.31 by root, Mon Nov 19 00:56:08 2018 UTC

73use DC::UI::ChatView; 73use DC::UI::ChatView;
74use DC::MessageDistributor; 74use DC::MessageDistributor;
75use DC::Pod; 75use DC::Pod;
76use DC::MapWidget; 76use DC::MapWidget;
77use DC::Macro; 77use DC::Macro;
78
79# printf "%5d %5d %5d %5d\n", $_, DC::minpot $_, DC::ld32 $_, 2 << ((DC::ld32 $_ - 1));
78 80
79$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 81$SIG{QUIT} = sub { Carp::cluck "QUIT" };
80$SIG{PIPE} = 'IGNORE'; 82$SIG{PIPE} = 'IGNORE';
81 83
82$EV::DIED = sub { 84$EV::DIED = sub {
1540 $DELIANTRA_DEBUG ^= $_[0]; 1542 $DELIANTRA_DEBUG ^= $_[0];
1541 1543
1542 if ($DELIANTRA_DEBUG & 16) { 1544 if ($DELIANTRA_DEBUG & 16) {
1543 $BW_WATCHER = EV::periodic 0, 1, 0, sub { 1545 $BW_WATCHER = EV::periodic 0, 1, 0, sub {
1544 return unless $CONN; 1546 return unless $CONN;
1545 debug sprintf "%8.2gKB/s", $CONN->{octets_in} / 1e3; 1547 debug sprintf "%8.2gkB/s", $CONN->{octets_in} / 1e3;
1546 $CONN->{octets_in} = 0; 1548 $CONN->{octets_in} = 0;
1547 }; 1549 };
1548 } else { 1550 } else {
1549 undef $BW_WATCHER; 1551 undef $BW_WATCHER;
1550 } 1552 }
2028 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate"); 2030 $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate");
2029 $table->add_at (1, $row, new DC::UI::Entry 2031 $table->add_at (1, $row, new DC::UI::Entry
2030 text => $CFG->{output_rate}, 2032 text => $CFG->{output_rate},
2031 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " 2033 tooltip => "The maximum bandwidth in bytes per second that the server should not exceed "
2032 . "when sending data. When 0 or unset, the server " 2034 . "when sending data. When 0 or unset, the server "
2033 . "default will be used, which is usually around 100kb/s. Most servers will " 2035 . "default will be used, which is usually around 100kB/s. Most servers will "
2034 . "dynamically find an optimal rate, so adjust this only when necessary.", 2036 . "dynamically find an optimal rate, so adjust this only when necessary.",
2035 on_changed => sub { $CFG->{output_rate} = $_[1]; 1 }, 2037 on_changed => sub { $CFG->{output_rate} = $_[1]; 1 },
2036 ); 2038 );
2037 2039
2038 $vbox->add (new DC::UI::FancyFrame 2040 $vbox->add (new DC::UI::FancyFrame
2604 ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], 2606 ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }],
2605 ["Quit…" , sub { 2607 ["Quit…" , sub {
2606 if ($CONN) { 2608 if ($CONN) {
2607 open_quit_dialog; 2609 open_quit_dialog;
2608 } else { 2610 } else {
2609 EV::unloop EV::UNLOOP_ALL; 2611 EV::break EV::BREAK_ALL;
2610 } 2612 }
2611 }], 2613 }],
2612 ]); 2614 ]);
2613 2615
2614 $BUTTONBAR->add (new DC::UI::Button text => "Menu…", 2616 $BUTTONBAR->add (new DC::UI::Button text => "Menu…",
2985 delete $animate_object{$widget}; 2987 delete $animate_object{$widget};
2986} 2988}
2987 2989
2988$SDL_CB[DC::SDL_QUIT] = sub { 2990$SDL_CB[DC::SDL_QUIT] = sub {
2989 crash "SDL_QUIT"; 2991 crash "SDL_QUIT";
2990 EV::unloop EV::UNLOOP_ALL; 2992 EV::break EV::BREAK_ALL;
2991}; 2993};
2992$SDL_CB[DC::SDL_VIDEORESIZE] = sub { }; 2994$SDL_CB[DC::SDL_VIDEORESIZE] = sub { };
2993$SDL_CB[DC::SDL_VIDEOEXPOSE] = sub { 2995$SDL_CB[DC::SDL_VIDEOEXPOSE] = sub {
2994 DC::UI::full_refresh; 2996 DC::UI::full_refresh;
2995}; 2997};
3028}; 3030};
3029 3031
3030############################################################################# 3032#############################################################################
3031 3033
3032$SIG{INT} = $SIG{TERM} = sub { 3034$SIG{INT} = $SIG{TERM} = sub {
3033 EV::unloop; 3035 EV::break;
3034 #d# TODO calling exit here hangs the process in some futex 3036 #d# TODO calling exit here hangs the process in some futex
3035}; 3037};
3036 3038
3037# due to mac os x + sdl combined braindamage, we need this contortion 3039# due to mac os x + sdl combined braindamage, we need this contortion
3038sub DC::Main::run { 3040sub DC::Main::run {
3155 }; 3157 };
3156 3158
3157 debug_toggle 0; 3159 debug_toggle 0;
3158 3160
3159 delete $SIG{__DIE__}; 3161 delete $SIG{__DIE__};
3160 EV::loop; 3162 EV::run;
3161 3163
3162 DC::save_cfg if $CFG->{config_autosave}; 3164 DC::save_cfg if $CFG->{config_autosave};
3163 3165
3164 #video_shutdown; 3166 #video_shutdown;
3165 #audio_shutdown; 3167 #audio_shutdown;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines