… | |
… | |
511 | audio_music_push; |
511 | audio_music_push; |
512 | } |
512 | } |
513 | |
513 | |
514 | sub audio_init { |
514 | sub audio_init { |
515 | if ($CFG->{audio_enable}) { |
515 | if ($CFG->{audio_enable}) { |
516 | DC::Audio::init $CFG->{audio_driver}; |
516 | DC::Audio::init; |
517 | |
517 | |
518 | if ($SDL_MIXER) { |
518 | if ($SDL_MIXER) { |
519 | audio_music_finished; |
519 | audio_music_finished; |
520 | } else { |
520 | } else { |
521 | status "Unable to open sound device: there will be no sound"; |
521 | status "Unable to open sound device: there will be no sound"; |
… | |
… | |
975 | new DC::Protocol |
975 | new DC::Protocol |
976 | host => $host, |
976 | host => $host, |
977 | port => $port, |
977 | port => $port, |
978 | create_login => $create, |
978 | create_login => $create, |
979 | user => $PROFILE->{user}, |
979 | user => $PROFILE->{user}, |
980 | pass => $PROFILE->{password}, |
980 | pass => (pack "H*", $PROFILE->{password}), |
981 | mapw => $mapw, |
981 | mapw => $mapw, |
982 | maph => $maph, |
982 | maph => $maph, |
983 | |
983 | |
984 | c_version => { |
984 | c_version => { |
985 | client => "deliantra", |
985 | client => "deliantra", |
… | |
… | |
1915 | if $self->{text} eq $nullpw; |
1915 | if $self->{text} eq $nullpw; |
1916 | 0 |
1916 | 0 |
1917 | }, |
1917 | }, |
1918 | on_changed => sub { |
1918 | on_changed => sub { |
1919 | my ($self, $value) = @_; |
1919 | my ($self, $value) = @_; |
1920 | $PROFILE->{password} = Deliantra::Util::hash_pw $value |
1920 | $PROFILE->{password} = unpack "H*", Deliantra::Util::hash_pw $value |
1921 | if length $value && $value ne $nullpw; |
1921 | if length $value && $value ne $nullpw; |
1922 | 1 |
1922 | 1 |
1923 | }, |
1923 | }, |
1924 | ); |
1924 | ); |
1925 | |
1925 | |
… | |
… | |
2595 | make_playerbook; |
2595 | make_playerbook; |
2596 | |
2596 | |
2597 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2597 | $MENUPOPUP = DC::UI::Menu->new (items => [ |
2598 | ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], |
2598 | ["Setup…\tF9" , sub { $SETUP_DIALOG->toggle_visibility }], |
2599 | ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], |
2599 | ["Playerbook…\tTab" , sub { $PL_WINDOW ->toggle_visibility }], |
2600 | ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], |
2600 | ["…Statistics\tF2" , sub { toggle_player_page ($::STATS_PAGE) }], |
2601 | ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], |
2601 | ["…Skills\tF3" , sub { toggle_player_page ($::SKILL_PAGE) }], |
2602 | ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], |
2602 | ["…Spells\tF4" , sub { toggle_player_page ($::SPELL_PAGE) }], |
2603 | ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], |
2603 | ["…Inventory\tF5" , sub { toggle_player_page ($::INVENTORY_PAGE) }], |
2604 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2604 | ["Help Browser…\tF1" , sub { $HELP_WINDOW ->toggle_visibility }], |
2605 | ["Quit…" , sub { |
2605 | ["Quit…" , sub { |
2606 | if ($CONN) { |
2606 | if ($CONN) { |
… | |
… | |
3080 | |
3080 | |
3081 | $CFG->{profile}{$profile} ||= {}; |
3081 | $CFG->{profile}{$profile} ||= {}; |
3082 | $PROFILE = $CFG->{profile}{$profile}; |
3082 | $PROFILE = $CFG->{profile}{$profile}; |
3083 | $PROFILE->{host} ||= "gameserver.deliantra.net"; |
3083 | $PROFILE->{host} ||= "gameserver.deliantra.net"; |
3084 | |
3084 | |
3085 | $PROFILE->{host} = $args[0] if @args > 0; |
3085 | $PROFILE->{host} = $args[0] if @args > 0; |
3086 | $PROFILE->{user} = $args[1] if @args > 1; |
3086 | $PROFILE->{user} = $args[1] if @args > 1; |
3087 | $PROFILE->{password} = $args[2] if @args > 2; |
3087 | $PROFILE->{password} = unpack "H*", Deliantra::Util::hash_pw $args[2] if @args > 2; |
3088 | |
3088 | |
3089 | # convert old bindings (only default profile matters) |
3089 | # convert old bindings (only default profile matters) |
3090 | if (my $bindings = delete $PROFILE->{bindings}) { |
3090 | if (my $bindings = delete $PROFILE->{bindings}) { |
3091 | while (my ($mod, $syms) = each %$bindings) { |
3091 | while (my ($mod, $syms) = each %$bindings) { |
3092 | while (my ($sym, $cmds) = each %$syms) { |
3092 | while (my ($sym, $cmds) = each %$syms) { |