summaryrefslogtreecommitdiff
path: root/src/login_sql
diff options
context:
space:
mode:
authorMadCamel <madcamel@gmail.com>2009-04-26 20:15:52 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-03 13:01:33 +0200
commit1a284890a23188378db268500eb406f5505ff81b (patch)
tree225c681087c44f674bf3597f42b92fd541444c2d /src/login_sql
parente443b683ed7e38648b61e4e52d87e681d194a2b3 (diff)
downloadtmwa-1a284890a23188378db268500eb406f5505ff81b.tar.gz
tmwa-1a284890a23188378db268500eb406f5505ff81b.tar.bz2
tmwa-1a284890a23188378db268500eb406f5505ff81b.tar.xz
tmwa-1a284890a23188378db268500eb406f5505ff81b.zip
Changed all times to use UTC
Diffstat (limited to 'src/login_sql')
-rw-r--r--src/login_sql/login.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index 2fab051..60a6f68 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -337,7 +337,7 @@ int mmo_auth( struct mmo_account* account , int fd){
// auth start : time seed
gettimeofday(&tv, NULL);
- strftime(tmpstr, 24, "%Y-%m-%d %H:%M:%S",localtime(&(tv.tv_sec)));
+ strftime(tmpstr, 24, "%Y-%m-%d %H:%M:%S",gmtime(&(tv.tv_sec)));
sprintf(tmpstr+19, ".%03d", (int)tv.tv_usec/1000);
jstrescapecpy(t_uid,account->userid);
@@ -502,7 +502,7 @@ int mmo_auth( struct mmo_account* account , int fd){
//login {0-account_id/1-userid/2-user_pass/3-lastlogin/4-logincount/5-sex/6-connect_untl/7-last_ip/8-ban_until/9-state}
if (ban_until_time != 0) { // if account is banned
- strftime(tmpstr, 20, date_format, localtime(&ban_until_time));
+ strftime(tmpstr, 20, date_format, gmtime(&ban_until_time));
tmpstr[19] = '\0';
if (ban_until_time > time(NULL)) { // always banned
return 6; // 6 = Your are Prohibited to log in until %s
@@ -843,7 +843,7 @@ int parse_fromchar(int fd){
timestamp = time(NULL);
else
timestamp = tmptime;
- tmtime = localtime(&timestamp);
+ tmtime = gmtime(&timestamp);
tmtime->tm_year = tmtime->tm_year + (short)RFIFOW(fd,6);
tmtime->tm_mon = tmtime->tm_mon + (short)RFIFOW(fd,8);
tmtime->tm_mday = tmtime->tm_mday + (short)RFIFOW(fd,10);
@@ -1267,7 +1267,7 @@ int parse_login(int fd) {
char tmpstr[256];
time_t ban_until_time;
ban_until_time = atol(sql_row[0]);
- strftime(tmpstr, 20, date_format, localtime(&ban_until_time));
+ strftime(tmpstr, 20, date_format, gmtime(&ban_until_time));
tmpstr[19] = '\0';
memcpy(WFIFOP(fd,3), tmpstr, 20);
} else { // we send error message