Help - Debug -
Rizard - 21.09.2009
WASZAAP I'm BRЬNO!
I'm trying to get my gamemode working on 0.3 but as far as I know it's my gamemode wich crashes A LOT on 0.2 already so I'm thinking about first things first.
I'm here, maybe to find someone who can debug my gamemode or to ask everyone (or at least as many people that want to spend time giving a respons)
To tell me what in the lord can cause your server to crash as many times as mine (every 20 min. at least - on 0.3 everytime I relog)
Or every exp you have on what caused your server to crash?
Info:
1. Gamemode is homemade, so not form from any release, just some scripts like admin scripts and house scripts I've been using.... (need to know wich one? - pls do say so)
2. I'm not using ServerFFS (if that's of any help at all)
3. ask me anything you need?
PS: I'm not gonna release this script (maybe also cause it's bugged) so if you're someone trying to help me with the intention of doing so? pls gtfo ? :/
Grts Riz
and thnx in advance
Re: Help - Debug -
Mikep. - 21.09.2009
Quote:
Originally Posted by Rizard
what in the lord can cause your server to crash as many times as mine
|
Alot of things.
Does the server crash or just your players?
You could be reading from/writing to a file/folder that doesn't exist.
Re: Help - Debug -
Rizard - 21.09.2009
the server crashes, not realy the players, at first I thought it was my dedi wich was beeing rebooted every 20 min
![Shocked](images/smilies/surprised.gif)
but since I tried anotehr another gamemode lolz it's mine where the prob is
and wow, never thought of that! I'm gonna check things out right away, thnx for your quick respons allready
Pls don't let this stop anyone from posting more answers like this
Grts Riz
EDIT:
Found something that doesn't create any files, could that cause a crash (or 2?
![Tongue](images/smilies/razz.gif)
)
this is the code...
pawn Код:
public OnPlayerUpdate(playerid)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid])
{
new string3[32];
new pname3[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname3, sizeof(pname3));
format(string3, sizeof(string3), "%s.cer", pname3);
new File: pFile = fopen(string3, io_write);
if (pFile)
{
new var[32];
format(var, 32, "%s\n", PlayerInfo[playerid][pPassword]);fwrite(pFile, var);
fclose(pFile);
new File: hFile = fopen(string3, io_append);
PlayerInfo[playerid][pCash] = GetPlayerMoney(playerid);
format(var, 32, "Kills=%d\n",PlayerInfo[playerid][pKills]);fwrite(hFile, var);
format(var, 32, "Deaths=%d\n",PlayerInfo[playerid][pDeaths]);fwrite(hFile, var);
format(var, 32, "Money=%d\n",PlayerInfo[playerid][pCash]);fwrite(hFile, var);
format(var, 32, "Bank=%d\n",PlayerInfo[playerid][pBank]);fwrite(hFile, var);
fclose(hFile);
}
}
}
return 1;
}
I didn't find any files with a .cer extension so I'm thinking this ain't working. In the mean time I'll leave if out and test my server again
Again, pls don't let this stop anyone with helpfull repons.
Grts Riz
Re: Help - Debug -
ev0lution - 21.09.2009
Quote:
Originally Posted by Rizard
the server crashes, not realy the players, at first I thought it was my dedi wich was beeing rebooted every 20 min ![Shocked](images/smilies/surprised.gif) but since I tried anotehr another gamemode lolz it's mine where the prob is
and wow, never thought of that! I'm gonna check things out right away, thnx for your quick respons allready
Pls don't let this stop anyone from posting more answers like this
Grts Riz
EDIT:
Found something that doesn't create any files, could that cause a crash (or 2? ![Tongue](images/smilies/razz.gif) )
this is the code...
I didn't find any files with a .cer extension so I'm thinking this ain't working. In the mean time I'll leave if out and test my server again
Again, pls don't let this stop anyone with helpfull repons.
Grts Riz
|
Err..
I'm not sure if that would cause a crash, it would, however, cause extreme lag when players are on.
You're updating those files under OnPlayerUpdate, which means it's opening files and writing data to them up to 50 times per second. I suggest you change that, though it's probably not the source of your crash.
The .cer files created from that script aren't being put in a folder, so if there are any they should be in the "scriptfiles" directory of your server.
I suggest putting in some debug messages on various callbacks (using print/SendClientMessageToAll), to see what happens before your server crashes. Then, go through the script, and check the code after your last debug message, as that is most likely where the problem is.
Re: Help - Debug -
Rizard - 21.09.2009
but if no directory is given, the folder will be 'scriptfiles' right?... anyway
awesome, I'll get back to you on that one
![Smiley](images/smilies/smile.png)
thnx
Grts Riz
edit: since still busy on the last one - more helpfull answers welcome
btw: can timers cause my server to crash?
Don't wanne double post so hope you reading this ... , where does the 'print("tekst")' go since I don't have the server window
Grts Riz