… | |
… | |
56 | |
56 | |
57 | if ($^O eq "MSWin32") { |
57 | if ($^O eq "MSWin32") { |
58 | # pango is relocatable on win32 |
58 | # pango is relocatable on win32 |
59 | } else { |
59 | } else { |
60 | # OS X |
60 | # OS X |
61 | $ENV{FONTCONFIG_FILE} = "$root/fonts.conf"; # no effect??!?! |
|
|
62 | $ENV{FONTCONFIG_DIR} = $root; # no effect??!?! |
|
|
63 | $ENV{PANGO_RC_FILE} = "$root/pango.rc"; |
61 | $ENV{PANGO_RC_FILE} = "$root/pango.rc"; |
64 | $ENV{DYLD_LIBRARY_PATH} = $root; |
62 | $ENV{DYLD_LIBRARY_PATH} = $root; |
65 | chdir $root; # for pango modules, maybe other things |
63 | chdir $root; # for pango modules, maybe other things |
66 | } |
64 | } |
67 | |
65 | |
68 | unshift @INC, $root; |
66 | unshift @INC, $root; |
69 | } |
67 | } |
70 | } |
68 | } |
71 | |
69 | |
72 | # prepend private library directory |
70 | # prepend private library directory and prepare env |
73 | BEGIN { |
71 | BEGIN { |
74 | for (grep !ref, @INC) { |
72 | for (grep !ref, @INC) { |
75 | my $path = "$_/Deliantra/Client/private"; |
73 | my $path = "$_/Deliantra/Client/private"; |
76 | if (-d $path) { |
74 | if (-d $path) { |
77 | unshift @INC, $path; |
75 | unshift @INC, $path; |
… | |
… | |
818 | |
816 | |
819 | on_connect => sub { |
817 | on_connect => sub { |
820 | if ($_[0]) { |
818 | if ($_[0]) { |
821 | DC::lowdelay fileno $CONN->{fh}; |
819 | DC::lowdelay fileno $CONN->{fh}; |
822 | |
820 | |
823 | status "login successful"; |
821 | status "successfully connected to the server"; |
824 | } else { |
822 | } else { |
825 | undef $CONN; |
823 | undef $CONN; |
826 | status "unable to connect: $!"; |
824 | status "unable to connect: $!"; |
827 | stop_game(); |
825 | stop_game(); |
828 | } |
826 | } |
… | |
… | |
843 | # hack to make SURE we find the IP address all right |
841 | # hack to make SURE we find the IP address all right |
844 | # can be removed once AnyEvent::DNS is proven stable. |
842 | # can be removed once AnyEvent::DNS is proven stable. |
845 | if ($host eq "gameserver.deliantra.net") { |
843 | if ($host eq "gameserver.deliantra.net") { |
846 | AnyEvent::DNS::a "dnstest.deliantra.net", sub { |
844 | AnyEvent::DNS::a "dnstest.deliantra.net", sub { |
847 | if ($_[0] ne "80.101.114.108") { # Perl |
845 | if ($_[0] ne "80.101.114.108") { # Perl |
|
|
846 | status "dns failure, trying differently"; |
|
|
847 | $host = eval { Socket::inet_ntoa Socket::inet_aton "gameserver.deliantra.net" }; |
|
|
848 | unless (defined $host) { |
848 | status "dns failure, using hardcoded address"; |
849 | status "dns failure, using hardcoded address"; |
849 | $host = "129.13.162.95"; |
850 | $host = "129.13.162.95"; |
|
|
851 | } |
850 | } |
852 | } |
851 | |
853 | |
852 | dc_connect $host, $port; |
854 | dc_connect $host, $port; |
853 | }; |
855 | }; |
854 | } else { |
856 | } else { |
… | |
… | |
2731 | default => "profile", # default profile |
2733 | default => "profile", # default profile |
2732 | show_tips => 1, |
2734 | show_tips => 1, |
2733 | logview_max_par => 1000, |
2735 | logview_max_par => 1000, |
2734 | shift_fire_stop => 0, |
2736 | shift_fire_stop => 0, |
2735 | uitheme => "wood", |
2737 | uitheme => "wood", |
|
|
2738 | map_shift_x => -24, # arbitrary |
|
|
2739 | map_shift_y => +24, # arbitrary |
2736 | ); |
2740 | ); |
2737 | |
2741 | |
2738 | while (my ($k, $v) = each %DEF_CFG) { |
2742 | while (my ($k, $v) = each %DEF_CFG) { |
2739 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2743 | $CFG->{$k} = $v unless exists $CFG->{$k}; |
2740 | } |
2744 | } |
… | |
… | |
2754 | } |
2758 | } |
2755 | } |
2759 | } |
2756 | |
2760 | |
2757 | sdl_init; |
2761 | sdl_init; |
2758 | |
2762 | |
|
|
2763 | $ENV{FONTCONFIG_FILE} = DC::find_rcfile "fonts/fonts.conf"; |
|
|
2764 | $ENV{FONTCONFIG_DIR} = DC::find_rcfile "fonts"; |
|
|
2765 | |
2759 | { |
2766 | { |
2760 | my @fonts = map DC::find_rcfile "fonts/$_", qw( |
2767 | my @fonts = map DC::find_rcfile "fonts/$_", qw( |
2761 | DejaVuSans.ttf |
2768 | DejaVuSans.ttf |
2762 | DejaVuSansMono.ttf |
2769 | DejaVuSansMono.ttf |
2763 | DejaVuSans-Bold.ttf |
2770 | DejaVuSans-Bold.ttf |
2764 | DejaVuSansMono-Bold.ttf |
2771 | DejaVuSansMono-Bold.ttf |
2765 | DejaVuSans-Oblique.ttf |
2772 | DejaVuSans-Oblique.ttf |
2766 | DejaVuSansMono-Oblique.ttf |
2773 | DejaVuSansMono-Oblique.ttf |
2767 | DejaVuSans-BoldOblique.ttf |
2774 | DejaVuSans-BoldOblique.ttf |
2768 | DejaVuSansMono-BoldOblique.ttf |
2775 | DejaVuSansMono-BoldOblique.ttf |
|
|
2776 | mona.ttf |
2769 | ); |
2777 | ); |
2770 | |
2778 | |
2771 | DC::add_font $_ for @fonts; |
2779 | DC::add_font $_ for @fonts; |
2772 | |
2780 | |
2773 | $FONT_PROP = new_from_file DC::Font $fonts[0]; |
2781 | $FONT_PROP = new_from_file DC::Font $fonts[0]; |