ID:162336
 
Is it possible to send lists using world.Export()?

I couldn't figure out a way to do it with just the command alone so I created this:

world
proc
SendList(list/L,listname,world)
var/savefile/S = new()
S[listname]<<L
Export("[world]?list:[listname]",S)

world/Topic(T)
if(findtext(T,"list:"))
var/savefile/S = new(Import())
var/list/L
var/listname = copytext(T,6)
S[listname]>>L
//Set list to whatever
..()

Seems to work pretty well. Is there a better way of doing this?
Parameters.
Of course, you won't be able to send objects and such, but you can break a list of strings up and send it.

var/list/l = list("1","2","3","4")
var/parameter = list2params(l) // convert a list into param form
var/list/paramlist = params2list(parameter) // convert params into list form