diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 16:47:37 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 17:10:16 +0200 |
commit | 030b63c3d298c7d15825995e643d1f4f92731d16 (patch) | |
tree | bfc48ec298b7f04ea340aaa5d2f859d0a0966d90 | |
parent | f3dba05143fc8be277137e42fe1933ac185365d4 (diff) | |
download | minetest-030b63c3d298c7d15825995e643d1f4f92731d16.tar.gz minetest-030b63c3d298c7d15825995e643d1f4f92731d16.tar.bz2 minetest-030b63c3d298c7d15825995e643d1f4f92731d16.zip |
Add and tidy up some Server log output for declined connections
-rw-r--r-- | src/server.cpp | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/server.cpp b/src/server.cpp index 38cedd061..2bd561bf7 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1938,6 +1938,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if(deployed == SER_FMT_VER_INVALID) { + actionstream<<"Server: A mismatched client tried to connect." + <<std::endl; infostream<<"Server: Cannot negotiate " "serialization version with peer " <<peer_id<<std::endl; @@ -1963,6 +1965,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if(net_proto_version == 0) { + actionstream<<"Server: An old tried to connect." + <<std::endl; SendAccessDenied(m_con, peer_id, std::wstring( L"Your client's version is not supported.\n" L"Server version is ") @@ -1975,6 +1979,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) { if(net_proto_version != PROTOCOL_VERSION) { + actionstream<<"Server: A mismatched client tried to connect." + <<std::endl; SendAccessDenied(m_con, peer_id, std::wstring( L"Your client's version is not supported.\n" L"Server version is ") @@ -2002,7 +2008,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if(playername[0]=='\0') { - infostream<<"Server: Player has empty name"<<std::endl; + actionstream<<"Server: Player with an empty name " + <<"tried to connect."<<std::endl; SendAccessDenied(m_con, peer_id, L"Empty name"); return; @@ -2010,7 +2017,8 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) if(string_allowed(playername, PLAYERNAME_ALLOWED_CHARS)==false) { - infostream<<"Server: Player has invalid name"<<std::endl; + actionstream<<"Server: Player with an invalid name " + <<"tried to connect."<<std::endl; SendAccessDenied(m_con, peer_id, L"Name contains unallowed characters"); return; @@ -2025,11 +2033,11 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) } else { - for(u32 i=0; i<PASSWORD_SIZE-1; i++) - { - password[i] = data[23+i]; - } - password[PASSWORD_SIZE-1] = 0; + for(u32 i=0; i<PASSWORD_SIZE-1; i++) + { + password[i] = data[23+i]; + } + password[PASSWORD_SIZE-1] = 0; } // Add player to auth manager @@ -2074,6 +2082,9 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) & (PRIV_SERVER|PRIV_BAN|PRIV_PRIVS|PRIV_PASSWORD)) == 0 && playername != g_settings->get("name")) { + actionstream<<"Server: "<<playername<<" tried to join, but there" + <<" are already max_users=" + <<g_settings->getU16("max_users")<<" players."<<std::endl; SendAccessDenied(m_con, peer_id, L"Too many users."); return; } @@ -2084,7 +2095,7 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id) // If failed, cancel if(player == NULL) { - infostream<<"Server: peer_id="<<peer_id + errorstream<<"Server: peer_id="<<peer_id <<": failed to emerge player"<<std::endl; return; } @@ -4514,11 +4525,8 @@ void dedicated_server_loop(Server &server, bool &kill) { DSTACK(__FUNCTION_NAME); - infostream<<DTIME<<std::endl; - infostream<<"========================"<<std::endl; infostream<<"Running dedicated server"<<std::endl; infostream<<"========================"<<std::endl; - infostream<<std::endl; IntervalLimiter m_profiler_interval; |