… | |
… | |
25 | BEGIN { *time = \&EV::time } |
25 | BEGIN { *time = \&EV::time } |
26 | |
26 | |
27 | use List::Util qw(max min); |
27 | use List::Util qw(max min); |
28 | |
28 | |
29 | use Deliantra; |
29 | use Deliantra; |
|
|
30 | use Deliantra::Util; |
30 | use Deliantra::Protocol::Constants; |
31 | use Deliantra::Protocol::Constants; |
31 | |
32 | |
32 | use AnyEvent::Util (); |
33 | use AnyEvent::Util (); |
33 | use AnyEvent::Socket (); |
34 | use AnyEvent::Socket (); |
34 | use AnyEvent::DNS (); |
35 | use AnyEvent::DNS (); |
… | |
… | |
128 | our $MENUBAR; # the hbox at the top |
129 | our $MENUBAR; # the hbox at the top |
129 | our $MENUPOPUP; |
130 | our $MENUPOPUP; |
130 | our $BUTTONBAR; # the menu buttons |
131 | our $BUTTONBAR; # the menu buttons |
131 | our $METASERVER; |
132 | our $METASERVER; |
132 | our $LOGIN_BUTTON; |
133 | our $LOGIN_BUTTON; |
|
|
134 | our $LOGIN_ERROR; |
133 | our $QUIT_DIALOG; |
135 | our $QUIT_DIALOG; |
134 | our $HOST_ENTRY; |
136 | our $HOST_ENTRY; |
135 | our $FULLSCREEN_ENABLE; |
137 | our $FULLSCREEN_ENABLE; |
136 | our $PICKUP_ENABLE; |
138 | our $PICKUP_ENABLE; |
137 | our $SERVER_INFO; |
139 | our $SERVER_INFO; |
… | |
… | |
251 | : "[<span foreground='#888'>num</span>]"; |
253 | : "[<span foreground='#888'>num</span>]"; |
252 | |
254 | |
253 | # <tt> around next statement works around some bug that keeps the |
255 | # <tt> around next statement works around some bug that keeps the |
254 | # "font =>" from being used on windows |
256 | # "font =>" from being used on windows |
255 | $MODBOX->set_markup ("<tt>$markup</tt>"); |
257 | $MODBOX->set_markup ("<tt>$markup</tt>"); |
|
|
258 | } |
|
|
259 | |
|
|
260 | sub errorbox { |
|
|
261 | my ($msg) = @_; |
|
|
262 | |
|
|
263 | status $msg; |
|
|
264 | |
|
|
265 | my $dialog = new DC::UI::Toplevel |
|
|
266 | x => "center", |
|
|
267 | y => "center", |
|
|
268 | z => 200, |
|
|
269 | title => "Error", |
|
|
270 | child => my $vbox = new DC::UI::VBox, |
|
|
271 | has_close_button => 1, |
|
|
272 | on_delete => sub { |
|
|
273 | $_[0]->destroy; |
|
|
274 | }, |
|
|
275 | ; |
|
|
276 | |
|
|
277 | add $vbox new DC::UI::Label |
|
|
278 | align => 0.5, |
|
|
279 | ellipsise => 0, |
|
|
280 | text => $msg; |
|
|
281 | |
|
|
282 | add $vbox new DC::UI::Button |
|
|
283 | expand => 1, |
|
|
284 | text => "OK", |
|
|
285 | on_activate => sub { |
|
|
286 | $dialog->destroy; |
|
|
287 | 0 |
|
|
288 | } |
|
|
289 | ; |
|
|
290 | |
|
|
291 | $dialog->show; |
256 | } |
292 | } |
257 | |
293 | |
258 | ############################################################################# |
294 | ############################################################################# |
259 | #TODO: maybe move into own audio module... |
295 | #TODO: maybe move into own audio module... |
260 | |
296 | |
… | |
… | |
475 | audio_music_push; |
511 | audio_music_push; |
476 | } |
512 | } |
477 | |
513 | |
478 | sub audio_init { |
514 | sub audio_init { |
479 | if ($CFG->{audio_enable}) { |
515 | if ($CFG->{audio_enable}) { |
480 | DC::Audio::init $CFG->{audio_driver}; |
516 | DC::Audio::init; |
481 | |
517 | |
482 | if ($SDL_MIXER) { |
518 | if ($SDL_MIXER) { |
483 | audio_music_finished; |
519 | audio_music_finished; |
484 | } else { |
520 | } else { |
485 | status "Unable to open sound device: there will be no sound"; |
521 | status "Unable to open sound device: there will be no sound"; |
… | |
… | |
928 | $vbox->add (@dialog); |
964 | $vbox->add (@dialog); |
929 | $dialog->show; |
965 | $dialog->show; |
930 | } |
966 | } |
931 | |
967 | |
932 | sub dc_connect { |
968 | sub dc_connect { |
933 | my ($host, $port) = @_; |
969 | my ($host, $port, $create) = @_; |
934 | |
970 | |
935 | my $mapw = List::Util::min 48, List::Util::max 11, int 1.5 + $WIDTH * $CFG->{mapsize} * 0.01 / 32; |
971 | my $mapw = List::Util::min 48, List::Util::max 11, int 1.5 + $WIDTH * $CFG->{mapsize} * 0.01 / 32; |
936 | my $maph = List::Util::min 48, List::Util::max 11, int 1.5 + $HEIGHT * $CFG->{mapsize} * 0.01 / 32; |
972 | my $maph = List::Util::min 48, List::Util::max 11, int 1.5 + $HEIGHT * $CFG->{mapsize} * 0.01 / 32; |
937 | |
973 | |
938 | $CONN = |
974 | $CONN = |
939 | new DC::Protocol |
975 | new DC::Protocol |
940 | host => $host, |
976 | host => $host, |
941 | port => $port, |
977 | port => $port, |
|
|
978 | create_login => $create, |
942 | user => $PROFILE->{user}, |
979 | user => $PROFILE->{user}, |
943 | pass => $PROFILE->{password}, |
980 | pass => (pack "H*", $PROFILE->{password}), |
944 | mapw => $mapw, |
981 | mapw => $mapw, |
945 | maph => $maph, |
982 | maph => $maph, |
946 | |
983 | |
947 | c_version => { |
984 | c_version => { |
948 | client => "deliantra", |
985 | client => "deliantra", |
… | |
… | |
968 | ota_update_check; |
1005 | ota_update_check; |
969 | |
1006 | |
970 | status "successfully connected to the server"; |
1007 | status "successfully connected to the server"; |
971 | } else { |
1008 | } else { |
972 | undef $CONN; |
1009 | undef $CONN; |
973 | status "unable to connect: $!"; |
1010 | $LOGIN_ERROR->{fg} = [1, 0, 0]; |
|
|
1011 | $LOGIN_ERROR->set_text ("Unable to connect to server: $!"); |
974 | stop_game(); |
1012 | stop_game(); |
975 | } |
1013 | } |
976 | }, |
1014 | }, |
|
|
1015 | |
|
|
1016 | on_addme => sub { |
|
|
1017 | my ($ok, $msg) = @_; |
|
|
1018 | |
|
|
1019 | $LOGIN_ERROR->{fg} = $ok ? [0, 1, 0] : [1, 0, 0]; |
|
|
1020 | $LOGIN_ERROR->set_text ($msg); |
|
|
1021 | }, |
977 | ; |
1022 | ; |
978 | } |
1023 | } |
979 | |
1024 | |
980 | sub start_game { |
1025 | sub start_game($) { |
|
|
1026 | my ($create) = @_; |
|
|
1027 | |
981 | status "logging in..."; |
1028 | status "logging in..."; |
982 | |
1029 | |
983 | my $server = $PROFILE->{host} || $DEFAULT_SERVER; |
1030 | my $server = $PROFILE->{host} || $DEFAULT_SERVER; |
984 | my ($host, $port) = AnyEvent::Socket::parse_hostport $server, "deliantra=13327" |
1031 | my ($host, $port) = AnyEvent::Socket::parse_hostport $server, "deliantra=13327" |
985 | or return status "$server: unable to parse server address, try an empty field."; |
1032 | or return status "$server: unable to parse server address, try an empty field."; |
… | |
… | |
1000 | status "dns failure, using hardcoded address"; |
1047 | status "dns failure, using hardcoded address"; |
1001 | $host = "194.126.175.154"; |
1048 | $host = "194.126.175.154"; |
1002 | } |
1049 | } |
1003 | } |
1050 | } |
1004 | |
1051 | |
1005 | dc_connect $host, $port; |
1052 | dc_connect $host, $port, $create; |
1006 | }; |
1053 | }; |
1007 | } else { |
1054 | } else { |
1008 | dc_connect $host, $port; |
1055 | dc_connect $host, $port, $create; |
1009 | } |
1056 | } |
1010 | } |
1057 | } |
1011 | |
1058 | |
1012 | sub stop_game { |
1059 | sub stop_game { |
1013 | crash "stop_game"; |
1060 | crash "stop_game"; |
… | |
… | |
1131 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Compress Textures"); |
1178 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Compress Textures"); |
1132 | $table->add_at (1, $row++, new DC::UI::CheckBox |
1179 | $table->add_at (1, $row++, new DC::UI::CheckBox |
1133 | state => $CFG->{texture_compression}, |
1180 | state => $CFG->{texture_compression}, |
1134 | tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " |
1181 | tooltip => "Use texture compression. Normally this will not reduce visual quality noticable but " |
1135 | . "will save a lot of memory and increase performance (and also fall prey to the ever-buggy Mac OS X software renderer). " |
1182 | . "will save a lot of memory and increase performance (and also fall prey to the ever-buggy Mac OS X software renderer). " |
1136 | . "The compression algorithm can differ form card to card, so your mileage may vary. This setting is ignored in " |
1183 | . "The compression algorithm can differ from card to card, so your mileage may vary. This setting is ignored in " |
1137 | . "forced OpenGL 1.1 mode and when using the Apple renderer.", |
1184 | . "forced OpenGL 1.1 mode and when using the Apple renderer.", |
1138 | on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } |
1185 | on_changed => sub { my ($self, $value) = @_; $CFG->{texture_compression} = $value; 0 } |
1139 | ); |
1186 | ); |
1140 | |
1187 | |
1141 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fast & Ugly"); |
1188 | $table->add_at (0, $row, new DC::UI::Label align => 1, text => "Fast & Ugly"); |
… | |
… | |
1493 | $DELIANTRA_DEBUG ^= $_[0]; |
1540 | $DELIANTRA_DEBUG ^= $_[0]; |
1494 | |
1541 | |
1495 | if ($DELIANTRA_DEBUG & 16) { |
1542 | if ($DELIANTRA_DEBUG & 16) { |
1496 | $BW_WATCHER = EV::periodic 0, 1, 0, sub { |
1543 | $BW_WATCHER = EV::periodic 0, 1, 0, sub { |
1497 | return unless $CONN; |
1544 | return unless $CONN; |
1498 | debug sprintf "%8.2gKB/s", $CONN->{octets_in} / 1e3; |
1545 | debug sprintf "%8.2gkB/s", $CONN->{octets_in} / 1e3; |
1499 | $CONN->{octets_in} = 0; |
1546 | $CONN->{octets_in} = 0; |
1500 | }; |
1547 | }; |
1501 | } else { |
1548 | } else { |
1502 | undef $BW_WATCHER; |
1549 | undef $BW_WATCHER; |
1503 | } |
1550 | } |
… | |
… | |
1846 | $vbox->add (new DC::UI::FancyFrame |
1893 | $vbox->add (new DC::UI::FancyFrame |
1847 | label => "Login Settings", |
1894 | label => "Login Settings", |
1848 | child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), |
1895 | child => (my $table = new DC::UI::Table expand => 1, col_expand => [0, 1]), |
1849 | ); |
1896 | ); |
1850 | |
1897 | |
|
|
1898 | my $nullpw = "\x00" x 16; |
|
|
1899 | |
1851 | $table->add_at (0, 4, new DC::UI::Label align => 1, text => "Username"); |
1900 | $table->add_at (0, 0, new DC::UI::Label align => 1, text => "Username"); |
1852 | $table->add_at (1, 4, new DC::UI::Entry |
1901 | $table->add_at (1, 0, new DC::UI::Entry |
1853 | text => $PROFILE->{user}, |
1902 | text => $PROFILE->{user}, |
1854 | tooltip => "The name of your character on the server. The name is case-sensitive!", |
1903 | tooltip => "The name of your character on the server. The name is case-sensitive!", |
1855 | on_changed => sub { my ($self, $value) = @_; $PROFILE->{user} = $value; 1 } |
1904 | on_changed => sub { my ($self, $value) = @_; $PROFILE->{user} = $value; 1 } |
1856 | ); |
1905 | ); |
1857 | |
1906 | |
1858 | $table->add_at (0, 5, new DC::UI::Label align => 1, text => "Password"); |
1907 | $table->add_at (0, 1, new DC::UI::Label align => 1, text => "Password"); |
1859 | $table->add_at (1, 5, new DC::UI::Entry |
1908 | $table->add_at (1, 1, my $pw1 = new DC::UI::Entry |
1860 | text => $PROFILE->{password}, |
1909 | text => $PROFILE->{password} ? $nullpw : "", |
1861 | hidden => 1, |
1910 | hidden => 1, |
1862 | tooltip => "The password for your character.", |
1911 | tooltip => "The password for your character.", |
1863 | on_changed => sub { my ($self, $value) = @_; $PROFILE->{password} = $value; 1 } |
1912 | on_focus_in => sub { |
|
|
1913 | my ($self) = @_; |
|
|
1914 | $self->set_text ("") |
|
|
1915 | if $self->{text} eq $nullpw; |
|
|
1916 | 0 |
|
|
1917 | }, |
|
|
1918 | on_changed => sub { |
|
|
1919 | my ($self, $value) = @_; |
|
|
1920 | $PROFILE->{password} = unpack "H*", Deliantra::Util::hash_pw $value |
|
|
1921 | if length $value && $value ne $nullpw; |
|
|
1922 | 1 |
|
|
1923 | }, |
1864 | ); |
1924 | ); |
1865 | |
1925 | |
1866 | $table->add_at (1, 11, $LOGIN_BUTTON = new DC::UI::Button |
1926 | $table->add_at (1, 2, $LOGIN_BUTTON = new DC::UI::Button |
1867 | expand => 1, |
1927 | expand => 1, |
1868 | text => "Login / Register", |
1928 | text => "Login to Existing Account", |
1869 | tooltip => "This button will either login to the account configured above or register a new account.", |
1929 | tooltip => "This button will login to the account given by the <b>Username</b> and <b>Password</b> fields above.", |
1870 | on_activate => sub { |
1930 | on_activate => sub { |
1871 | $CONN ? stop_game |
1931 | $CONN ? stop_game |
1872 | : start_game; |
1932 | : start_game 0; |
1873 | 1 |
1933 | 1 |
1874 | }, |
1934 | }, |
1875 | ); |
1935 | ); |
1876 | |
1936 | |
|
|
1937 | $table->add_at (0, 3, new DC::UI::Label align => 1, text => "Password"); |
|
|
1938 | $table->add_at (1, 3, my $pw2 = new DC::UI::Entry |
|
|
1939 | hidden => 1, |
|
|
1940 | tooltip => "The new password for your character", |
|
|
1941 | ); |
|
|
1942 | |
|
|
1943 | $table->add_at (1, 4, new DC::UI::Button |
|
|
1944 | expand => 1, |
|
|
1945 | text => "Create New Account", |
|
|
1946 | tooltip => "This button will try to create a new account - you need to fill out the <b>Username</b> and the two <b>Password</b> fields above, using the same password for both <b>Password</b> fields.", |
|
|
1947 | on_activate => sub { |
|
|
1948 | if ($pw1->{text} ne $pw2->{text}) { |
|
|
1949 | $LOGIN_ERROR->{fg} = [1, 0, 0]; |
|
|
1950 | $LOGIN_ERROR->set_text ("The passwords do not match - try to enter them again."); |
|
|
1951 | } else { |
|
|
1952 | $CONN or start_game 1; |
|
|
1953 | } |
|
|
1954 | 1 |
|
|
1955 | }, |
|
|
1956 | ); |
|
|
1957 | |
|
|
1958 | $vbox->add (new DC::UI::FancyFrame |
|
|
1959 | label => "Server Message", |
|
|
1960 | tooltip => "The last message, or error, from the server.", |
|
|
1961 | child => ($LOGIN_ERROR = new DC::UI::Label valign => 0, ellipsise => 0), |
|
|
1962 | ); |
|
|
1963 | |
1877 | $vbox->add (new DC::UI::FancyFrame |
1964 | $vbox->add (new DC::UI::FancyFrame |
1878 | label => "How to Play", |
1965 | label => "How to Play", |
1879 | min_h => 240, |
1966 | min_h => 240,#d# should not be necessary - widget bug |
1880 | child => (new DC::UI::Label valign => 0, ellipsise => 0, |
1967 | child => (new DC::UI::Label valign => 0, ellipsise => 0, |
1881 | markup => |
1968 | markup => |
1882 | "First select a suitable video resolution in the <b>Graphics</b> tab, above.\n\n" |
1969 | "First select a suitable video resolution in the <b>Graphics</b> tab, above.\n\n" |
1883 | . "Then register a new account (or use an existing one if you have one). " |
1970 | . "Then create a new account (or use an existing one if you have one).\n\n" |
1884 | . "To register an account, choose a username that hasn't been taken yet (just guess) and " |
1971 | . "To create an account, choose a username that hasn't been taken yet (just guess) and " |
1885 | . "try to log-in. Follow the instructions in the Log tab in the message window.", |
1972 | . "fill out the top two <b>Password</b> fields using the same password, then press <b>Create New Account</b>.", |
1886 | ), |
1973 | ), |
1887 | ); |
1974 | ); |
1888 | |
1975 | |
1889 | $vbox |
1976 | $vbox |
1890 | } |
1977 | } |
… | |
… | |
1941 | $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate"); |
2028 | $table->add_at (0, ++$row, new DC::UI::Label align => 1, text => "Output-Rate"); |
1942 | $table->add_at (1, $row, new DC::UI::Entry |
2029 | $table->add_at (1, $row, new DC::UI::Entry |
1943 | text => $CFG->{output_rate}, |
2030 | text => $CFG->{output_rate}, |
1944 | tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " |
2031 | tooltip => "The maximum bandwidth in bytes per second that the server should not exceed " |
1945 | . "when sending data. When 0 or unset, the server " |
2032 | . "when sending data. When 0 or unset, the server " |
1946 | . "default will be used, which is usually around 100kb/s. Most servers will " |
2033 | . "default will be used, which is usually around 100kB/s. Most servers will " |
1947 | . "dynamically find an optimal rate, so adjust this only when necessary.", |
2034 | . "dynamically find an optimal rate, so adjust this only when necessary.", |
1948 | on_changed => sub { $CFG->{output_rate} = $_[1]; 1 }, |
2035 | on_changed => sub { $CFG->{output_rate} = $_[1]; 1 }, |
1949 | ); |
2036 | ); |
1950 | |
2037 | |
1951 | $vbox->add (new DC::UI::FancyFrame |
2038 | $vbox->add (new DC::UI::FancyFrame |
… | |
… | |
2508 | make_playerbook; |
2595 | make_playerbook; |
2509 | |
2596 | |
2510 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2597 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2511 | ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], |
2598 | ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], |
2512 | ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], |
2599 | ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], |
2513 | ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], |
2600 | ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], |
2514 | ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], |
2601 | ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], |
2515 | ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], |
2602 | ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], |
2516 | ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], |
2603 | ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], |
2517 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2604 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2518 | ["Quit…" , sub { |
2605 | ["Quit…" , sub { |
2519 | if ($CONN) { |
2606 | if ($CONN) { |
2520 | open_quit_dialog; |
2607 | open_quit_dialog; |
2521 | } else { |
2608 | } else { |
2522 | EV::unloop EV::UNLOOP_ALL; |
2609 | EV::break EV::BREAK_ALL; |
2523 | } |
2610 | } |
2524 | }], |
2611 | }], |
2525 | ]); |
2612 | ]); |
2526 | |
2613 | |
2527 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
2614 | $BUTTONBAR->add (new DC::UI::Button text => "Menu…", |
… | |
… | |
2898 | delete $animate_object{$widget}; |
2985 | delete $animate_object{$widget}; |
2899 | } |
2986 | } |
2900 | |
2987 | |
2901 | $SDL_CB[DC::SDL_QUIT] = sub { |
2988 | $SDL_CB[DC::SDL_QUIT] = sub { |
2902 | crash "SDL_QUIT"; |
2989 | crash "SDL_QUIT"; |
2903 | EV::unloop EV::UNLOOP_ALL; |
2990 | EV::break EV::BREAK_ALL; |
2904 | }; |
2991 | }; |
2905 | $SDL_CB[DC::SDL_VIDEORESIZE] = sub { }; |
2992 | $SDL_CB[DC::SDL_VIDEORESIZE] = sub { }; |
2906 | $SDL_CB[DC::SDL_VIDEOEXPOSE] = sub { |
2993 | $SDL_CB[DC::SDL_VIDEOEXPOSE] = sub { |
2907 | DC::UI::full_refresh; |
2994 | DC::UI::full_refresh; |
2908 | }; |
2995 | }; |
… | |
… | |
2941 | }; |
3028 | }; |
2942 | |
3029 | |
2943 | ############################################################################# |
3030 | ############################################################################# |
2944 | |
3031 | |
2945 | $SIG{INT} = $SIG{TERM} = sub { |
3032 | $SIG{INT} = $SIG{TERM} = sub { |
2946 | EV::unloop; |
3033 | EV::break; |
2947 | #d# TODO calling exit here hangs the process in some futex |
3034 | #d# TODO calling exit here hangs the process in some futex |
2948 | }; |
3035 | }; |
2949 | |
3036 | |
2950 | # due to mac os x + sdl combined braindamage, we need this contortion |
3037 | # due to mac os x + sdl combined braindamage, we need this contortion |
2951 | sub DC::Main::run { |
3038 | sub DC::Main::run { |
… | |
… | |
2993 | |
3080 | |
2994 | $CFG->{profile}{$profile} ||= {}; |
3081 | $CFG->{profile}{$profile} ||= {}; |
2995 | $PROFILE = $CFG->{profile}{$profile}; |
3082 | $PROFILE = $CFG->{profile}{$profile}; |
2996 | $PROFILE->{host} ||= "gameserver.deliantra.net"; |
3083 | $PROFILE->{host} ||= "gameserver.deliantra.net"; |
2997 | |
3084 | |
2998 | $PROFILE->{host} = $args[0] if @args > 0; |
3085 | $PROFILE->{host} = $args[0] if @args > 0; |
2999 | $PROFILE->{user} = $args[1] if @args > 1; |
3086 | $PROFILE->{user} = $args[1] if @args > 1; |
3000 | $PROFILE->{password} = $args[2] if @args > 2; |
3087 | $PROFILE->{password} = unpack "H*", Deliantra::Util::hash_pw $args[2] if @args > 2; |
3001 | |
3088 | |
3002 | # convert old bindings (only default profile matters) |
3089 | # convert old bindings (only default profile matters) |
3003 | if (my $bindings = delete $PROFILE->{bindings}) { |
3090 | if (my $bindings = delete $PROFILE->{bindings}) { |
3004 | while (my ($mod, $syms) = each %$bindings) { |
3091 | while (my ($mod, $syms) = each %$bindings) { |
3005 | while (my ($sym, $cmds) = each %$syms) { |
3092 | while (my ($sym, $cmds) = each %$syms) { |
… | |
… | |
3068 | }; |
3155 | }; |
3069 | |
3156 | |
3070 | debug_toggle 0; |
3157 | debug_toggle 0; |
3071 | |
3158 | |
3072 | delete $SIG{__DIE__}; |
3159 | delete $SIG{__DIE__}; |
3073 | EV::loop; |
3160 | EV::run; |
3074 | |
3161 | |
3075 | DC::save_cfg if $CFG->{config_autosave}; |
3162 | DC::save_cfg if $CFG->{config_autosave}; |
3076 | |
3163 | |
3077 | #video_shutdown; |
3164 | #video_shutdown; |
3078 | #audio_shutdown; |
3165 | #audio_shutdown; |