Valhalla Legends Forums Archive | Visual Basic Programming | Minute Ban (Methods?)

AuthorMessageTime
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.
November 28, 2004, 9:17 PM
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.
November 28, 2004, 10:28 PM
Networks
Don't you specify an ID during the SetTimer procedure?
November 29, 2004, 12:09 AM
LoRd
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.
November 29, 2004, 1:24 AM
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!
November 29, 2004, 2:37 AM
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 :) )
November 29, 2004, 3:49 AM

Search