]> git.stg.codes - stg.git/blobdiff - projects/sgauthstress/user.cpp
Add missing includes
[stg.git] / projects / sgauthstress / user.cpp
index bea1c6b7126b47c3b650f2ad79b69f40a316a673..c2092c265d2abc879c780404538a8534d0ada1f5 100644 (file)
@@ -1,26 +1,32 @@
+#include <sys/socket.h>
+#include <netinet/in.h>
+
+#include <cstring>
+
 #include "user.h"
+#include "stg/ia_packets.h"
 
 USER::USER(const std::string & l,
-           const std::string & pwd)
+           const std::string & pwd,
+           uint32_t i)
     : login(l),
+      password(pwd),
+      ip(i),
+      aliveTimeout(0),
+      userTimeout(0),
       phase(1),
-      rnd(0),
-      sock(0)
+      phaseChangeTime(0),
+      rnd(0)
 {
-char key[IA_PASSWD_LEN];
+unsigned char key[IA_PASSWD_LEN];
 memset(key, 0, IA_PASSWD_LEN);
-strncpy(key, password.c_str(), IA_PASSWD_LEN);
+strncpy((char *)key, password.c_str(), IA_PASSWD_LEN);
 Blowfish_Init(&ctx, key, IA_PASSWD_LEN);
-}
 
-USER::~USER()
-{
+sock = socket(AF_INET, SOCK_DGRAM, 0);
 }
 
-void USER::Connect()
-{
-}
-
-void USER::Disconnect()
+USER::~USER()
 {
+close(sock);
 }