mob/proc/ChatLog(var/Info) /// (CHAT STUFF)
set background=1 //Tells it to preiodically rest
var/wtf=0 //?? No fuckin clue.
if(length(Info)>=5000) //The maximum length being set. Info = chat log as far as I can tell.
Info="This entry was too long to be apended to the chat log." //Output, duh.
if(src.client) //If the source is a user.
LOLWTF //No idea. Looks like it's being used as a placeholder for [return] for some reason . . .
wtf+=1 //Counter gets bumped up one for wtf..)
var/XXX=file("HURR/ChatLogs/[src.ckey]/[src.ckey][wtf].txt") //Creatres a variable for a file..Also makes file I think. dunno.
if(fexists(XXX)) //If the file exsists,
var/size=length(XXX) //How long the file is..
if(size>(1024*100)) //If it exceeds maximum size.
goto LOLWTF //Go back to start? I'm assuming this nulls it but they could've just used return. Confirmed, probably just used as a "return" subject.
else //Otherwise,
XXX<<"<br>[Info]" //Put info into file? X = file, X << = output to file.. then linebreak and [info]. But if that was true then it ignores messages based on size?
else //Confirmed, the code above literally just omits the message if it's past a certain length..
XXX<<"<br>[Info]"
Problem description: No real problem, i'm spending my time slowly breaking down some code a friend gave me for study purposes..
So far i've noticed that the project is...well it -looks- jumbled as hell. Can somebody just help me break this one segment down? Oh and why is there a size limit? Could this potentially cause lag if it was large? I'm a novice to intermediate byond coder so please try to treat me like a guy with no clue on how this crud works
That'll jump to LOLWTF then add 1 to wtf again which is in the file's path at the end.