quote:
Originally posted by SpunkyLoveMuff
I always try to check the user when a timer event is triggered since I saw one of your posts. I'm just in the habit of doing it all the time now without thinking.
hehe...
Well, the difference between these methods is that if you check with the
Userid, you can still let the timers run while another temporary user is signed in if you give your timers an unique name (like an added userid string as in my 'signin flood protection' script).
And in case that this other temporary user gives the PC back to the original user, and the timers are still running, the script actually will do as if nothing happened, so to speak.
It will also allow you to run timers of two uses at the same time for example; while one user is logged in, the timer of the other user is still running so it can trigger when he signs back in, etc...
eg: when you implement this method in the 'exit messenger' script above, one user can set his 'delayed signout' and he doesn't need to worry about it when his little sister wants to sign in for one minute. After his sister is done, he simply can sign in himself, and the 'delayed signout' will still be counting down happy, he doesn't need to set it again or calculate again how many minutes he must set....
-
If you use the other method (canceling timers at signout), then the timers need to be initialized each time again and you can't run timers for two different users. This method is of course easier to keep track of timers too.
-
So that's the difference....
Despite what method you choose, if you don't take in consideration that another user can sign in (and that timers do not cancel automatically when this happens), many errors can occur:
eg: ... all of a sudden his little sister comes crying downstair because she suddenly was signed out and she didn't do anything....