Quote:
Originally Posted by concucu
this is orgin code from the Krylfilter bro.
|
So ? you're just copying his mistakes without thinking ?
Quote:
Originally Posted by sonzenbi
What wrong with Thread.Sleep ? :confused:
Try checking proc _ReturnPM in ur DB
|
Read below
Quote:
Originally Posted by hoangphan7
Do you understand which i said?
Yes orign krylfilter v29.
Not problem in Thread.Sleep brother! Look at the picture, this class working fine. They execute every 1000ms. But packet only send every ~5000ms (i timing between 2 packet he sent)
[Only registered and activated users can see links. Click Here To Register...]
|
You are just mimicking a timer behavior with an infinite loop and a thread.sleep while the end result will be just as a you need it doesn't mean that you should do it because it gives you the result that you expect. It's horrible.
Thread.Sleep(); will make the kernel-32 stop scheduling this thread for execution for the given time span you specify.
It means that you will have to context switch in and out of this thread and other threads rapidly every time, and you are just throwing away valuable resources for no reason, context-switching is very expensive especially in a multi-threaded program.
You will just end up bottle necking your application with your own code, and you have many alternatives to achieve the same behavior that you want but in a safer and efficient manner, so why not do it properly ?
Also i could not help but notice your AutoNotice problem, You should work with proper async pattern, a time stamp in your table and a way to detected if the client is actually spawned in the world if you prepare all those things beforehand it'll be much easier to avoid unexpected behavior.