From 1a284890a23188378db268500eb406f5505ff81b Mon Sep 17 00:00:00 2001 From: MadCamel Date: Sun, 26 Apr 2009 20:15:52 +0000 Subject: Changed all times to use UTC --- src/map/atcommand.c | 2 +- src/map/chrif.c | 2 +- src/map/clif.c | 6 +++--- src/map/npc.c | 2 +- src/map/pc.c | 2 +- src/map/script.c | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 07751bd..a981607 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -5222,7 +5222,7 @@ int atcommand_servertime(const int fd, struct map_session_data* sd, memset(temp, '\0', sizeof(temp)); time(&time_server); // get time in seconds since 1/1/1970 - datetime = localtime(&time_server); // convert seconds in structure + datetime = gmtime(&time_server); // convert seconds in structure // like sprintf, but only for date/time (Sunday, November 02 2003 15:12:52) strftime(temp, sizeof(temp)-1, msg_table[230], datetime); // Server time (normal time): %A, %B %d %Y %X. clif_displaymessage(fd, temp); diff --git a/src/map/chrif.c b/src/map/chrif.c index 40972f4..05fa603 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -805,7 +805,7 @@ int chrif_accountban(int fd) char tmpstr[2048]; timestamp = (time_t)RFIFOL(fd,7); // status or final date of a banishment strcpy(tmpstr, "Your account has been banished until "); - strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", localtime(×tamp)); + strftime(tmpstr + strlen(tmpstr), 24, "%d-%m-%Y %H:%M:%S", gmtime(×tamp)); clif_displaymessage(sd->fd, tmpstr); } clif_setwaitclose(sd->fd); // forced to disconnect for the change diff --git a/src/map/clif.c b/src/map/clif.c index 25ce1d4..7a80bd2 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -8435,11 +8435,11 @@ static int clif_parse(int fd) { if (sd && sd->state.auth) { if (sd->status.name != NULL) fprintf(fp, "%sPlayer with account ID %d (character ID %d, player name %s) sent wrong packet:\n", - asctime(localtime(&now)), sd->status.account_id, sd->status.char_id, sd->status.name); + asctime(gmtime(&now)), sd->status.account_id, sd->status.char_id, sd->status.name); else - fprintf(fp, "%sPlayer with account ID %d sent wrong packet:\n", asctime(localtime(&now)), sd->bl.id); + fprintf(fp, "%sPlayer with account ID %d sent wrong packet:\n", asctime(gmtime(&now)), sd->bl.id); } else if (sd) // not authentified! (refused by char-server or disconnect before to be authentified) - fprintf(fp, "%sPlayer with account ID %d sent wrong packet:\n", asctime(localtime(&now)), sd->bl.id); + fprintf(fp, "%sPlayer with account ID %d sent wrong packet:\n", asctime(gmtime(&now)), sd->bl.id); fprintf(fp, "\t---- 00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F"); for(i = 0; i < packet_len; i++) { diff --git a/src/map/npc.c b/src/map/npc.c index fa01d56..11725b3 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -349,7 +349,7 @@ int npc_event_do_clock(int tid,unsigned int tick,int id,int data) int c=0; time(&timer); - t=localtime(&timer); + t=gmtime(&timer); if (t->tm_min != ev_tm_b.tm_min ) { sprintf(buf,"OnMinute%02d",t->tm_min); diff --git a/src/map/pc.c b/src/map/pc.c index 2ac5ce1..982adea 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -818,7 +818,7 @@ int pc_authok(int id, int login_id2, time_t connect_until_time, short tmw_versio // message of the limited time of the account if (connect_until_time != 0) { // don't display if it's unlimited or unknow value char tmpstr[1024]; - strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), localtime(&connect_until_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S." + strftime(tmpstr, sizeof(tmpstr) - 1, msg_txt(501), gmtime(&connect_until_time)); // "Your account time limit is: %d-%m-%Y %H:%M:%S." clif_wis_message(sd->fd, wisp_server_name, tmpstr, strlen(tmpstr)+1); } diff --git a/src/map/script.c b/src/map/script.c index a8d9a83..48071d0 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -3437,7 +3437,7 @@ int buildin_gettimetick(struct script_state *st) /* Asgard Version */ case 1: //type 1:(Second Ticks: 0-86399, 00:00:00-23:59:59) time(&timer); - t=localtime(&timer); + t=gmtime(&timer); push_val(st->stack,C_INT,((t->tm_hour)*3600+(t->tm_min)*60+t->tm_sec)); break; case 0: @@ -3465,7 +3465,7 @@ int buildin_gettime(struct script_state *st) /* Asgard Version */ type=conv_num(st,& (st->stack->stack_data[st->start+2])); time(&timer); - t=localtime(&timer); + t=gmtime(&timer); switch(type){ case 1://Sec(0~59) @@ -3511,7 +3511,7 @@ int buildin_gettimestr(struct script_state *st) maxlen=conv_num(st,& (st->stack->stack_data[st->start+3])); tmpstr=(char *)aCalloc(maxlen+1,sizeof(char)); - strftime(tmpstr,maxlen,fmtstr,localtime(&now)); + strftime(tmpstr,maxlen,fmtstr,gmtime(&now)); tmpstr[maxlen]='\0'; push_str(st->stack,C_STR,tmpstr); -- cgit v1.2.3-70-g09d2