X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/bb0ffb6084b51b95a8cbce53ecfea95b1e71982e..41a0ee6544be0e947c6062a966a93310b9ea5ce5:/projects/rscriptd/listener.h diff --git a/projects/rscriptd/listener.h b/projects/rscriptd/listener.h index 16c49219..ae0b40d5 100644 --- a/projects/rscriptd/listener.h +++ b/projects/rscriptd/listener.h @@ -16,7 +16,7 @@ /* * Author : Boris Mikhailenko - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ #include @@ -29,7 +29,7 @@ #include "stg/os_int.h" #include "stg/blowfish.h" #include "stg/rs_packets.h" -#include "stg/stg_logger.h" +#include "stg/logger.h" struct UserData { @@ -56,7 +56,7 @@ struct AliveData : public UserData class IsNotTimedOut : public std::unary_function { 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,10 +94,9 @@ 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(); @@ -134,7 +133,7 @@ private: class DisconnectUser : public std::unary_function { public: - DisconnectUser(LISTENER & l) : listener(l) {}; + explicit DisconnectUser(LISTENER & l) : listener(l) {}; void operator()(const UserData & data) { listener.Disconnect(data);