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

Comparing deliantra/Deliantra-Client/bin/deliantra (file contents):
Revision 1.81 by root, Mon Dec 22 02:33:30 2008 UTC vs.
Revision 1.82 by root, Wed Dec 24 04:09:27 2008 UTC

125 125
126$SIG{QUIT} = sub { Carp::cluck "QUIT" }; 126$SIG{QUIT} = sub { Carp::cluck "QUIT" };
127$SIG{PIPE} = 'IGNORE'; 127$SIG{PIPE} = 'IGNORE';
128 128
129$EV::DIED = sub { 129$EV::DIED = sub {
130 crash "CRASH/EV::DIED: $@" => 1; 130 crash "CRASH/EV::DIED: $@" => 0;
131 DC::fatal Carp::longmess $@; 131 DC::fatal Carp::longmess $@;
132}; 132};
133 133
134my $MAX_FPS = 60; 134my $MAX_FPS = 60;
135 135
215# write a crash message blockingly to the socket, if possible 215# write a crash message blockingly to the socket, if possible
216# this is a bit too complicated for my tastes, but it was easy. 216# this is a bit too complicated for my tastes, but it was easy.
217*crash = sub($;$) { 217*crash = sub($;$) {
218 my ($msg, $backtrace) = @_; 218 my ($msg, $backtrace) = @_;
219 219
220 warn $msg;
221
220 return unless $CONN; 222 return unless $CONN;
221 223
222 my $fh = $CONN->{fh} 224 my $fh = $CONN->{fh}
223 or return; 225 or return;
224 226
234 236
235 # backtrace as second step, in case it crashes, too 237 # backtrace as second step, in case it crashes, too
236 crash Carp::longmess "$msg\nbacktrace, for client version $DC::VERSION, generated" 238 crash Carp::longmess "$msg\nbacktrace, for client version $DC::VERSION, generated"
237 if $backtrace; 239 if $backtrace;
238}; 240};
241
242sub clienterror($;$) {
243 my ($msg, $backtrace) = @_;
244
245 warn $msg;
246
247 return unless $CONN;
248
249 $CONN->send_exti_msg (clientlog => $msg);
250 $CONN->send_exti_msg (clientlog => Carp::longmess "$msg\nbacktrace, for client version $DC::VERSION, generated") if $backtrace;
251}
239 252
240############################################################################# 253#############################################################################
241 254
242sub status { 255sub status {
243 $STATUSBOX->add (DC::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]); 256 $STATUSBOX->add (DC::asxml $_[0], pri => -10, group => "status", timeout => 10, fg => [1, 1, 0, 1]);
398 my $rwops = $meta->{path} 411 my $rwops = $meta->{path}
399 ? new_from_file DC::RW $meta->{path} 412 ? new_from_file DC::RW $meta->{path}
400 : new DC::RW $$MUSIC_PLAYING_DATA; 413 : new DC::RW $$MUSIC_PLAYING_DATA;
401 414
402 $MUSIC_PLAYER = new DC::MixMusic $rwops 415 $MUSIC_PLAYER = new DC::MixMusic $rwops
403 or Carp::confess "music face $meta->{face} unloadable: " . DC::Mix_GetError; 416 or return clienterror "music face $meta->{face} unloadable: " . DC::Mix_GetError => 1;
404 417
405 my $NOW = time; 418 my $NOW = time;
406 419
407 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) { 420 if ($MUSIC_PLAYING_META->{stop_time} > $NOW - $MUSIC_RESUME) {
408 my $pos = $MUSIC_PLAYING_META->{stop_pos}; 421 my $pos = $MUSIC_PLAYING_META->{stop_pos};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines