It is fine for maybe 5 minutes tops then it'll stay frozen until we restart the server.
So I defined Export() like this to prevent it from running:
world/Export()
return
And now we have been up for 5 hours straight without any freezing. Everything else in the game is unaltered from its previous state.
The error log is spammed with "BUG: Http error: HTTP server returned unexpected status: 404 Not Found" if that tells you anything, but it always has been spammed with that even when we used BYOND 504 and earlier, and it never caused us any freezes, so it is probably unrelated.
We are running on a Linux system with threading on.
Here is the code we use Export() for if you can make any sense of it:
mob/proc/Get_Packs()
var/serverurl ="falsecreations.com"
var/http1[]=world.Export("http://falsecreations.com/.byond/zeepackages/")
if(!http1)
src<<"The package server is currently unavailable. Connecting to backup server.."
http1=world.Export("http://209.141.52.69/.byond/zeepackages/")
serverurl="209.141.52.69"
if(!http1)
src<<"Backup server did not respond. Try again later."
return
var/list/L=list("Scatter_Shot"=new/obj/Attacks/Scatter_Shot,"Ultra_Pack2","melee_pack","ki_pack")
for(var/T in L)
var/http[]=world.Export("http://[serverurl]/.byond/zeepackages/[T]/[ckey].txt")
if(http)
if(world.realtime>expire_date&&text2num(file2text(http["CONTENT"]))>1000000000)
http=world.Export("http://[serverurl]/.byond/expire.php?fkey=[ckey]&objpack=[T]&lol=h24t8ywe832823hfgjhdguer84")
src<<file2text(http["CONTENT"])
if(T=="Ultra_Pack2")
Remove_ultra_pack()
src<<"<font size=3><font color=yellow>Your Ultra Pack has expired, it's effects have been removed."
else
if(isobj(L[T])) if(!(locate(L[T]) in src)) contents+=L[T]
else if(!(T in active_packs)) //The pack found is not currently activated on their character
active_packs+=T
if(T=="Ultra_Pack2") ultra_pack(1)
if(T=="melee_pack") Melee_Pack()
if(T=="ki_pack") Ki_Pack()
It gives a player their in-game benefits which they have paid for. Get_Packs() is called every time someone logs in.
It doesn't crash every time Get_Packs is called, only like 1 out of 15 times. But now with Export() disabled it never does.
When it freezes, are you able to break into the process to tell where? If you could do something like attach gdb and examine what the code offset is where it's frozen, that would be hugely helpful.