- #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,
+ CONST_USER_PTR u,
+ uint16_t p,
+ int ver)
+ : login(l),
+ user(u),
+ phase(),
+ lastSendAlive(0),
+ rnd(static_cast<uint32_t>(random())),
+ port(p),
+ ctx(),
+ messagesToSend(),
+ protoVer(ver),
+ password(user->GetProperty().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);
+
+ #ifdef IA_DEBUG
+ aliveSent = false;
+ #endif
+ }