• Welcome to Valhalla Legends Archive.
 

Minute Ban (Methods?)

Started by Networks, November 28, 2004, 03:17 PM

Previous topic - Next topic

Networks

One method I am trying to do this with, which seems kind of easy is to use SetTimer/ KillTimer API functions but  I am not really sure how to do this.

I want set the timer the user sets and use 'Addressof' for the timer to call the sub/function to unban the user but how can I set it to unban a specified user in the settimer procedure? Also I have to have a different nIDEvent for every timer how do I do this? Do I set it at like 1000 so that none of my other timers are affected?

I very confused on how to do this. Anyone's methods are welcome.

For those of who don't know minute ban is:
Basically bans a user for a special amount of time and later unban the user automatically after the time is up.

The-FooL

Its been a while since I've done this, but when you create the timer, you get a timerID.  You'll have to keep track of which timerID belongs to which user.  Then, when the timer fires off the function, you can unban the specific user and remove that timer.

Networks

Don't you specify an ID during the SetTimer procedure?

Eric

#3
Creating a timer for every timed ban that occurs? ew @ wasting overhead.

When banning a user, store the username that was banned along with the system's tick and have a single timer set to x number of seconds which would loop through the list comparing the system's tick when the ban occured to the current tick.  Unless you're planning on having second-accurate timing, it'd be a good idea to set the timer to about a 60 second interval since the automatic unbanning of users shouldn't be of top priority.

LivedKrad

Actually, that's quite handy. I guess you could order the list from least difference to greatest difference as compared to the timer so it can unban by precedence. Clever!

Networks

I was thinking about an array and a timer but was just thinking of diff. ways. I'll just stick with that..thanks. ( I really needed someones input :) )