diff --git a/control/config.txt b/control/config.txt index d9aadd68f3..57152bd0bd 100644 --- a/control/config.txt +++ b/control/config.txt @@ -34,6 +34,9 @@ XKore_listenIp 127.0.0.1 XKore_listenPort 6901 XKore_publicIp 127.0.0.1 XKore_ID + +# XKore misc configuration +XKore_autoReplyPinCode 1 # It is not advised to set secureAdminPassword if you're using Xkore 2 secureAdminPassword 1 diff --git a/src/Network/Receive.pm b/src/Network/Receive.pm index b1ce11d3e4..5e64745f63 100644 --- a/src/Network/Receive.pm +++ b/src/Network/Receive.pm @@ -3912,7 +3912,7 @@ sub login_pin_code_request { # This is ten second-level password login for 2013/3/29 upgrading of twRO my ($self, $args) = @_; - if($args->{flag} ne 0 && ($config{XKore} eq "1" || $config{XKore} eq "3")) { + if(($config{XKore} eq "1" || $config{XKore} eq "3") && !$config{XKore_autoReplyPinCode}) { $timeout{master}{time} = time; return; } diff --git a/src/Network/Receive/RMS.pm b/src/Network/Receive/RMS.pm index ca33435923..4c853bf7e4 100644 --- a/src/Network/Receive/RMS.pm +++ b/src/Network/Receive/RMS.pm @@ -16,11 +16,6 @@ package Network::Receive::RMS; use strict; use base qw(Network::Receive::kRO::RagexeRE_2014_10_22b); -use Globals qw($firstLoginMap $startingzeny @chars %config $sentWelcomeMessage $accountID $messageSender %timeout); -use Log qw(debug message warning error); -use Translation qw(T); -use Utils qw(getHex); -use Misc qw(charSelectScreen); sub new { my ($class) = @_; @@ -29,62 +24,4 @@ sub new { return $self; } -sub login_pin_code_request { - my ($self, $args) = @_; - # flags: - # 0 - correct - RMS - # 1 - requested (already defined) - RMS - # 3 - expired - RMS(?) - # 4 - requested (not defined) - RMS - # 7 - correct - RMS - # 8 - incorrect - RMS - if ($args->{flag} == 7) { # removed check for seed 0, eA/rA/brA sends a normal seed. - message T("PIN code is correct.\n"), "success"; - # call charSelectScreen - if (charSelectScreen(1) == 1) { - $firstLoginMap = 1; - $startingzeny = $chars[$config{'char'}]{'zeny'} unless defined $startingzeny; - $sentWelcomeMessage = 1; - } - } elsif ($args->{flag} == 1) { - # PIN code query request. - $accountID = $args->{accountID}; - debug sprintf("Account ID: %s (%s)\n", unpack('V',$accountID), getHex($accountID)); - - message T("Server requested PIN password in order to select your character.\n"), "connection"; - return if ($config{loginPinCode} eq '' && !($self->queryAndSaveLoginPinCode())); - $messageSender->sendLoginPinCode($args->{seed}, 0); - } elsif ($args->{flag} == 4) { - # PIN code has never been set before, so set it. - warning T("PIN password is not set for this account.\n"), "connection"; - return if ($config{loginPinCode} eq '' && !($self->queryAndSaveLoginPinCode())); - - while ((($config{loginPinCode} =~ /[^0-9]/) || (length($config{loginPinCode}) != 4)) && - !($self->queryAndSaveLoginPinCode("Your PIN should never contain anything but exactly 4 numbers.\n"))) { - error T("Your PIN should never contain anything but exactly 4 numbers.\n"); - } - $messageSender->sendLoginPinCode($args->{seed}, 1); - } elsif ($args->{flag} == 3) { - # should we use the same one again? is it possible? - warning T("PIN password expired.\n"), "connection"; - return if ($config{loginPinCode} eq '' && !($self->queryAndSaveLoginPinCode())); - - while ((($config{loginPinCode} =~ /[^0-9]/) || (length($config{loginPinCode}) != 4)) && - !($self->queryAndSaveLoginPinCode("Your PIN should never contain anything but exactly 4 numbers.\n"))) { - error T("Your PIN should never contain anything but exactly 4 numbers.\n"); - } - $messageSender->sendLoginPinCode($args->{seed}, 1); - } elsif ($args->{flag} == 8) { - # PIN code incorrect. - error T("PIN code is incorrect.\n"); - #configModify('loginPinCode', '', 1); - return if (!($self->queryAndSaveLoginPinCode(T("The login PIN code that you entered is incorrect. Please re-enter your login PIN code.")))); - $messageSender->sendLoginPinCode($args->{seed}, 0); - } else { - debug("login_pin_code_request: unknown flag $args->{flag}\n"); - } - - $timeout{master}{time} = time; -} - 1;