]> git.stg.codes - stg.git/blobdiff - projects/rscriptd/listener.cpp
Cryptography with void* in the interfaces.
[stg.git] / projects / rscriptd / listener.cpp
index ead5d33bdcebde8771e78cd2377c5c4b69ac9f49..3d8fd48e0c8b5da6f4763870de5069967d2d1c70 100644 (file)
@@ -36,6 +36,7 @@
 #include "stg/scriptexecuter.h"
 #include "stg/locker.h"
 #include "stg/common.h"
+#include "stg/const.h"
 #include "listener.h"
 
 void InitEncrypt(BLOWFISH_CTX * ctx, const std::string & password);
@@ -43,16 +44,15 @@ void Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 
 //-----------------------------------------------------------------------------
 LISTENER::LISTENER()
-    : WriteServLog(GetStgLogger()),
+    : WriteServLog(STG::Logger::get()),
       port(0),
       running(false),
       receiverStopped(true),
       processorStopped(true),
       userTimeout(0),
-      listenSocket(0)
+      listenSocket(0),
+      version("rscriptd listener v.1.2")
 {
-version = "rscriptd listener v.1.2";
-
 pthread_mutex_init(&mutex, NULL);
 }
 //-----------------------------------------------------------------------------
@@ -312,7 +312,7 @@ else if (packetHead.packetType == RS_DISCONNECT_PACKET)
         }
     }
 
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 pending.push_back(data);
 
 return false;
@@ -397,6 +397,7 @@ while (it != pending.end() && count < 256)
             {
             printfd(__FILE__, "Disconnect user '%s'\n", it->login.c_str());
             // Disconnect existing user
+            uit->params = it->params;
             Disconnect(*uit);
             users.erase(uit);
             }
@@ -412,7 +413,7 @@ while (it != pending.end() && count < 256)
     ++it;
     ++count;
     }
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 pending.erase(pending.begin(), it);
 }
 //-----------------------------------------------------------------------------