- #ifdef IA_DEBUG
- aliveSent = u.aliveSent;
- #endif
- memcpy(&ctx, &u.ctx, sizeof(BLOWFISH_CTX));
- };
+ #ifdef IA_DEBUG
+ aliveSent = u.aliveSent;
+ #endif
+ memcpy(&ctx, &u.ctx, sizeof(BLOWFISH_CTX));
+ }
+
+ IA_USER(const std::string & l,
+ ConstUserPtr u,
+ uint16_t p,
+ int ver)
+ : login(l),
+ user(u),
+ lastSendAlive(0),
+ rnd(static_cast<uint32_t>(random())),
+ port(p),
+ messagesToSend(),
+ protoVer(ver),
+ password(user->GetProperties().password.Get())
+ {
+ unsigned char keyL[PASSWD_LEN];
+ memset(keyL, 0, PASSWD_LEN);
+ strncpy((char *)keyL, password.c_str(), PASSWD_LEN);
+ Blowfish_Init(&ctx, keyL, PASSWD_LEN);