Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Question: time(NULL) ?  (Read 4914 times)

0 Members and 1 Guest are viewing this topic.

n00bie

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 411
Question: time(NULL) ?
« 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);
etc.

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 ?
Thanks
Logged
I am always doing things that which I cannot do, in order that I may learn how to do it.

SpaceDoG

  • Anope User
  • Offline Offline
  • Posts: 183
    • http://www.hypermutt.net
(No subject)
« Reply #1 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.
Logged

Trystan Scott Lee

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 343
(No subject)
« Reply #2 on: May 25, 2006, 07:42:59 PM »

time() can be return formatted. Calling it with NULL means just return the default.
Logged
my God my tourniquet, return to me salvation

Pieter Bootsma

  • Team
  • *
  • Offline Offline
  • Posts: 189
    • http://geniusdex.net/
(No subject)
« Reply #3 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...
Logged
Pages: [1]   Go Up