]> git.stg.codes - stg.git/blobdiff - projects/rscriptd/listener.h
Move projects back into subfolder.
[stg.git] / projects / rscriptd / listener.h
index 4a012c776135e1c647c9530a27091c8d984c68e5..7fb71ee388629e35b1788a4828331449aabc6feb 100644 (file)
 #include <vector>
 #include <list>
 #include <functional>
+#include <cstdint>
 
-#include "os_int.h"
-#include "blowfish.h"
-#include "rs_packets.h"
-#include "stg_logger.h"
+#include "stg/blowfish.h"
+#include "stg/rs_packets.h"
+#include "stg/logger.h"
 
 struct UserData
 {
@@ -56,7 +56,7 @@ struct AliveData : public UserData
 
 class IsNotTimedOut : public std::unary_function<const AliveData &, bool> {
     public:
-        IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
+        explicit IsNotTimedOut(double to) : timeout(to), now(time(NULL)) {}
         bool operator()(const AliveData & data) const
         {
             return difftime(now, data.lastAlive) < timeout;
@@ -94,22 +94,18 @@ private:
     // Networking stuff
     bool                PrepareNet();
     bool                FinalizeNet();
-    bool                WaitPackets(int sd) const;
     bool                RecvPacket();
     // Parsing stuff
-    bool                CheckHeader(const RS_PACKET_HEADER & header) const;
+    bool                CheckHeader(const RS::PACKET_HEADER & header) const;
     bool                GetParams(char * buffer, UserData & data);
     // Processing stuff
     void                ProcessPending();
     void                ProcessTimeouts();
     bool                Disconnect(const UserData & data) const;
     bool                Connect(const UserData & data) const;
-    // Decryption stuff
-    void                InitEncrypt(BLOWFISH_CTX * ctx, const std::string & password);
-    void                Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
 
     BLOWFISH_CTX        ctxS;
-    STG_LOGGER &        WriteServLog;
+    STG::Logger&        WriteServLog;
 
     mutable std::string errorStr;
     std::string         scriptOnConnect;
@@ -137,7 +133,7 @@ private:
 
 class DisconnectUser : public std::unary_function<const UserData &, void> {
     public:
-        DisconnectUser(LISTENER & l) : listener(l) {};
+        explicit DisconnectUser(LISTENER & l) : listener(l) {};
         void operator()(const UserData & data)
         {
             listener.Disconnect(data);