Server crash for logging too much data?

Started by KAKAN, Mar 07, 2016, 01:30 PM

Previous topic - Next topic

KAKAN

Well, I copied this code from the public beta:-
function onPlayerCrashDump( player, crash )
{
  TXTAddLine( FPATH + "crashes/" + GetFullTime2() + "_" + player.Name + ".log", crash );
}
function TXTAddLine(filename, text)
{
  local fhnd = file(filename, "a+");
  foreach(char in text) fhnd.writen(char, 'c');
  fhnd.writen('\n', 'c');
  fhnd.close();
  fhnd=null;
}
Any reasons why would it crash the server? I just added this line to the TXTAddLine function: fhnd.close();p
Why did it crash the server? I see no reason of crashing the server. Before someone asks: How did it crash? Let me tell, the whole crashlog was printed and then the server crashed.
oh no

Mötley

#1
I do not understand this but maybe it is due to the spaces. Also seems you may of missed some writes, Replace With that and see what happens..

TXTAddLine( FPATH + "crashes/"+GetFullTime2()+""+player.Name+".log", "Crash", crash );
TXTAddLine, Never messed with that,.

If not I will Create something eles for you( i think that line caused the crash but i could be wrong)


KAKAN

Quote from: Mr_Motley on Mar 11, 2016, 08:52 PMI do not understand this but maybe it is due to the spaces. Also seems you may of missed some writes, Replace With that and see what happens..

TXTAddLine( FPATH + "crashes/"+GetFullTime2()+""+player.Name+".log", "Crash", crash );
TXTAddLine, Never messed with that,.

If not I will Create something eles for you( i think that line caused the crash but i could be wrong)


The crash happened only once, never encountered it again :P
So, I'm going to lock the topic. Anyways, thanks!
oh no