aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIlya <TTChangeTheWorld@gmail.com>2013-04-10 07:34:58 +0400
committerKahrl <kahrl@gmx.net>2013-09-03 07:34:43 +0200
commite61b1773c927cbb8eddd2059cfb3d7c8c14fd149 (patch)
tree674f5df251b8e3b2ffffd5e254bb4536e3644c60 /src
parent1ecf51a13f434f5cbc0f6ccc1b9a2ac6402a895f (diff)
downloadminetest-e61b1773c927cbb8eddd2059cfb3d7c8c14fd149.tar.gz
minetest-e61b1773c927cbb8eddd2059cfb3d7c8c14fd149.tar.bz2
minetest-e61b1773c927cbb8eddd2059cfb3d7c8c14fd149.zip
Server::ProcessData(): call getBanName once instead of twice (#639)
Diffstat (limited to 'src')
-rw-r--r--src/server.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 561e03c7a..8ce8df349 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -1776,12 +1776,13 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
// drop player if is ip is banned
if(m_banmanager->isIpBanned(addr_s)){
+ std::string ban_name = m_banmanager->getBanName(addr_s);
infostream<<"Server: A banned client tried to connect from "
<<addr_s<<"; banned name was "
- <<m_banmanager->getBanName(addr_s)<<std::endl;
+ <<ban_name<<std::endl;
// This actually doesn't seem to transfer to the client
DenyAccess(peer_id, L"Your ip is banned. Banned name was "
- +narrow_to_wide(m_banmanager->getBanName(addr_s)));
+ +narrow_to_wide(ban_name));
m_con.DeletePeer(peer_id);
return;
}