• Welcome to Valhalla Legends Archive.
 

Best method of implementing idle kick

Started by warz, April 19, 2006, 12:22 PM

Previous topic - Next topic

warz

Well, I figured I'd take my current bot a step further. I was thinking of ways to implement idle kick. I'm thinking I'll create a class for users attributes that are in the channel. Currently, I have a list that holds the users in the channel. I'm thinking of switching it to a map, and insert the users with an appropriate class holding their time of join, last time of talk, etc.

But, when it comes to the checking for idle users part, I can't really think of a good way to handle this. Would it be best to create a thread that just has an infinite loop with a sleep call in there so it loops every second, checking the users in the channel? This sounds like it'd be rather memory consuming. Anyone have any ideas?

rabbit

SID_PING should be received every 20 seconds.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

MyndFyre

In the past I have simply created timers that notify me when a user has been idle for x ms.  I reset the timer when the user talks.  I also don't bother if the user is exempt from such a kick.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

warz

I'll probably just use SID_PING. Sounds like a reasonable idea. The idle checking process isn't too high in priority, I'd assume.

Eric

Quote from: rabbit on April 19, 2006, 08:52 PM
SID_PING should be received every 20 seconds.

SID_PING is only sent by the server when the client itself is idle so if your client is dispatching messages or moderating the channel it'll throw off your timing scheme.