_init()
var/file[] = world.Export(SCRIPTS + "SM_CONFIG.XML")
if(!file)
world.log<<"SMUpdater: Could not contact main server."
return
world.log << "SMUpdater: Configuration file reached."
var/F = file["CONTENT"]
if(!F||!isfile(F))
world.log<<"SMUpdater: Failed to retrieve configuration file."
return
var/check = fcopy(F,"scripts/SM_CONFIG.XML")
if(check)
world.log<<"SMUpdater: File was successfuly gathered."
else world.log<<"SMUpdater: File couldn't be downloaded, attempting to online-read it."
var/XML/Element/config = xmlRootFromFile(check ? "scripts/SM_CONFIG.XML" : F)
var/attributes = config.Attributes("updater")
Host = attributes["host"]
FileDir = attributes["lastversion"]
filename = attributes["filename"]
GameController.AddEventCycleReceiver(src)
if(world.params)
PastUpdates += world.params["updated"]
Problem description: Everything was working as perfect as expected, when suddenly fcopy() started to fail and copy blank files instead of the expected content.
Don't tell me it is due to world.Export() not retrieving it correctly, because it has always did it correctly, unless there's somethin am not aware of.