Kicking ip because they didn't logon to the game
#1

Maybe you get to know what's actually my problem is by reading title!
When a player connect to server, The server get freezes and the player Couldn't Connect. it just say " Connected. Joining the game... " But after sometime! It says " Server Closed the Connection "
I think it is a problem of infinite loops. this problem occur with me once, i really don't know how to fix it!

is there is any code which prevent this error? if yes, then suggest me the codes so i can search it in my gamemode!
After reading This, i really didn't get the solution!
Reply
#2

Show your OnPlayerConnect public.
Reply
#3

Mellnik has stated a code that shows where you are getting the loop thrown.

Quote:
Originally Posted by Mellnik
View Post
There is another way to combat this using crashdetect.
Put this at the very top of your GM and use CTRL+H to replace any for by for___loop.

pawn Code:
#include <crashdetect>

#define for___loop(%1;%2;%3) \
    PrintAmxBacktrace(); \
    for(%1;%2;%3)
   
#define while___loop(%1) \
    PrintAmxBacktrace(); \
    while(%1)
This prints the call stack everytime a loop gets called. So as soon as you run into this problem simply open your server log and look for the last backtrace.

Code:
[03:34:13] [debug] AMX backtrace:
[03:34:13] [debug] #0 native PrintAmxBacktrace () [6cf42e23] from crashdetect.DLL
[03:34:13] [debug] #1 00001fa8 in main () at C:\server\gamemodes\test.pwn:30
The line number now directs you to the infinite loop in your script (Don't forget to compile with -d3 parameter)
Add this code on your script.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)