aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorred-001 <red-001@outlook.ie>2018-02-15 20:18:54 +0000
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-02-15 21:18:54 +0100
commit338d645fcfa1f07a82c4940aa09a6fb265ff608f (patch)
treec2665c7108e84f677fc20ae2f8d90984fcd8532f /src/network
parent861cfd848473db6c36b0debb7152d98ca8017062 (diff)
downloadminetest-338d645fcfa1f07a82c4940aa09a6fb265ff608f.tar.gz
minetest-338d645fcfa1f07a82c4940aa09a6fb265ff608f.tar.bz2
minetest-338d645fcfa1f07a82c4940aa09a6fb265ff608f.zip
Add `on_auth_fail` callback (#7039)
Called when a client fails to supply the correct password for the account it's attempting to login as.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/serverpackethandler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index 6ea58a7ec..98697d72f 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -1735,10 +1735,12 @@ void Server::handleCommand_SrpBytesM(NetworkPacket* pkt)
return;
}
+ std::string ip = getPeerAddress(pkt->getPeerId()).serializeString();
actionstream << "Server: User " << client->getName()
- << " at " << getPeerAddress(pkt->getPeerId()).serializeString()
+ << " at " << ip
<< " supplied wrong password (auth mechanism: SRP)."
<< std::endl;
+ m_script->on_auth_failure(client->getName(), ip);
DenyAccess(pkt->getPeerId(), SERVER_ACCESSDENIED_WRONG_PASSWORD);
return;
}