… | |
… | |
98 | |
98 | |
99 | use Deliantra; |
99 | use Deliantra; |
100 | use Deliantra::Protocol::Constants; |
100 | use Deliantra::Protocol::Constants; |
101 | |
101 | |
102 | use AnyEvent::DNS; |
102 | use AnyEvent::DNS; |
|
|
103 | use AnyEvent::Socket (); |
103 | |
104 | |
104 | use Compress::LZF; |
105 | use Compress::LZF; |
105 | |
106 | |
106 | use DC; |
107 | use DC; |
107 | BEGIN { $SIG{__DIE__} = sub { DC::fatal Carp::longmess "$@" unless $^S } } |
108 | BEGIN { $SIG{__DIE__} = sub { DC::fatal Carp::longmess "$@" unless $^S } } |
… | |
… | |
736 | my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; |
737 | my $mapsize = List::Util::min 32, List::Util::max 11, int $WIDTH * $CFG->{mapsize} * 0.01 / 32; |
737 | |
738 | |
738 | $CONN = |
739 | $CONN = |
739 | new DC::Protocol |
740 | new DC::Protocol |
740 | host => $host, |
741 | host => $host, |
741 | port => $port || "deliantra=13327", |
742 | port => $port, |
742 | user => $PROFILE->{user}, |
743 | user => $PROFILE->{user}, |
743 | pass => $PROFILE->{password}, |
744 | pass => $PROFILE->{password}, |
744 | mapw => $mapsize, |
745 | mapw => $mapsize, |
745 | maph => $mapsize, |
746 | maph => $mapsize, |
746 | |
747 | |
… | |
… | |
774 | status "logging in..."; |
775 | status "logging in..."; |
775 | |
776 | |
776 | $LOGIN_BUTTON->set_text ("Logout"); |
777 | $LOGIN_BUTTON->set_text ("Logout"); |
777 | $SETUP_DIALOG->hide; |
778 | $SETUP_DIALOG->hide; |
778 | |
779 | |
779 | my ($host, $port) = split /:/, $PROFILE->{host}; |
780 | my ($host, $port) = AnyEvent::Socket::parse_hostport $PROFILE->{host}, "deliantra=13327"; |
780 | |
781 | |
781 | $MAP = new DC::Map; |
782 | $MAP = new DC::Map; |
782 | |
783 | |
783 | # hack to make SURE we find the IP address all right |
784 | # hack to make SURE we find the IP address all right |
784 | # can be removed once AnyEvent::DNS is proven stable. |
785 | # can be removed once AnyEvent::DNS is proven stable. |