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.43 by root, Wed May 21 23:35:55 2008 UTC vs.
Revision 1.44 by root, Mon May 26 03:34:02 2008 UTC

99use Deliantra; 99use Deliantra;
100use Deliantra::Protocol::Constants; 100use Deliantra::Protocol::Constants;
101 101
102use Compress::LZF; 102use Compress::LZF;
103 103
104use DC;
104use DC; BEGIN { $SIG{__DIE__} = sub { DC::fatal Carp::longmess "$@" unless $^S } } 105#d# BEGIN { $SIG{__DIE__} = sub { DC::fatal Carp::longmess "$@" unless $^S } }
105use DC::OpenGL (); 106use DC::OpenGL ();
106use DC::Protocol; 107use DC::Protocol;
107use DC::DB; 108use DC::DB;
108use DC::UI; 109use DC::UI;
109use DC::UI::Canvas; 110use DC::UI::Canvas;
737 738
738 my ($host, $port) = split /:/, $PROFILE->{host}; 739 my ($host, $port) = split /:/, $PROFILE->{host};
739 740
740 $MAP = new DC::Map; 741 $MAP = new DC::Map;
741 742
742 $CONN = eval { 743 $CONN =
743 local $SIG{__DIE__};
744
745 new DC::Protocol 744 new DC::Protocol
746 host => $host, 745 host => $host,
747 port => $port || 13327, 746 port => $port || 13327,
748 user => $PROFILE->{user}, 747 user => $PROFILE->{user},
749 pass => $PROFILE->{password}, 748 pass => $PROFILE->{password},
759 query => \&server_query, 758 query => \&server_query,
760 759
761 setup_req => { 760 setup_req => {
762 smoothing => $CFG->{map_smoothing}*1, 761 smoothing => $CFG->{map_smoothing}*1,
763 }, 762 },
764 };
765 763
766 if ($CONN) { 764 on_connect => sub {
765 if ($_[0]) {
767 DC::lowdelay fileno $CONN->{fh}; 766 DC::lowdelay fileno $CONN->{fh};
768 767
769 status "login successful"; 768 status "login successful";
770 } else { 769 } else {
771 warn $@; 770 undef $CONN;
772 status "unable to connect"; 771 status "unable to connect: $!";
773 stop_game(); 772 stop_game();
773 }
774 },
774 } 775 ;
775} 776}
776 777
777sub stop_game { 778sub stop_game {
778 $LOGIN_BUTTON->set_text ("Login / Register"); 779 $LOGIN_BUTTON->set_text ("Login / Register");
779 $SETUP_NOTEBOOK->set_current_page ($SETUP_LOGIN); 780 $SETUP_NOTEBOOK->set_current_page ($SETUP_LOGIN);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines