Lower log level for unexpected behaviour
authorest31 <MTest31@outlook.com>
Mon, 18 May 2015 22:55:58 +0000 (00:55 +0200)
committerest31 <MTest31@outlook.com>
Mon, 18 May 2015 22:55:58 +0000 (00:55 +0200)
Its a possible mistake to log in to a server with twice the same name.
Before, it triggered a server wide error message, now it logs to actionstream.

src/network/serverpackethandler.cpp
src/server.cpp

index 1eb7064d6f1fb4df10f3c47dd6d847b9edeef465..ea1528c644011f8e815e421d05d85f9c0cb79f96 100644 (file)
@@ -613,7 +613,7 @@ void Server::handleCommand_Init2(NetworkPacket* pkt)
                playersao = StageTwoClientInit(pkt->getPeerId());
 
                if (playersao == NULL) {
-                       errorstream
+                       actionstream
                                << "TOSERVER_INIT2 stage 2 client init failed for peer "
                                << pkt->getPeerId() << std::endl;
                        return;
@@ -710,7 +710,7 @@ void Server::handleCommand_ClientReady(NetworkPacket* pkt)
        PlayerSAO* playersao = StageTwoClientInit(peer_id);
 
        if (playersao == NULL) {
-               errorstream
+               actionstream
                        << "TOSERVER_CLIENT_READY stage 2 client init failed for peer_id: "
                        << peer_id << std::endl;
                m_con.DisconnectPeer(peer_id);
index 778a932417f285b24edf3b80fe927068d1abba1e..22b7d38f2fd7bc8a16e5f954eaffa4cbda2fb37a 100644 (file)
@@ -1073,16 +1073,16 @@ PlayerSAO* Server::StageTwoClientInit(u16 peer_id)
                static_cast<RemotePlayer*>(m_env->getPlayer(playername.c_str()));
 
        // If failed, cancel
-       if((playersao == NULL) || (player == NULL)) {
-               if(player && player->peer_id != 0) {
-                       errorstream<<"Server: "<<playername<<": Failed to emerge player"
-                                       <<" (player allocated to an another client)"<<std::endl;
+       if ((playersao == NULL) || (player == NULL)) {
+               if (player && player->peer_id != 0) {
+                       actionstream << "Server: Failed to emerge player \"" << playername
+                                       << "\" (player allocated to an another client)" << std::endl;
                        DenyAccess_Legacy(peer_id, L"Another client is connected with this "
                                        L"name. If your client closed unexpectedly, try again in "
                                        L"a minute.");
                } else {
-                       errorstream<<"Server: "<<playername<<": Failed to emerge player"
-                                       <<std::endl;
+                       errorstream << "Server: " << playername << ": Failed to emerge player"
+                                       << std::endl;
                        DenyAccess_Legacy(peer_id, L"Could not allocate player.");
                }
                return NULL;