X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/c7785828d571526e6f94d0df525fe10673827cd7..e337600f4c621ccd847d2e852ee5e2b6a0cd8dd6:/projects/sgauthstress/user.h diff --git a/projects/sgauthstress/user.h b/projects/sgauthstress/user.h index 150bf242..ef63a907 100644 --- a/projects/sgauthstress/user.h +++ b/projects/sgauthstress/user.h @@ -5,28 +5,34 @@ #include #include "stg/os_int.h" +#include "stg/blowfish.h" class USER { public: USER(const std::string & login, const std::string & password, uint32_t ip); + USER(const USER & rvalue); ~USER(); + USER & operator=(const USER & rvalue); + + bool InitNetwork(); + const std::string & GetLogin() const { return login; } uint32_t GetIP() const { return ip; } uint32_t GetAliveTimeout() const { return aliveTimeout; } uint32_t GetUserTimeout() const { return userTimeout; } int GetPhase() const { return phase; } - int GetRnd() const { return rnd; } + uint32_t GetRnd() const { return rnd; } int GetSocket() const { return sock; } time_t GetPhaseChangeTime() const { return phaseChangeTime; } BLOWFISH_CTX * GetCtx() { return &ctx; } void SetPhase(int p) { phase = p; time(&phaseChangeTime); } - void SetRnd(int r) { rnd = r; } - int IncRnd() { return ++rnd; } + void SetRnd(uint32_t r) { rnd = r; } + uint32_t IncRnd() { return ++rnd; } void SetAliveTimeout(uint32_t timeout) { aliveTimeout = timeout; } void SetUserTimeout(uint32_t timeout) { userTimeout = timeout; } @@ -38,7 +44,7 @@ class USER { uint32_t userTimeout; int phase; time_t phaseChangeTime; - int rnd; + uint32_t rnd; int sock; BLOWFISH_CTX ctx; };