ID:156243
 
I'm not sure whether or not BYOND can do this, but is it possible to start a dmb file and have it connect to an outside server?

Example would be like MSN with how you run the exe and it connects to a server hosted elsewhere.
I hope I'm being clear enough, but this is a quickly done question.

Anyway, if you understand and have an answer- thanks!

-Kumorii (:
Yes it's possible using world.Export() and world.Topic().
In response to Ripiz (#1)
Yes, what Ripiz said: you can use world.Export()> and world.Topic()

For example:

mob/verb/test()
var/list/ParamsToSend=list()
ParamsToSend["Name"] = src.key
var/http[] = world.Export("byond://127.0.0.1:1000[list2params(ParamsToSend)]")


and in the server that's going to receive something:

world/Topic(T)
var/list/ParamsToReceive=params2list(T)
if(T["Action"] == "My Key")
world << ParamsToReceive["Key"]
return


THERE ARE MUCH BETTER WAYS TO DO THIS, IS JUST AN EXAMPLE!

Also, correct me if i'm not wrong, didn't test the code.
In response to Ocean King (#2)
I don't see how declaring http[] will prove any use, since Export() can't send direct lists. From your logic, you appear to be trying to turn http[] into a list that the external server returns in Topic(), which won't happen.

Also, the way you set up world/Topic() is pretty messy.
In response to Maximus_Alex2003 (#3)
"THERE ARE MUCH BETTER WAYS TO DO THIS, IS JUST AN EXAMPLE!"

and yes, i've missed a #