From d0404fd0e8877ebf280323f41dac519dc4652cc8 Mon Sep 17 00:00:00 2001 From: stskeeps Date: Sun, 29 Oct 2000 17:25:08 +0000 Subject: [PATCH] +- Added TS2ts (supporting the SJB64 stuff), and fixed the !0 timestamp bug --- Changes | 1 + include/h.h | 1 + src/s_user.c | 11 ++++------- src/support.c | 8 ++++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Changes b/Changes index 8d22592ac..b93abe1e1 100644 --- a/Changes +++ b/Changes @@ -670,3 +670,4 @@ - Fixed the hashing bug (thank you ROXnet ...) - Fixed a wierd channel message bug || - Fixed a bug where non-NS servers would crash when linking +- Added TS2ts (supporting the SJB64 stuff), and fixed the !0 timestamp bug \ No newline at end of file diff --git a/include/h.h b/include/h.h index 29112a5e7..7620984bd 100644 --- a/include/h.h +++ b/include/h.h @@ -42,6 +42,7 @@ extern int bootopt; extern TS TSoffset; /* Prototype added to force errors -- Barubary */ extern TS check_pings(TS now, int check_kills); +extern TS TS2ts(char *s); /* Remmed out for win32 compatibility.. as stated of 467leaf win32 port.. */ diff --git a/src/s_user.c b/src/s_user.c index edc606f12..c6440af5a 100644 --- a/src/s_user.c +++ b/src/s_user.c @@ -1358,10 +1358,7 @@ int m_nick(cptr, sptr, parc, parv) */ if (parc > 3) { - if (*parv[3] != '!') - lastnick = atoi(parv[3]); - else - lastnick = xbase64dec(parv[3] + 1); + lastnick = TS2ts(parv[3]); if (parc > 5) differ = (mycmp(acptr->user->username, parv[4]) || mycmp(acptr->user->realhost, parv[5])); @@ -1442,7 +1439,7 @@ int m_nick(cptr, sptr, parc, parv) ** A NICK change has collided (e.g. message type ":old NICK new"). */ if (parc > 2) - lastnick = atoi(parv[2]); + lastnick = TS2ts(parv[2]); differ = (mycmp(acptr->user->username, sptr->user->username) || mycmp(acptr->user->realhost, sptr->user->realhost)); sendto_failops @@ -1527,7 +1524,7 @@ int m_nick(cptr, sptr, parc, parv) if (parc > 2) sptr->hopcount = atoi(parv[2]); if (parc > 3) - sptr->lastnick = atoi(parv[3]); + sptr->lastnick = TS2ts(parv[3]); else /* Little bit better, as long as not all upgraded */ sptr->lastnick = TStime(); } @@ -1569,7 +1566,7 @@ int m_nick(cptr, sptr, parc, parv) !MyClient(sptr) && parc > 2 && atoi(parv[2]) < sptr->lastnick) sptr->lastnick = (MyClient(sptr) - || parc < 3) ? TStime() : atoi(parv[2]); + || parc < 3) ? TStime() : TS2ts(parv[2]); add_history(sptr, 1); sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick); sendto_serv_butone_token(cptr, parv[0], MSG_NICK, TOK_NICK, diff --git a/src/support.c b/src/support.c index 65c8326b5..7a178d632 100644 --- a/src/support.c +++ b/src/support.c @@ -39,6 +39,14 @@ extern void outofmemory(); #define is_enabled match +long TS2ts(char *s) +{ + if (*s == '!') + return (xbase64dec(s + 1)); + else + return (atoi(s)); +} + char *my_itoa(int i) { static char buf[128];