diff options
Diffstat (limited to 'src/login')
-rw-r--r-- | src/login/Makefile | 4 | ||||
-rw-r--r-- | src/login/login.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/login/Makefile b/src/login/Makefile index d807238..0411129 100644 --- a/src/login/Makefile +++ b/src/login/Makefile @@ -1,8 +1,8 @@ all: login-server txt: login-server -COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.o -COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/lock.h ../common/malloc.h +COMMON_OBJ = ../common/core.o ../common/socket.o ../common/timer.o ../common/db.o ../common/lock.o ../common/malloc.o ../common/mt_rand.o +COMMON_H = ../common/core.h ../common/socket.h ../common/timer.h ../common/mmo.h ../common/version.h ../common/db.h ../common/lock.h ../common/malloc.h ../common/mt_rand.h login-server: login.o md5calc.o $(COMMON_OBJ) $(CC) -o ../../$@ login.o md5calc.o $(COMMON_OBJ) diff --git a/src/login/login.c b/src/login/login.c index 6c4ca82..b44eb19 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -25,6 +25,7 @@ #include "version.h" #include "db.h" #include "lock.h" +#include "mt_rand.h" #ifdef PASSWORDENC #include "md5calc.h" @@ -1153,8 +1154,8 @@ int mmo_auth(struct mmo_account* account, int fd) { sprintf(tmpstr + strlen(tmpstr), ".%03d", (int)tv.tv_usec / 1000); account->account_id = auth_dat[i].account_id; - account->login_id1 = rand(); - account->login_id2 = rand(); + account->login_id1 = mt_random(); + account->login_id2 = mt_random(); memcpy(account->lastlogin, auth_dat[i].lastlogin, 24); memcpy(auth_dat[i].lastlogin, tmpstr, 24); account->sex = auth_dat[i].sex; @@ -3785,8 +3786,6 @@ int do_init(int argc, char **argv) { save_config_in_log(); // not before, because log file name can be changed login_lan_config_read((argc > 1) ? argv[1] : LAN_CONF_NAME); - srand(time(NULL)); - for(i = 0; i< AUTH_FIFO_SIZE; i++) auth_fifo[i].delflag = 1; for(i = 0; i < MAX_SERVERS; i++) |