Timer

07/08/2009 04:33 Arcotemple:)#1
Would thi sbe how i go about making a timer for my server?

In General.cs
Code:
        public static System.Timers.Timer Thetimer;
Code:
                //Regular Save Timer
                Thetimer = new System.Timers.Timer();
                Thetimer.Interval = 5000;//5 seconds
                Thetimer.Elapsed += new ElapsedEventHandler(Thetimer_Elapsed);
                Thetimer.Start();
and then im done

is ther anything im missing
im making an auto save timer for lotf
07/08/2009 04:52 hunterman01#2
just a hint dont make it auto save every 5 secs thats WAY to much
07/08/2009 04:59 Arcotemple:)#3
Quote:
Originally Posted by hunterman01 View Post
just a hint dont make it auto save every 5 secs thats WAY to much
how often do you suggest?

15 seconds?
07/08/2009 05:02 Pete1990#4
Ever 2-3mins is good
07/08/2009 06:12 sawickas#5
No every 1 second xD
07/08/2009 06:20 kinshi88#6
Don't make a timer to save, waste of memory and all that jazz.
Just have it save when people logout, and maybe when they do important shit, like trade or win items, etc.
07/08/2009 06:32 Arcotemple:)#7
Quote:
Originally Posted by kinshi88 View Post
Don't make a timer to save, waste of memory and all that jazz.
Just have it save when people logout, and maybe when they do important shit, like trade or win items, etc.
and how would i go about doing that?
07/08/2009 07:34 hunterman01#8
Quote:
Originally Posted by Arcotemple:) View Post
and how would i go about doing that?
Honestly i would say every 10-15 mintues or like kinshi said when they log out
07/08/2009 11:57 ~*NewDuuDe*~#9
LOTF has a save function for that. Saves whenever a person logs off or you close the server using ''enter''
07/08/2009 12:03 habbo245#10
[Only registered and activated users can see links. Click Here To Register...]


Check My error :( Thanks
07/08/2009 12:04 Kiyono#11
Quote:
Originally Posted by habbo245 View Post


Check My error :( Thanks
Not your thread.
07/08/2009 12:13 ~*NewDuuDe*~#12
@habbo245

Show us the code.
With the somewhat lame spanish knowledge I have I can confirm it's a socket error.
Well post ur code here.
07/08/2009 19:23 PeTe Ninja#13
you need timer elapsed