Anope IRC Services => Anope General => Topic started by: n00bie on May 25, 2006, 06:16:16 PM

Title: Question: time(NULL) ?
Post by: n00bie on May 25, 2006, 06:16:16 PM
On some modules when a pseudo-clients or some services clients join a channel, they put some code like:
send_cmd(s_SomeClient, "SJOIN %lu %s", time(NULL), serviceschan);

So, my main question is, what is the meaning of time(NULL) on this code, and what does it do? Is it dangerous to sjoin a pseudo-clients without using time(NULL) options ?
Post by: SpaceDoG on May 25, 2006, 06:37:47 PM
I think so. I know that the time(NULL) will give the current time stamp since the Epoch. I also know that you must use it when using svsnick (on Unreal) to force change a users nick otherwise it causes a nick collision among other things.
Post by: Trystan Scott Lee on May 25, 2006, 07:42:59 PM
time() can be return formatted. Calling it with NULL means just return the default.
Post by: Pieter Bootsma on May 26, 2006, 10:11:15 AM
It is used to fill the TS field of the sent message, which is rather important. Wrong TS fields can lead to desynchs and whatnot...