How to prevent server loops?
#6

check all your function calls. i could place a wager on a recursion problem:
pawn Код:
stock a(){
    new bla=b();
    return 1;
}
stock b(){
    new bla=a();
    return 1;
}
add that upper crap to your script, and call it per command. plop: server frozen, until the heap gets filled up. then the server should crash and restart.
hm. when you get to execute the upper recursion, clock the time it needs to restart.
btw, the recursion bug will NOT get noticed by the compiler. you see the problem?

ok, which callbacks could be interesting?... in your script, is there a distane check which calls a selfmade sqrt() function maybe? a quicksort()? or a fibbonaci generator? it could even be a random lotto() generator which calls itself when a number already was chosen, or a random weapon surprise for a player...

addition: the assert() function acts like a if(), BUT it exits the server when the statement is not true.
combining this with a GetTickCount() in each suspicious function, you could let check a function ITSELF how often it gets called (by itself or other function). if its belongs to a timer, then you know to raise the difference (in ms indeed) for the time-difference-estimation. or better, first ignore timer-functions.
Reply


Messages In This Thread
How to prevent server loops? - by Tomboeg - 01.03.2013, 21:40
Re: How to prevent server loops? - by Vince - 01.03.2013, 21:44
Re: How to prevent server loops? - by AndreT - 01.03.2013, 21:51
Re: How to prevent server loops? - by Tomboeg - 03.03.2013, 11:33
Re: How to prevent server loops? - by RajatPawar - 03.03.2013, 11:45
Re: How to prevent server loops? - by Babul - 03.03.2013, 11:50
Re: How to prevent server loops? - by xeeZ - 03.03.2013, 13:45
Re: How to prevent server loops? - by Tomboeg - 13.03.2013, 21:39

Forum Jump:


Users browsing this thread: 1 Guest(s)