Valhalla Legends Archive

Programming => General Programming => C/C++ Programming => Topic started by: Mephisto on December 26, 2004, 06:16 PM

Title: Timer Objects
Post by: Mephisto on December 26, 2004, 06:16 PM
Is it possible to assign a timer to an object and then have it 'go off' or something?  Going off like perhaps calling a TimerProc function?  But instead of just setting a timer you know nothing about with SetTimer(), can you do something like this (psuedo code): TimerObject idleTime = BeginTimer(...); And then also be able to interupt that timer or reset that timer with a member function of that object or something?  Obviously whatever where there is which accomplishes this won't be what I describe above, but if there's a way to accomplish what I want.

What I am trying to accomplish is idleban essentially.  Each user in the channel is assigned a channel_user_data structure which has members like username, flags, access, ping, etc. and when that structure is filled out its object is assigned to a user map.  I want a timer object to be one of those members, and have it go off in a manner that I can detect it at any time (perhaps an event?) and then be able to respond appropriately (idleban for instance).
Title: Re: Timer Objects
Post by: Arta on December 27, 2004, 07:32 AM
(you can manipulate the delay on your wait function to do that)