X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/90e389f6ec12e60a62c362296ffcf314feb5b03d..8272f5d139d947fdbe469dfd7afc3ddd6ea7a603:/projects/rscriptd/listener.h diff --git a/projects/rscriptd/listener.h b/projects/rscriptd/listener.h index 1c88149a..7fb71ee3 100644 --- a/projects/rscriptd/listener.h +++ b/projects/rscriptd/listener.h @@ -25,8 +25,8 @@ #include #include #include +#include -#include "stg/os_int.h" #include "stg/blowfish.h" #include "stg/rs_packets.h" #include "stg/logger.h" @@ -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(); @@ -106,7 +105,7 @@ private: bool Connect(const UserData & data) const; BLOWFISH_CTX ctxS; - STG_LOGGER & WriteServLog; + STG::Logger& WriteServLog; mutable std::string errorStr; std::string scriptOnConnect; @@ -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);